net.sf.ehcache.distribution
public class RMICachePeer extends UnicastRemoteObject implements CachePeer, Remote
CachePeer
.
This class features a customised RMIClientSocketFactory which enables socket timeouts to be configured.
Version: $Id: RMICachePeer.java 191 2006-09-03 22:41:48Z gregluck $
UNKNOWN: FieldCanBeLocal
Constructor Summary | |
---|---|
RMICachePeer(Ehcache cache, String hostName, Integer port, Integer socketTimeoutMillis)
Construct a new remote peer.
|
Method Summary | |
---|---|
Ehcache | getBoundCacheInstance()
Gets the cache instance that this listener is bound to |
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 |
Element | getQuiet(Serializable key)
Gets an element from the cache, without updating Element statistics. |
String | getUrl()
{@inheritDoc }
This implementation gives an URL which has meaning to the RMI remoting system.
|
String | getUrlBase()
{@inheritDoc }
This implementation gives an URL which has meaning to the RMI remoting system.
|
void | put(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. |
Parameters: cache hostName port socketTimeoutMillis
Throws: RemoteException
Parameters: keys a list of serializable values which represent keys
Returns: a list of Elements. If an element was not found or null, it will not be in the list.
Returns: a list of Object keys
Parameters: key a serializable value
Returns: the element, or null, if it does not exist.
Returns: the URL, without the scheme, as a string e.g. //hostname:port/cacheName
Returns: the URL, without the scheme, as a string e.g. //hostname:port
Parameters: element
Throws: java.rmi.RemoteException IllegalArgumentException IllegalStateException
Parameters: key
Returns: true if the element was removed, false if it was not found in the cache
Throws: RemoteException IllegalStateException
Throws: IllegalStateException if the cache is not STATUS_ALIVE