org.jboss.cache.statetransfer
Interface StateTransferManager

All Known Implementing Classes:
DefaultStateTransferManager, LegacyStateTransferManager

public interface StateTransferManager

This interface handles requests to generate or integrate state from neighbouring caches in a cluster.

This has existed prior to 3.0.0 as a concrete class. An interface was introduced in 3.0.0 to provide more flexibility in state transfer implementations.

Since:
3.0
Author:
Manik Surtani (manik AT jboss DOT org)

Method Summary
 void getState(ObjectOutputStream out, Fqn fqn, long timeout, boolean force, boolean suppressErrors)
          Writes the state for the portion of the tree named by fqn to the provided OutputStream.
 void setState(ObjectInputStream in, Fqn targetRoot)
          Set the portion of the cache rooted in targetRoot to match the given state.
 

Method Detail

getState

void getState(ObjectOutputStream out,
              Fqn fqn,
              long timeout,
              boolean force,
              boolean suppressErrors)
              throws Exception
Writes the state for the portion of the tree named by fqn to the provided OutputStream.

Parameters:
out - stream to write state to
fqn - Fqn indicating the uppermost node in the portion of the tree whose state should be returned.
timeout - max number of millis this method should wait to acquire any locks, if necessary, on the nodes being transferred
force - if locks are needed and cannot be acquired after timeout millis, should the lock acquisition be forced, and any existing transactions holding locks on the nodes be rolled back?
suppressErrors - if true, all exceptions are logged but not propagated.
Throws:
Exception - in event of error

setState

void setState(ObjectInputStream in,
              Fqn targetRoot)
              throws Exception
Set the portion of the cache rooted in targetRoot to match the given state. Updates the contents of targetRoot to reflect those in new_state.

NOTE: This method performs no locking of nodes; it is up to the caller to lock targetRoot before calling this method.

This method will use any ClassLoader needed as defined by the active Region in the RegionManager, pertaining to the targetRoot passed in.

Parameters:
in - an input stream containing the state
targetRoot - fqn of the node into which the state should be integrated
Throws:
Exception - In event of error


Copyright © 2009 JBoss, a division of Red Hat. All Rights Reserved.