public final class CacheHelper extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
CMD_FLUSH_ALL_CACHES |
static String |
CMD_FLUSH_CHILDREN |
static String |
CMD_FLUSH_CHILDS
Deprecated.
in favour of
CMD_FLUSH_CHILDREN |
static String |
CMD_FLUSH_MATCHINGPERMISSIONS |
static String |
CMD_FLUSH_OUTPUT_CACHES |
static String |
CMD_FLUSH_PATH |
static String |
CMD_FLUSH_REGEXP |
static String |
CMD_FLUSH_REGEXPDEP |
static String |
CMD_FLUSH_URLRESOLVER |
static String |
CMD_FLUSH_VANITYURL |
| Constructor and Description |
|---|
CacheHelper() |
| Modifier and Type | Method and Description |
|---|---|
static void |
flushAllCaches()
Flushes all back-end and front-end Jahia caches on the current cluster node
only.
|
static void |
flushAllCaches(boolean propagateInCluster)
Flushes all back-end and front-end Jahia caches.
|
static void |
flushCachesForManager(String cacheManagerName,
boolean propagateInCluster)
Flushes the caches of the specified cache manager.
|
static void |
flushEhcacheByName(String cacheName)
Flushes the specified Ehcache on the current cluster node only.
|
static void |
flushEhcacheByName(String cacheName,
boolean propagateInCluster)
Flushes the specified Ehcache.
|
static void |
flushOutputCaches()
Flushes front-end Jahia caches (module HTML output caches) on the current cluster node only.
|
static void |
flushOutputCaches(boolean propagateInCluster)
Flushes front-end Jahia caches (module HTML output caches).
|
static void |
flushOutputCachesForPath(String path,
boolean flushSubtree) |
static void |
flushOutputCachesForPaths(Set<String> paths,
boolean flushSubtree) |
static net.sf.ehcache.CacheManager |
getCacheManager(String cacheManagerName) |
static Map<String,CacheManagerInfo> |
getCacheManagerInfos(boolean withConfig,
boolean withSizeInBytes)
Returns the configuration and statistics information for all the available cache managers.
|
static Object |
getObjectValue(net.sf.ehcache.Ehcache cache,
String key)
Returns a value of the specified cache element (by key), considering also classloader-aware deserialization if required.
|
static Object |
getObjectValue(net.sf.ehcache.Element cacheElement)
Returns a value of the specified cache element, considering also classloader-aware deserialization if required.
|
static void |
registerMBeans(String cacheManagerName) |
static void |
sendCacheFlushCommandToCluster(String command)
Sends the specified cache flush command to other cluster nodes (if clustering is activated).
|
static void |
sendCacheFlushCommandToCluster(String command,
String eventMessage)
Sends the specified cache flush command with a message to other cluster nodes (if clustering is activated).
|
static void |
sendMultipleCacheFlushCommandsToCluster(String command,
Collection<String> eventMessages)
Sends the specified cache flush commands to other cluster nodes (if clustering is activated).
|
public static final String CMD_FLUSH_ALL_CACHES
public static final String CMD_FLUSH_CHILDREN
@Deprecated public static final String CMD_FLUSH_CHILDS
CMD_FLUSH_CHILDRENpublic static final String CMD_FLUSH_MATCHINGPERMISSIONS
public static final String CMD_FLUSH_OUTPUT_CACHES
public static final String CMD_FLUSH_PATH
public static final String CMD_FLUSH_REGEXP
public static final String CMD_FLUSH_REGEXPDEP
public static final String CMD_FLUSH_URLRESOLVER
public static final String CMD_FLUSH_VANITYURL
public static void flushAllCaches()
public static void flushAllCaches(boolean propagateInCluster)
propagateInCluster is set to true also propagates the flush to other cluster nodes.propagateInCluster - if set to true the flush is propagated to other cluster nodespublic static void flushCachesForManager(String cacheManagerName, boolean propagateInCluster)
cacheManagerName - the cache manager name to flush caches forpropagateInCluster - if set to true the flush is propagated to other cluster nodespublic static void flushEhcacheByName(String cacheName)
cacheName - the name of the cache to flushpublic static void flushEhcacheByName(String cacheName, boolean propagateInCluster)
propagateInCluster is set to true also propagates the flush to other cluster nodes.cacheName - the name of the cache to flushpropagateInCluster - if set to true the flush is propagated to other cluster nodespublic static void flushOutputCaches()
public static void flushOutputCaches(boolean propagateInCluster)
propagateInCluster is set to true also propagates the
flush to other cluster nodes.propagateInCluster - if set to true the flush is propagated to other cluster nodespublic static void flushOutputCachesForPath(String path, boolean flushSubtree)
public static void flushOutputCachesForPaths(Set<String> paths, boolean flushSubtree)
public static net.sf.ehcache.CacheManager getCacheManager(String cacheManagerName)
public static Map<String,CacheManagerInfo> getCacheManagerInfos(boolean withConfig, boolean withSizeInBytes)
withConfig - if true the configuration information will be also availablewithSizeInBytes - if true the calculation of the cache sizes (bytes) will be also availablepublic static Object getObjectValue(net.sf.ehcache.Ehcache cache, String key)
cache - the target cachekey - the element keypublic static Object getObjectValue(net.sf.ehcache.Element cacheElement)
cacheElement - the cache elementpublic static void registerMBeans(String cacheManagerName)
public static void sendCacheFlushCommandToCluster(String command)
command - the command to be sentpublic static void sendCacheFlushCommandToCluster(String command, String eventMessage)
command - the command to be senteventMessage - custom event messagepublic static void sendMultipleCacheFlushCommandsToCluster(String command, Collection<String> eventMessages)
command - the command to be senteventMessages - a collection of event messages to sendCopyright © 2004–2020 Jahia Solutions Group SA. All rights reserved.