public class RMICachePeer extends UnicastRemoteObject implements net.sf.ehcache.distribution.CachePeer, Remote
CachePeer.
This class features a customised RMIClientSocketFactory which enables socket timeouts to be configured.ref| Constructor and Description |
|---|
RMICachePeer(net.sf.ehcache.Ehcache cache,
String hostName,
Integer rmiRegistryPort,
Integer remoteObjectPort,
Integer socketTimeoutMillis)
Construct a new remote peer.
|
| Modifier and Type | Method and Description |
|---|---|
List |
getElements(List keys)
Gets a list of elements from the cache, for a list of keys, without updating Element statistics.
|
String |
getGuid() |
List |
getKeys()
Returns a list of all elements in the cache, whether or not they are expired.
|
String |
getName()
Gets the cache name
|
net.sf.ehcache.Element |
getQuiet(Serializable key)
Gets an element from the cache, without updating Element statistics.
|
String |
getUrl()
This implementation gives an URL which has meaning to the RMI remoting system.
|
String |
getUrlBase()
This implementation gives an URL which has meaning to the RMI remoting system.
|
void |
put(net.sf.ehcache.Element element)
Puts an Element into the underlying cache without notifying listeners or updating statistics.
|
boolean |
remove(Serializable key)
Removes an Element from the underlying cache without notifying listeners or updating statistics.
|
void |
removeAll()
Removes all cached items.
|
void |
send(List eventMessages)
Send the cache peer with an ordered list of
EventMessages
This enables multiple messages to be delivered in one network invocation. |
String |
toString()
Returns a String that represents the value of this object.
|
clone, exportObject, exportObject, exportObject, unexportObjectgetClientHost, getLog, setLogequals, getRef, hashCode, toStubpublic RMICachePeer(net.sf.ehcache.Ehcache cache,
String hostName,
Integer rmiRegistryPort,
Integer remoteObjectPort,
Integer socketTimeoutMillis)
throws RemoteException
cache - The cache attached to the peerhostName - The host name the peer is running on.rmiRegistryPort - The port number on which the RMI Registry listens. Should be an unused port in
the range 1025 - 65536remoteObjectPort - the port number on which the remote objects bound in the registry receive calls.
This defaults to a free port if not specified.
Should be an unused port in the range 1025 - 65536socketTimeoutMillis - RemoteExceptionpublic final String getUrl()
getUrl in interface net.sf.ehcache.distribution.CachePeerpublic final String getUrlBase()
getUrlBase in interface net.sf.ehcache.distribution.CachePeerpublic List getKeys() throws RemoteException
getKeys in interface net.sf.ehcache.distribution.CachePeerObject keysRemoteExceptionpublic net.sf.ehcache.Element getQuiet(Serializable key) throws RemoteException
getQuiet in interface net.sf.ehcache.distribution.CachePeerkey - a serializable valueRemoteExceptionpublic List getElements(List keys) throws RemoteException
getElements in interface net.sf.ehcache.distribution.CachePeerkeys - a list of serializable values which represent keysRemoteExceptionpublic void put(net.sf.ehcache.Element element)
throws RemoteException,
IllegalArgumentException,
IllegalStateException
put in interface net.sf.ehcache.distribution.CachePeerelement - RemoteExceptionIllegalArgumentExceptionIllegalStateExceptionpublic boolean remove(Serializable key) throws RemoteException, IllegalStateException
remove in interface net.sf.ehcache.distribution.CachePeerkey - RemoteExceptionIllegalStateExceptionpublic void removeAll()
throws RemoteException,
IllegalStateException
removeAll in interface net.sf.ehcache.distribution.CachePeerIllegalStateException - if the cache is not Status.STATUS_ALIVERemoteExceptionpublic void send(List eventMessages) throws RemoteException
EventMessages
This enables multiple messages to be delivered in one network invocation.send in interface net.sf.ehcache.distribution.CachePeerRemoteExceptionpublic final String getName() throws RemoteException
getName in interface net.sf.ehcache.distribution.CachePeerRemoteExceptionpublic final String getGuid() throws RemoteException
getGuid in interface net.sf.ehcache.distribution.CachePeerRemoteExceptionpublic String toString()
toString in class RemoteObjectCopyright © 2002-2021 Atlassian. All Rights Reserved.