public class BfCacheRemoveListener
extends java.lang.Object
implements net.sf.ehcache.event.CacheEventListener
CacheManagerEventListener
Constructor and Description |
---|
BfCacheRemoveListener() |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone()
Creates a clone of this listener.
|
void |
dispose()
Give the replicator a chance to cleanup and free resources when no longer
needed
|
void |
notifyElementEvicted(net.sf.ehcache.Ehcache arg0,
net.sf.ehcache.Element element) |
void |
notifyElementExpired(net.sf.ehcache.Ehcache cache,
net.sf.ehcache.Element element)
Called immediately after an element is found to be expired.
|
void |
notifyElementPut(net.sf.ehcache.Ehcache cache,
net.sf.ehcache.Element element)
Called immediately after an element has been put into the cache.
|
void |
notifyElementRemoved(net.sf.ehcache.Ehcache cache,
net.sf.ehcache.Element element)
Called immediately after an element has been removed.
|
void |
notifyElementUpdated(net.sf.ehcache.Ehcache cache,
net.sf.ehcache.Element element)
Called immediately after an element has been put into the cache and the
element already existed in the cache.
|
void |
notifyRemoveAll(net.sf.ehcache.Ehcache cache) |
public void notifyElementRemoved(net.sf.ehcache.Ehcache cache, net.sf.ehcache.Element element) throws net.sf.ehcache.CacheException
Element
has been removed, only what was the
key of the element is known.
notifyElementRemoved
in interface net.sf.ehcache.event.CacheEventListener
cache
- the cache emitting the notificationelement
- just deletednet.sf.ehcache.CacheException
public void notifyElementPut(net.sf.ehcache.Ehcache cache, net.sf.ehcache.Element element) throws net.sf.ehcache.CacheException
Cache.put(net.sf.ehcache.Element)
method will block
until this method returns.
Implementers may wish to have access to the Element's fields, including
value, so the element is provided. Implementers should be careful not to
modify the element. The effect of any modifications is undefined.notifyElementPut
in interface net.sf.ehcache.event.CacheEventListener
cache
- the cache emitting the notificationelement
- the element which was just put into the cache.net.sf.ehcache.CacheException
public void notifyElementUpdated(net.sf.ehcache.Ehcache cache, net.sf.ehcache.Element element) throws net.sf.ehcache.CacheException
Cache.put(net.sf.ehcache.Element)
method will
block until this method returns.
Implementers may wish to have access to the Element's fields, including
value, so the element is provided. Implementers should be careful not to
modify the element. The effect of any modifications is undefined.notifyElementUpdated
in interface net.sf.ehcache.event.CacheEventListener
cache
- the cache emitting the notificationelement
- the element which was just put into the cache.net.sf.ehcache.CacheException
public void notifyElementExpired(net.sf.ehcache.Ehcache cache, net.sf.ehcache.Element element)
Cache.remove(Object)
method will block until this
method returns.
As the Element
has been expired, only what was the key of the
element is known.
Elements are checked for expiry in Ehcache at the following times:
Cache.DEFAULT_EXPIRY_THREAD_INTERVAL_SECONDS
notifyElementExpired
in interface net.sf.ehcache.event.CacheEventListener
cache
- the cache emitting the notificationelement
- the element that has just expired
Deadlock Warning: expiry will often come from the
DiskStore
expiry thread. It holds a lock to the
DiskStore at the time the notification is sent. If the
implementation of this method calls into a synchronized
Cache
method and that subsequently calls into
DiskStore a deadlock will result. Accordingly implementers of
this method should not call back into Cache.public void dispose()
dispose
in interface net.sf.ehcache.event.CacheEventListener
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in interface net.sf.ehcache.event.CacheEventListener
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
- if the listener could not be cloned.public void notifyElementEvicted(net.sf.ehcache.Ehcache arg0, net.sf.ehcache.Element element)
notifyElementEvicted
in interface net.sf.ehcache.event.CacheEventListener
public void notifyRemoveAll(net.sf.ehcache.Ehcache cache)
notifyRemoveAll
in interface net.sf.ehcache.event.CacheEventListener