net.sf.ehcache.event
Interface CacheManagerEventListener
public
interface
CacheManagerEventListener
Allows implementers to register callback methods that will be executed when a
CacheManager
event occurs.
The events include:
- adding a
Cache
- removing a
Cache
Callbacks to these methods are synchronous and unsynchronized. It is the responsibility of the implementer
to safely handle the potential performance and thread safety issues depending on what their listener is doing.
Since: 1.2
Version: $Id: CacheManagerEventListener.java 28 2006-04-15 05:12:32Z gregluck $
Author: Greg Luck
See Also: CacheEventListener
public void notifyCacheAdded(String cacheName)
Called immediately after a cache has been added and activated.
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_UNINITIALISED to
STATUS_ALIVE. Care should be
taken on processing that notification because:
- the cache will not yet be accessible from the CacheManager.
- the addCaches methods whih cause this notification are synchronized on the CacheManager. An attempt to call
getCache will cause a deadlock.
The calling method will block until this method returns.
Parameters: cacheName the name of the Cache
the operation relates to
See Also: CacheEventListener
public void notifyCacheRemoved(String cacheName)
Called immediately after a cache has been disposed and removed. The calling method will block until
this method returns.
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.
Parameters: cacheName the name of the Cache
the operation relates to