|
ehcache | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.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. |
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(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. |
boolean |
registerListener(CacheManagerEventListener cacheManagerEventListener)
Adds a listener to the notification service. |
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 Set getRegisteredListeners()
CacheManagerEventListenerpublic void init()
init in interface CacheManagerEventListenerpublic Status getStatus()
getStatus in interface CacheManagerEventListenerpublic void dispose()
dispose in interface CacheManagerEventListenerpublic void notifyCacheAdded(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(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 topublic 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 Object
|
ehcache | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||