|
ehcache | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.ehcache.distribution.jgroups.JGroupManager
public class JGroupManager
The main Jgroup class for replication via JGroup. Starts up the Jgroup communication bus and listen for message in the bus. Because of Ehcache design we have to register this as a CachePeer. In reality this class listen for change on the bus and tells the cachemanager to update.
| Constructor Summary | |
|---|---|
JGroupManager(CacheManager m,
java.lang.String connect)
Construc a new JGroupManager with a specific Jgroups connection String |
|
| Method Summary | |
|---|---|
void |
dispose()
Providers may be doing all sorts of exotic things and need to be able to clean up on dispose. |
java.io.Serializable |
getCache()
|
java.util.List |
getElements(java.util.List keys)
Gets a list of elements from the cache, for a list of keys, without updating Element statistics. |
java.lang.String |
getGuid()
Gets the globally unique id for the underlying Cache instance. |
java.util.List |
getKeys()
Returns a list of all elements in the cache, whether or not they are expired. |
java.lang.String |
getName()
Gets the cache name. |
Element |
getQuiet(java.io.Serializable key)
Gets an element from the cache, without updating Element statistics. |
Status |
getStatus()
|
long |
getTimeForClusterToForm()
Time for a cluster to form. |
java.lang.String |
getUrl()
The URL for the remote replicator to connect. |
java.lang.String |
getUrlBase()
The URL base for the remote replicator to connect. |
void |
handleNotification(java.io.Serializable arg0)
Handles notification: Looks at type of message and unwrap if the argument is a list |
void |
init()
Notifies providers to initialise themselves. |
java.util.List |
listRemoteCachePeers(Ehcache cache)
|
void |
memberJoined(org.jgroups.Address arg0)
|
void |
memberLeft(org.jgroups.Address arg0)
|
void |
put(Element element)
Put an element in the cache. |
void |
registerPeer(java.lang.String rmiUrl)
Register a new peer. |
boolean |
remove(java.io.Serializable key)
Removes an Element from the Cache. |
void |
removeAll()
Removes all cached items. |
void |
send(java.util.List eventMessages)
Send the cache peer with an ordered list of EventMessages. |
void |
unregisterPeer(java.lang.String rmiUrl)
Unregisters a peer. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JGroupManager(CacheManager m,
java.lang.String connect)
m - the cache managerconnect - the connection String| Method Detail |
|---|
public java.io.Serializable getCache()
getCache in interface org.jgroups.blocks.NotificationBus.Consumerpublic void handleNotification(java.io.Serializable arg0)
handleNotification in interface org.jgroups.blocks.NotificationBus.Consumerpublic void memberJoined(org.jgroups.Address arg0)
memberJoined in interface org.jgroups.blocks.NotificationBus.Consumerpublic void memberLeft(org.jgroups.Address arg0)
memberLeft in interface org.jgroups.blocks.NotificationBus.Consumer
public java.util.List getElements(java.util.List keys)
throws java.rmi.RemoteException
getElements in interface CachePeerkeys - a list of serializable values which represent keys
java.rmi.RemoteException
public java.lang.String getGuid()
throws java.rmi.RemoteException
Cache instance.
getGuid in interface CachePeerjava.rmi.RemoteException
public java.util.List getKeys()
throws java.rmi.RemoteException
getKeys in interface CachePeerObject keys
java.rmi.RemoteException
public java.lang.String getName()
throws java.rmi.RemoteException
getName in interface CachePeerjava.rmi.RemoteException
public Element getQuiet(java.io.Serializable key)
throws java.rmi.RemoteException
getQuiet in interface CachePeerkey - a serializable value
java.rmi.RemoteException
public java.lang.String getUrl()
throws java.rmi.RemoteException
getUrl in interface CachePeerjava.rmi.RemoteException
public java.lang.String getUrlBase()
throws java.rmi.RemoteException
getUrlBase in interface CachePeerjava.rmi.RemoteException
public void put(Element element)
throws java.lang.IllegalArgumentException,
java.lang.IllegalStateException,
java.rmi.RemoteException
put in interface CachePeerjava.lang.IllegalArgumentException - if the element is null
java.lang.IllegalStateException - if the cache is not Status.STATUS_ALIVE
java.rmi.RemoteException
public boolean remove(java.io.Serializable key)
throws java.lang.IllegalStateException,
java.rmi.RemoteException
Element from the Cache. This also removes it from any
stores it may be in.
remove in interface CachePeerjava.lang.IllegalStateException - if the cache is not Status.STATUS_ALIVE
java.rmi.RemoteException
public void removeAll()
throws java.rmi.RemoteException,
java.lang.IllegalStateException
removeAll in interface CachePeerjava.lang.IllegalStateException - if the cache is not Status.STATUS_ALIVE
java.rmi.RemoteException
public void send(java.util.List eventMessages)
throws java.rmi.RemoteException
EventMessages.
This enables multiple messages to be delivered in one network invocation.
send in interface CachePeereventMessages - a list of type EventMessage
java.rmi.RemoteExceptionpublic Status getStatus()
Status of the manager
public void dispose()
throws CacheException
dispose in interface CacheManagerPeerProviderCacheExceptionpublic long getTimeForClusterToForm()
getTimeForClusterToForm in interface CacheManagerPeerProviderpublic void init()
init in interface CacheManagerPeerProvider
public java.util.List listRemoteCachePeers(Ehcache cache)
throws CacheException
listRemoteCachePeers in interface CacheManagerPeerProviderCachePeer peers for the given cache, excluding the local peer.
CacheExceptionpublic void registerPeer(java.lang.String rmiUrl)
registerPeer in interface CacheManagerPeerProviderpublic void unregisterPeer(java.lang.String rmiUrl)
unregisterPeer in interface CacheManagerPeerProvider
|
ehcache | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||