|
ehcache]]> | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.ehcache.management.ManagementService
public final class ManagementService
Ehcache CacheManagers and Caches have lifecycles. Often normal use of a CacheManager will be
to shut it down and create a new one from within a running JVM. For example, in JEE environments,
applications are often undeployed and then redeployed. A servlet listener, ShutdownListener
enables this to be detected and the CacheManager shutdown.
| Method Summary | |
|---|---|
void |
dispose()
Stop the listener and free any resources. |
Status |
getStatus()
Returns the listener status. |
void |
init()
Call to start the listeners and do any other required initialisation. |
void |
notifyCacheAdded(java.lang.String cacheName)
Called immediately after a cache has been added and activated. |
void |
notifyCacheRemoved(java.lang.String cacheName)
Called immediately after a cache has been disposed and removed. |
static void |
registerMBeans(CacheManager cacheManager,
javax.management.MBeanServer mBeanServer,
boolean registerCacheManager,
boolean registerCaches,
boolean registerCacheConfigurations,
boolean registerCacheStatistics)
This method causes the selected monitoring options to be be registered with the provided MBeanServer for caches in the given CacheManager. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static void registerMBeans(CacheManager cacheManager,
javax.management.MBeanServer mBeanServer,
boolean registerCacheManager,
boolean registerCaches,
boolean registerCacheConfigurations,
boolean registerCacheStatistics)
throws CacheException
cacheManager - the CacheManager to listen tomBeanServer - the MBeanServer to register MBeans toregisterCacheManager - Whether to register the CacheManager MBeanregisterCaches - Whether to register the Cache MBeansregisterCacheConfigurations - Whether to register the CacheConfiguration MBeansregisterCacheStatistics - Whether to register the CacheStatistics MBeans
CacheException
public void init()
throws CacheException
init in interface CacheManagerEventListenerCacheException - - all exceptions are wrapped in CacheExceptionpublic Status getStatus()
getStatus in interface CacheManagerEventListener
public void dispose()
throws CacheException
dispose in interface CacheManagerEventListenerCacheException - - all exceptions are wrapped in CacheExceptionpublic void notifyCacheAdded(java.lang.String cacheName)
Status.STATUS_UNINITIALISED to
Status.STATUS_ALIVE. Care should be taken on processing that
notification because:
CacheManager.getEhcache(String)
will cause a deadlock.
notifyCacheAdded in interface CacheManagerEventListenercacheName - the name of the Cache the operation relates toCacheEventListenerpublic void notifyCacheRemoved(java.lang.String cacheName)
CacheEventListener status changed will also be triggered. Any
attempt from that notification to access CacheManager will also result in a deadlock.
notifyCacheRemoved in interface CacheManagerEventListenercacheName - the name of the Cache the operation relates to
|
ehcache]]> | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||