public interface CacheManagerEventListener
CacheManager
event occurs.
The lifecycle events are:
Cache
Cache
CacheEventListener
Modifier and Type | Method and Description |
---|---|
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(String cacheName)
Called immediately after a cache has been added and activated.
|
void |
notifyCacheRemoved(String cacheName)
Called immediately after a cache has been disposed and removed.
|
void init() throws CacheException
CacheException
- - all exceptions are wrapped in CacheExceptionStatus getStatus()
void dispose() throws CacheException
CacheException
- - all exceptions are wrapped in CacheExceptionvoid notifyCacheAdded(String cacheName)
Note that the CacheManager calls this method from a synchronized method. Any attempt to call a synchronized method on CacheManager from this method will cause a deadlock.
Note that activation will also cause a CacheEventListener status change notification
from Status.STATUS_UNINITIALISED
to
Status.STATUS_ALIVE
. Care should be taken on processing that
notification because:
CacheManager.getEhcache(String)
will cause a deadlock.
cacheName
- the name of the Cache
the operation relates toCacheEventListener
void notifyCacheRemoved(String cacheName)
Note that the CacheManager calls this method from a synchronized method. Any attempt to call a synchronized method on CacheManager from this method will cause a deadlock.
Note that a CacheEventListener
status changed will also be triggered. Any
attempt from that notification to access CacheManager will also result in a deadlock.
cacheName
- the name of the Cache
the operation relates toCopyright 2001-2020, Terracotta, Inc.