|
ehcache | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.ehcache.distribution.RMISynchronousCacheReplicator
public class RMISynchronousCacheReplicator
Listens to CacheManager and Cache events and propagates those to
CachePeer peers of the Cache.
| Field Summary | |
|---|---|
protected boolean |
replicatePuts
Whether to replicate puts. |
protected boolean |
replicateRemovals
Whether to replicate removes |
protected boolean |
replicateUpdates
Whether to replicate updates. |
protected boolean |
replicateUpdatesViaCopy
Whether an update (a put) should be by copy or by invalidation, (a remove). |
protected Status |
status
The status of the replicator. |
| Constructor Summary | |
|---|---|
protected |
RMISynchronousCacheReplicator(boolean replicatePuts,
boolean replicateUpdates,
boolean replicateUpdatesViaCopy,
boolean replicateRemovals)
Constructor for internal and subclass use |
| Method Summary | |
|---|---|
boolean |
alive()
Checks that the replicator is is STATUS_ALIVE. |
void |
dispose()
Give the replicator a chance to cleanup and free resources when no longer needed |
boolean |
isReplicateUpdatesViaCopy()
Returns whether update is through copy or invalidate |
(package private) static java.util.List |
listRemoteCachePeers(Cache cache)
Package protected List of cache peers |
boolean |
notAlive()
Asserts that the replicator is active. |
void |
notifyElementExpired(Cache cache,
Element element)
Called immediately after an element is found to be expired. |
void |
notifyElementPut(Cache cache,
Element element)
Called immediately after an element has been put into the cache. |
void |
notifyElementRemoved(Cache cache,
Element element)
Called immediately after an element has been removed. |
void |
notifyElementUpdated(Cache cache,
Element element)
Called immediately after an element has been put into the cache and the element already existed in the cache. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Status status
STATUS_ALIVE
protected final boolean replicatePuts
protected final boolean replicateUpdates
protected final boolean replicateUpdatesViaCopy
#replicateUpdates is true.
protected final boolean replicateRemovals
| Constructor Detail |
|---|
protected RMISynchronousCacheReplicator(boolean replicatePuts,
boolean replicateUpdates,
boolean replicateUpdatesViaCopy,
boolean replicateRemovals)
replicatePuts - replicateUpdates - replicateUpdatesViaCopy - replicateRemovals - | Method Detail |
|---|
public void notifyElementPut(Cache cache,
Element element)
throws 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 CacheEventListenercache - the cache emitting the notificationelement - the element which was just put into the cache.
CacheException
public void notifyElementUpdated(Cache cache,
Element element)
throws 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 CacheEventListenercache - the cache emitting the notificationelement - the element which was just put into the cache.
CacheException
public void notifyElementRemoved(Cache cache,
Element element)
throws CacheException
Element has been removed, only what was the key of the element is known.
notifyElementRemoved in interface CacheEventListenercache - the cache emitting the notificationelement - just deleted
CacheExceptionstatic java.util.List listRemoteCachePeers(Cache cache)
cache -
public final void notifyElementExpired(Cache cache,
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 CacheEventListenercache - 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
DiskStorea 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 final boolean isReplicateUpdatesViaCopy()
CacheReplicator
isReplicateUpdatesViaCopy in interface CacheReplicatorpublic final boolean notAlive()
notAlive in interface CacheReplicatorpublic final boolean alive()
STATUS_ALIVE.
alive in interface CacheReplicatorSTATUS_ALIVE, else false.public void dispose()
dispose in interface CacheEventListener
|
ehcache | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||