CachePeer.
This class features a customised RMIClientSocketFactory which enables socket timeouts to be configured.
| Modifier and Type | Field and Description |
|---|---|
| private final Ehcache | |
| private final String | |
| private static final Logger | |
| private Integer | |
| private final Integer |
| Access | Constructor and Description |
|---|---|
| public | RMICachePeer(Ehcache
The cache attached to the peer cache, String The host name the peer is running on. hostName, Integer The port number on which the RMI Registry listens. Should be an unused port in
the range 1025 - 65536 rmiRegistryPort, Integer 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 - 65536 remoteObjectPort, Integer socketTimeoutMillis)Construct a new remote peer. |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv final Ehcache | |
| public List | Returns: a list of Elements. If an element was not found or null, it will not be in the list.a list of serializable values which represent keys keys)Implements net. |
| public final String | getGuid()
Implements net. Cache instance.
|
| public List | Returns: a list ofObject keysImplements net. |
| public final String | |
| public Element | Returns: the element, or null, if it does not exist.a serializable value key)Implements net. |
| public final String | Returns: the URL, without the scheme, as a string e.g. //hostname:port/cacheNameImplements net. |
| public final String | Returns: the URL, without the scheme, as a string e.g. //hostname:portImplements net. |
| public void | put(Element element)
Implements net. |
| public boolean | Returns: true if the element was removed, false if it was not found in the cacheImplements net. |
| public void | |
| public void | send(List<E>
a list of type eventMessages)EventMessageImplements net. EventMessages
This enables multiple messages to be delivered in one network invocation. |
| public String | toString()
Overrides java. |
| cache | back to summary |
|---|---|
| private final Ehcache cache | |
| hostname | back to summary |
|---|---|
| private final String hostname | |
| LOG | back to summary |
|---|---|
| private static final Logger LOG | |
| remoteObjectPort | back to summary |
|---|---|
| private Integer remoteObjectPort | |
| rmiRegistryPort | back to summary |
|---|---|
| private final Integer rmiRegistryPort | |
| RMICachePeer | back to summary |
|---|---|
| public RMICachePeer(Ehcache cache, String hostName, Integer rmiRegistryPort, Integer remoteObjectPort, Integer socketTimeoutMillis) throws RemoteException Construct a new remote peer.
| |
| getBoundCacheInstance | back to summary |
|---|---|
| pack-priv final Ehcache getBoundCacheInstance() Gets the cache instance that this listener is bound to | |
| getElements | back to summary |
|---|---|
| public List Implements net. Gets a list of elements from the cache, for a list of keys, without updating Element statistics. Time to idle lifetimes are therefore not affected. Cache statistics are still updated. Callers should ideally first call this method with a small list of keys to gauge the size of a typical Element. Then a calculation can be made of the right number to request each time so as to optimise network performance and not cause an OutOfMemory error on this Cache. | |
| getGuid | back to summary |
|---|---|
| public final String getGuid() throws RemoteException Implements net. Doc from net. Gets the globally unique id for the underlying
| |
| getKeys | back to summary |
|---|---|
| public List Implements net. Returns a list of all elements in the cache, whether or not they are expired. The returned keys are unique and can be considered a set. The List returned is not live. It is a copy. The time taken is O(n). On a single cpu 1.8Ghz P4, approximately 8ms is required for each 1000 entries. | |
| getName | back to summary |
|---|---|
| public final String getName() throws RemoteException Implements net. Gets the cache name | |
| getQuiet | back to summary |
|---|---|
| public Element getQuiet(Serializable key) throws RemoteException Implements net. Gets an element from the cache, without updating Element statistics. Cache statistics are still updated.
| |
| getUrl | back to summary |
|---|---|
| public final String getUrl() Implements net. Doc from net. The URL for the remote replicator to connect. The value will only have meaning for a specific implementation of replicator and remote peer. This method is not meant to be used remotely. The replicator already needs to know this. It has to throw RemoteException to comply with RMI requirements This implementation gives an URL which has meaning to the RMI remoting system.
| |
| getUrlBase | back to summary |
|---|---|
| public final String getUrlBase() Implements net. Doc from net. The URL base for the remote replicator to connect. The value will have meaning only to a specific implementation of replicator and remote peer. This implementation gives an URL which has meaning to the RMI remoting system.
| |
| put | back to summary |
|---|---|
| public void put(Element element) throws RemoteException, IllegalArgumentException, IllegalStateException Implements net. Puts an Element into the underlying cache without notifying listeners or updating statistics.
| |
| remove | back to summary |
|---|---|
| public boolean remove(Serializable key) throws RemoteException, IllegalStateException Implements net. Removes an Element from the underlying cache without notifying listeners or updating statistics.
| |
| removeAll | back to summary |
|---|---|
| public void removeAll() throws RemoteException, IllegalStateException Implements net. Removes all cached items.
| |
| send | back to summary |
|---|---|
| public void send(List<E> eventMessages) throws RemoteException Implements net. Send the cache peer with an ordered list of This enables multiple messages to be delivered in one network invocation.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Returns a String that represents the value of this object.
| |