org.pm4j.core.pm.api
Class PmCacheApi

java.lang.Object
  extended by org.pm4j.core.pm.api.PmCacheApi

public class PmCacheApi
extends java.lang.Object


Nested Class Summary
static class PmCacheApi.CacheKind
          The PM content caches.
 
Constructor Summary
PmCacheApi()
           
 
Method Summary
static void clearCachedPmValues(PmObject pm, PmCacheApi.CacheKind... cacheKinds)
          Clears cached content (if there was something cached).
Causes a reload of the content with the next request.
static void clearCachedPmValues(PmObject pm, java.util.Set<PmCacheApi.CacheKind> cacheSet)
          An alternate signature for #clearCachedPmValues(org.pm4j.core.pm.PmObject.CacheKind...) that is a little more efficient, since it can quickly check the set if a specific cache kind is to clear.
static void clearCachedPmValuesInCtxtPath(PmObject pm, boolean includeSession, PmCacheApi.CacheKind... cacheKinds)
          Calls #clearCachedPmValues() on all PMs in the pmParent hierarchy.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PmCacheApi

public PmCacheApi()
Method Detail

clearCachedPmValues

public static void clearCachedPmValues(PmObject pm,
                                       PmCacheApi.CacheKind... cacheKinds)
Clears cached content (if there was something cached).
Causes a reload of the content with the next request.

Parameters:
cacheKinds - The set of caches to be cleared. If no cacheKind is specified, all cache kinds will be cleared.

clearCachedPmValues

public static void clearCachedPmValues(PmObject pm,
                                       java.util.Set<PmCacheApi.CacheKind> cacheSet)
An alternate signature for #clearCachedPmValues(org.pm4j.core.pm.PmObject.CacheKind...) that is a little more efficient, since it can quickly check the set if a specific cache kind is to clear.

Subclasses that need to extend the clear implementation should override this method.

Parameters:
cacheSet - Specification of the cache kinds to clear.

clearCachedPmValuesInCtxtPath

public static void clearCachedPmValuesInCtxtPath(PmObject pm,
                                                 boolean includeSession,
                                                 PmCacheApi.CacheKind... cacheKinds)
Calls #clearCachedPmValues() on all PMs in the pmParent hierarchy.

Parameters:
includeSession - true causes a clear within the complete context path, including the PmConversation instance(s) within the path.
false causes a clear on all context items exclusive the containing session (and its contexts).
cacheKinds - The set of caches to be cleared. If no cacheKind is specified, all cache kinds will be cleared.