public class RMIBootstrapCacheLoader extends java.lang.Object implements BootstrapCacheLoader, java.lang.Cloneable
Modifier and Type | Class and Description |
---|---|
private class |
RMIBootstrapCacheLoader.BootstrapThread
A background daemon thread that asynchronously calls doLoad
|
Modifier and Type | Field and Description |
---|---|
protected boolean |
asynchronous
Whether to load asynchronously
|
private static org.slf4j.Logger |
LOG |
protected int |
maximumChunkSizeBytes
The maximum serialized size of the elements to request from a remote cache peer during bootstrap.
|
private static int |
ONE_SECOND |
Constructor and Description |
---|
RMIBootstrapCacheLoader(boolean asynchronous,
int maximumChunkSize)
Creates a boostrap cache loader that will work with RMI based distribution
|
Modifier and Type | Method and Description |
---|---|
protected java.util.List |
acquireCachePeers(Ehcache cache)
Acquires the cache peers for this cache.
|
java.lang.Object |
clone()
Clones this loader
|
void |
doLoad(Ehcache cache)
Bootstraps the cache from a random CachePeer.
|
protected void |
fetchAndPutElements(Ehcache cache,
java.util.List requestChunk,
CachePeer cachePeer)
Fetches a chunk of elements from a remote cache peer
|
int |
getMaximumChunkSizeBytes()
Gets the maximum chunk size
|
boolean |
isAsynchronous() |
protected java.util.List |
listRemoteCachePeers(Ehcache cache)
Package protected List of cache peers
|
void |
load(Ehcache cache)
Bootstraps the cache from a random CachePeer.
|
private static final int ONE_SECOND
private static final org.slf4j.Logger LOG
protected boolean asynchronous
protected int maximumChunkSizeBytes
public RMIBootstrapCacheLoader(boolean asynchronous, int maximumChunkSize)
asynchronous
- Whether to load asynchronouslypublic void load(Ehcache cache) throws RemoteCacheException
load
in interface BootstrapCacheLoader
RemoteCacheException
- if anything goes wrong with the remote callpublic boolean isAsynchronous()
isAsynchronous
in interface BootstrapCacheLoader
public void doLoad(Ehcache cache) throws RemoteCacheException
RemoteCacheException
- if anything goes wrong with the remote callprotected java.util.List acquireCachePeers(Ehcache cache)
cache
- protected void fetchAndPutElements(Ehcache cache, java.util.List requestChunk, CachePeer cachePeer) throws java.rmi.RemoteException
cache
- the cache to put elements inrequestChunk
- the chunk of keys to requestcachePeer
- the peer to fetch fromjava.rmi.RemoteException
protected java.util.List listRemoteCachePeers(Ehcache cache)
cache
- public int getMaximumChunkSizeBytes()
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in interface BootstrapCacheLoader
clone
in class java.lang.Object
java.lang.CloneNotSupportedException