net.sf.ehcache.distribution.jgroups
Class JGroupsBootstrapCacheLoader

java.lang.Object
  extended by net.sf.ehcache.distribution.jgroups.JGroupsBootstrapCacheLoader
All Implemented Interfaces:
net.sf.ehcache.bootstrap.BootstrapCacheLoader

public class JGroupsBootstrapCacheLoader
extends Object
implements net.sf.ehcache.bootstrap.BootstrapCacheLoader

Loads Elements from a random Cache Peer

Version:
$Id$
Author:
Greg Luck

Field Summary
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 Summary
JGroupsBootstrapCacheLoader(boolean asynchronous, int maximumChunkSize)
          Creates a bootstrap cache loader that will work with RMI based distribution
 
Method Summary
 Object clone()
          Clones this loader
 int getMaximumChunkSizeBytes()
          Gets the maximum chunk size
 boolean isAsynchronous()
           
 void load(net.sf.ehcache.Ehcache cache)
          Bootstraps the cache from a random CachePeer.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

asynchronous

protected boolean asynchronous
Whether to load asynchronously


maximumChunkSizeBytes

protected int maximumChunkSizeBytes
The maximum serialized size of the elements to request from a remote cache peer during bootstrap.

Constructor Detail

JGroupsBootstrapCacheLoader

public JGroupsBootstrapCacheLoader(boolean asynchronous,
                                   int maximumChunkSize)
Creates a bootstrap cache loader that will work with RMI based distribution

Parameters:
asynchronous - Whether to load asynchronously
Method Detail

load

public void load(net.sf.ehcache.Ehcache cache)
          throws net.sf.ehcache.distribution.RemoteCacheException
Bootstraps the cache from a random CachePeer. Requests are done in chunks estimated at 5MB Serializable size. This balances memory use on each end and network performance.

Specified by:
load in interface net.sf.ehcache.bootstrap.BootstrapCacheLoader
Throws:
net.sf.ehcache.distribution.RemoteCacheException - if anything goes wrong with the remote call

isAsynchronous

public boolean isAsynchronous()
Specified by:
isAsynchronous in interface net.sf.ehcache.bootstrap.BootstrapCacheLoader
Returns:
true if this bootstrap loader is asynchronous

getMaximumChunkSizeBytes

public int getMaximumChunkSizeBytes()
Gets the maximum chunk size


clone

public Object clone()
             throws CloneNotSupportedException
Clones this loader

Specified by:
clone in interface net.sf.ehcache.bootstrap.BootstrapCacheLoader
Overrides:
clone in class Object
Throws:
CloneNotSupportedException


Copyright © 2003-2012 Terracotta, Inc.. All Rights Reserved.