public class RMIBootstrapCacheLoader extends Object implements BootstrapCacheLoader, Cloneable
Modifier and Type | Field and Description |
---|---|
protected boolean |
asynchronous
Whether to load asynchronously
|
protected int |
maximumChunkSizeBytes
The maximum serialized size of the elements to request from a remote cache peer during bootstrap.
|
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 List |
acquireCachePeers(Ehcache cache)
Acquires the cache peers for this cache.
|
Object |
clone()
Clones this loader
|
void |
doLoad(Ehcache cache)
Bootstraps the cache from a random CachePeer.
|
protected void |
fetchAndPutElements(Ehcache cache,
List requestChunk,
CachePeer cachePeer)
Fetches a chunk of elements from a remote cache peer
|
int |
getMaximumChunkSizeBytes()
Gets the maximum chunk size
|
boolean |
isAsynchronous() |
protected List |
listRemoteCachePeers(Ehcache cache)
Package protected List of cache peers
|
void |
load(Ehcache cache)
Bootstraps the cache from a random CachePeer.
|
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 List acquireCachePeers(Ehcache cache)
cache
- protected void fetchAndPutElements(Ehcache cache, List requestChunk, CachePeer cachePeer) throws RemoteException
cache
- the cache to put elements inrequestChunk
- the chunk of keys to requestcachePeer
- the peer to fetch fromRemoteException
protected List listRemoteCachePeers(Ehcache cache)
cache
- public int getMaximumChunkSizeBytes()
public Object clone() throws CloneNotSupportedException
clone
in interface BootstrapCacheLoader
clone
in class Object
CloneNotSupportedException
Copyright © 2003–2016 Terracotta, Inc.. All rights reserved.