net.sf.ehcache.distribution.jgroups
Class BootstrapRequest

java.lang.Object
  extended by net.sf.ehcache.distribution.jgroups.BootstrapRequest

public class BootstrapRequest
extends Object

Tracks the status of a bootstrap request

Version:
$Revision$
Author:
Eric Dalquist

Nested Class Summary
static class BootstrapRequest.BootstrapStatus
          Possible states of a BootstrapRequest
 
Constructor Summary
BootstrapRequest(net.sf.ehcache.Ehcache cache, boolean asynchronous, int chunkSize)
          Create a new bootstrap request for the specified cache
 
Method Summary
 void boostrapComplete(BootstrapRequest.BootstrapStatus status)
          Signal that bootstrapping is complete
 void countReplication()
          Count a received bootstrap replication
 BootstrapRequest.BootstrapStatus getBootstrapStatus()
           
 net.sf.ehcache.Ehcache getCache()
           
 int getChunkSize()
           
 long getReplicationCount()
           
 boolean isAsynchronous()
           
 void reset()
          Reset the replicationCount and waitForBootstrap latch to their initial states
 void setBootstrapStatus(BootstrapRequest.BootstrapStatus bootstrapStatus)
           
 String toString()
          
 boolean waitForBoostrap(long timeout, TimeUnit unit)
          Waits for the receiver to signal that the current bootstrap request is complete
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BootstrapRequest

public BootstrapRequest(net.sf.ehcache.Ehcache cache,
                        boolean asynchronous,
                        int chunkSize)
Create a new bootstrap request for the specified cache

Method Detail

getBootstrapStatus

public BootstrapRequest.BootstrapStatus getBootstrapStatus()
Returns:
The current status of the bootstrap request

setBootstrapStatus

public void setBootstrapStatus(BootstrapRequest.BootstrapStatus bootstrapStatus)
Parameters:
bootstrapStatus - The current status of the bootstrap request

isAsynchronous

public boolean isAsynchronous()
Returns:
If the bootstrap request should be handled asynchronously

getChunkSize

public int getChunkSize()
Returns:
The maximum serialized size of the elements to request from a remote cache peer during bootstrap.

reset

public void reset()
Reset the replicationCount and waitForBootstrap latch to their initial states


boostrapComplete

public void boostrapComplete(BootstrapRequest.BootstrapStatus status)
Signal that bootstrapping is complete


waitForBoostrap

public boolean waitForBoostrap(long timeout,
                               TimeUnit unit)
                        throws InterruptedException
Waits for the receiver to signal that the current bootstrap request is complete

Throws:
InterruptedException

countReplication

public void countReplication()
Count a received bootstrap replication


getReplicationCount

public long getReplicationCount()
Returns:
The number of bootstrap replication responses received

getCache

public net.sf.ehcache.Ehcache getCache()
Returns:
The cache that is being bootstrapped

toString

public String toString()

Overrides:
toString in class Object


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