|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jboss.cache.AbstractTreeCacheListener
org.jboss.cache.ConsoleListener
public class ConsoleListener
This class provides a non-graphical view of JBossCache replication events for a replicated cache.
It can be utilized as a standalone application or as a component in other applications.
WARNING: take care when using this class in conjunction with transactionally replicated cache's as it can cause deadlock situations due to the reading of values for nodes in the cache.
| Constructor Summary | |
|---|---|
ConsoleListener(TreeCache cache)
Constructor. |
|
ConsoleListener(TreeCache cache,
boolean startCache,
boolean stopCache)
Constructor. |
|
| Method Summary | |
|---|---|
void |
cacheStarted(TreeCache cache)
Called when the cache is started. |
void |
cacheStopped(TreeCache cache)
Called when the cache is stopped. |
void |
listen()
Instructs this class to listen for cache replication events. |
void |
listen(boolean wait)
Instructs this class to listen for cache replication events. |
static void |
main(java.lang.String[] args)
The main method. |
void |
nodeActivate(Fqn fqn,
boolean pre)
Called when a node is to be or has been activated into memory via the CacheLoader that was evicted earlier. |
void |
nodeCreated(Fqn fqn)
Called when a node is created |
void |
nodeEvict(Fqn fqn,
boolean pre)
Called when a node is about to be evicted or has been evicted from the in-memory cache. |
void |
nodeEvicted(Fqn fqn)
Called when a node is evicted (not the same as remove()). |
void |
nodeLoaded(Fqn fqn)
Called when a node is loaded into memory via the CacheLoader. |
void |
nodeModified(Fqn fqn)
Called when a node is modified, e.g., one (key, value) pair in the internal map storage has been modified. |
void |
nodeModify(Fqn fqn,
boolean pre,
boolean isLocal)
Called when a node is about to be modified or has been modified. |
void |
nodePassivate(Fqn fqn,
boolean pre)
Called when a node is to be or has been written to the backend store via the cache loader due to a node eviction by the eviction policy provider |
void |
nodeRemove(Fqn fqn,
boolean pre,
boolean isLocal)
Called when a node is about to be removed or has been removed from the in-memory cache. |
void |
nodeRemoved(Fqn fqn)
Called when a node is removed. |
void |
nodeVisited(Fqn fqn)
Called when a node is visisted, i.e., get(). |
void |
viewChange(org.jgroups.View new_view)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ConsoleListener(TreeCache cache)
throws java.lang.Exception
When using this constructor, this class with attempt to start and stop the specified cache.
cache - the cache to monitor for replication events.
java.lang.Exception
public ConsoleListener(TreeCache cache,
boolean startCache,
boolean stopCache)
throws java.lang.Exception
cache - the cache to monitor for replication events.startCache - indicates whether or not the cache should be started by
this class.stopCache - indicates whether or not the cache should be stopped by
this class.
java.lang.Exception| Method Detail |
|---|
public void listen()
throws java.lang.Exception
This method waits indefinately. Use the notify method of this class (using traditional Java thread notification semantics) to cause this method to return.
java.lang.Exception
public void listen(boolean wait)
throws java.lang.Exception
wait - whether or not this method should wait indefinately.
If this parameter is set to true, using the
notify method of this class (using traditional Java thread
notification semantics) will cause this method to return.
java.lang.Exceptionpublic void cacheStarted(TreeCache cache)
TreeCacheListener
cacheStarted in interface TreeCacheListenercacheStarted in class AbstractTreeCacheListenerpublic void cacheStopped(TreeCache cache)
TreeCacheListener
cacheStopped in interface TreeCacheListenercacheStopped in class AbstractTreeCacheListenerpublic void nodeCreated(Fqn fqn)
TreeCacheListener
nodeCreated in interface TreeCacheListenernodeCreated in class AbstractTreeCacheListenerpublic void nodeEvicted(Fqn fqn)
TreeCacheListener
nodeEvicted in interface TreeCacheListenernodeEvicted in class AbstractTreeCacheListenerpublic void nodeLoaded(Fqn fqn)
TreeCacheListenerTreeCacheListener.nodeCreated(Fqn).
nodeLoaded in interface TreeCacheListenernodeLoaded in class AbstractTreeCacheListenerpublic void nodeModified(Fqn fqn)
TreeCacheListener
nodeModified in interface TreeCacheListenernodeModified in class AbstractTreeCacheListener
public void nodeModify(Fqn fqn,
boolean pre,
boolean isLocal)
ExtendedTreeCacheListenerTreeCacheListener.nodeModified(Fqn)
which will be merged with this method in release 1.3.
nodeModify in interface ExtendedTreeCacheListenernodeModify in class AbstractTreeCacheListenerTreeCacheListener.nodeModified(Fqn)public void nodeRemoved(Fqn fqn)
TreeCacheListener
nodeRemoved in interface TreeCacheListenernodeRemoved in class AbstractTreeCacheListenerpublic void nodeVisited(Fqn fqn)
TreeCacheListener
nodeVisited in interface TreeCacheListenernodeVisited in class AbstractTreeCacheListenerpublic void viewChange(org.jgroups.View new_view)
viewChange in interface TreeCacheListenerviewChange in class AbstractTreeCacheListener
public void nodeEvict(Fqn fqn,
boolean pre)
ExtendedTreeCacheListenerTreeCacheListener.nodeEvicted(Fqn)
which will be merged with method in release 1.3.
nodeEvict in interface ExtendedTreeCacheListenernodeEvict in class AbstractTreeCacheListenerTreeCacheListener.nodeEvicted(Fqn)
public void nodeRemove(Fqn fqn,
boolean pre,
boolean isLocal)
ExtendedTreeCacheListenerTreeCacheListener.nodeRemoved(Fqn)
which will be merged with this method in release 1.3.
nodeRemove in interface ExtendedTreeCacheListenernodeRemove in class AbstractTreeCacheListenerTreeCacheListener.nodeRemoved(Fqn)
public void nodeActivate(Fqn fqn,
boolean pre)
ExtendedTreeCacheListener
nodeActivate in interface ExtendedTreeCacheListenernodeActivate in class AbstractTreeCacheListener
public void nodePassivate(Fqn fqn,
boolean pre)
ExtendedTreeCacheListener
nodePassivate in interface ExtendedTreeCacheListenernodePassivate in class AbstractTreeCacheListenerpublic static void main(java.lang.String[] args)
args - command line arguments dictated by convention.
The first command line argument is the name of the
JBossCache configuration file to be utilized
for configuration of the cache. Only the name of the
configuration file is necessary as it is read off of the
classpath.
If a configuration file is not specified on the command line,
jboss-cache.xml will be the assumed file name.
All command line arguments after the first are ignored.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||