public class TransactionalRMICachePeer extends RMICachePeer
CachePeer
supporting transactions.Constructor and Description |
---|
TransactionalRMICachePeer(Ehcache cache,
java.lang.String hostName,
java.lang.Integer rmiRegistryPort,
java.lang.Integer remoteObjectPort,
java.lang.Integer socketTimeoutMillis)
Construct a new remote peer supporting transactions
|
Modifier and Type | Method and Description |
---|---|
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.util.List |
getKeys()
Returns a list of all elements in the cache, whether or not they are expired.
|
Element |
getQuiet(java.io.Serializable key)
Gets an element from the cache, without updating Element statistics.
|
void |
put(Element element)
Puts an Element into the underlying cache without notifying listeners or updating statistics.
|
boolean |
remove(java.io.Serializable key)
Removes an Element from the underlying cache without notifying listeners or updating statistics.
|
void |
removeAll()
Removes all cached items.
|
void |
send(java.util.List eventMessages)
Send the cache peer with an ordered list of
EventMessage s
This enables multiple messages to be delivered in one network invocation. |
getBoundCacheInstance, getGuid, getName, getUrl, getUrlBase, toString
private final Ehcache cache
public TransactionalRMICachePeer(Ehcache cache, java.lang.String hostName, java.lang.Integer rmiRegistryPort, java.lang.Integer remoteObjectPort, java.lang.Integer socketTimeoutMillis) throws java.rmi.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
- java.rmi.RemoteException
public java.util.List getKeys() throws java.rmi.RemoteException
RMICachePeer
getKeys
in interface CachePeer
getKeys
in class RMICachePeer
Object
keysjava.rmi.RemoteException
public Element getQuiet(java.io.Serializable key) throws java.rmi.RemoteException
RMICachePeer
getQuiet
in interface CachePeer
getQuiet
in class RMICachePeer
key
- a serializable valuejava.rmi.RemoteException
public java.util.List getElements(java.util.List keys) throws java.rmi.RemoteException
RMICachePeer
getElements
in interface CachePeer
getElements
in class RMICachePeer
keys
- a list of serializable values which represent keysjava.rmi.RemoteException
public void put(Element element) throws java.rmi.RemoteException, java.lang.IllegalArgumentException, java.lang.IllegalStateException
RMICachePeer
put
in interface CachePeer
put
in class RMICachePeer
java.lang.IllegalArgumentException
- if the element is nulljava.lang.IllegalStateException
- if the cache is not Status.STATUS_ALIVE
java.rmi.RemoteException
public boolean remove(java.io.Serializable key) throws java.rmi.RemoteException, java.lang.IllegalStateException
RMICachePeer
remove
in interface CachePeer
remove
in class RMICachePeer
java.lang.IllegalStateException
- if the cache is not Status.STATUS_ALIVE
java.rmi.RemoteException
public void removeAll() throws java.rmi.RemoteException, java.lang.IllegalStateException
RMICachePeer
removeAll
in interface CachePeer
removeAll
in class RMICachePeer
java.lang.IllegalStateException
- if the cache is not Status.STATUS_ALIVE
java.rmi.RemoteException
public void send(java.util.List eventMessages) throws java.rmi.RemoteException
RMICachePeer
EventMessage
s
This enables multiple messages to be delivered in one network invocation.send
in interface CachePeer
send
in class RMICachePeer
eventMessages
- a list of type EventMessage
java.rmi.RemoteException