|
ehcache | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.ehcache.event.CacheManagerEventListenerRegistry
public class CacheManagerEventListenerRegistry
Registered listeners for registering and unregistering CacheManagerEventListeners and sending notifications to registrants.
There is one of these per CacheManager. It is a composite listener.
Constructor Summary | |
---|---|
CacheManagerEventListenerRegistry()
Construct a new registry |
Method Summary | |
---|---|
void |
dispose()
Tell listeners to dispose themselves. |
java.util.Set |
getRegisteredListeners()
Gets a Set of the listeners registered to this class |
Status |
getStatus()
Returns the listener status. |
boolean |
hasRegisteredListeners()
Returns whether or not at least one cache manager event listeners has been registered. |
void |
init()
Initialises the listeners, ready to receive events. |
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. |
boolean |
registerListener(CacheManagerEventListener cacheManagerEventListener)
Adds a listener to the notification service. |
java.lang.String |
toString()
Returns a string representation of the object. |
boolean |
unregisterListener(CacheManagerEventListener cacheManagerEventListener)
Removes a listener from the notification service. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public CacheManagerEventListenerRegistry()
Method Detail |
---|
public final boolean registerListener(CacheManagerEventListener cacheManagerEventListener)
cacheManagerEventListener
- the listener to add. Can be null, in which case nothing happens
public final boolean unregisterListener(CacheManagerEventListener cacheManagerEventListener)
cacheManagerEventListener
- the listener to remove
public boolean hasRegisteredListeners()
public java.util.Set getRegisteredListeners()
CacheManagerEventListener
public void init()
init
in interface CacheManagerEventListener
public Status getStatus()
getStatus
in interface CacheManagerEventListener
public void dispose()
dispose
in interface CacheManagerEventListener
public 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 CacheManagerEventListener
cacheName
- the name of the Cache
the operation relates toCacheEventListener
public 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 CacheManagerEventListener
cacheName
- the name of the Cache
the operation relates topublic java.lang.String toString()
toString
method returns a string that
"textually represents" this object. The result should
be a concise but informative representation that is easy for a
person to read.
toString
in class java.lang.Object
|
ehcache | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |