org.jboss.cache.statetransfer
Class DefaultStateTransferManager
java.lang.Object
org.jboss.cache.statetransfer.DefaultStateTransferManager
- All Implemented Interfaces:
- StateTransferManager
- Direct Known Subclasses:
- LegacyStateTransferManager
public class DefaultStateTransferManager
- extends Object
- implements StateTransferManager
The default state transfer manager to be used when using MVCC locking.
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 |
injectDependencies(CacheSPI cache,
Marshaller marshaller,
RegionManager regionManager,
Configuration configuration,
CacheLoaderManager cacheLoaderManager,
StateTransferIntegrator integrator,
StateTransferGenerator generator)
|
void |
setState(ObjectInputStream in,
Fqn targetRoot)
Set the portion of the cache rooted in targetRoot
to match the given state. |
protected void |
setState(ObjectInputStream state,
NodeSPI targetRoot)
Set the portion of the cache rooted in targetRoot
to match the given state. |
void |
start()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
log
protected static final org.apache.commons.logging.Log log
trace
protected static final boolean trace
STREAMING_DELIMITER_NODE
public static final NodeData STREAMING_DELIMITER_NODE
PARTIAL_STATE_DELIMITER
public static final String PARTIAL_STATE_DELIMITER
- See Also:
- Constant Field Values
cache
protected CacheSPI cache
marshaller
protected Marshaller marshaller
regionManager
protected RegionManager regionManager
configuration
protected Configuration configuration
stateRetrievalTimeout
protected long stateRetrievalTimeout
integrator
protected StateTransferIntegrator integrator
generator
protected StateTransferGenerator generator
DefaultStateTransferManager
public DefaultStateTransferManager()
injectDependencies
public void injectDependencies(CacheSPI cache,
Marshaller marshaller,
RegionManager regionManager,
Configuration configuration,
CacheLoaderManager cacheLoaderManager,
StateTransferIntegrator integrator,
StateTransferGenerator generator)
start
public void start()
getState
public void getState(ObjectOutputStream out,
Fqn fqn,
long timeout,
boolean force,
boolean suppressErrors)
throws Exception
- Description copied from interface:
StateTransferManager
- Writes the state for the portion of the tree named by
fqn
to
the provided OutputStream.
- Specified by:
getState
in interface StateTransferManager
- Parameters:
out
- stream to write state tofqn
- 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 transferredforce
- 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
public void setState(ObjectInputStream in,
Fqn targetRoot)
throws Exception
- Description copied from interface:
StateTransferManager
- 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.
- Specified by:
setState
in interface StateTransferManager
- Parameters:
in
- an input stream containing the statetargetRoot
- fqn of the node into which the state should be integrated
- Throws:
Exception
- In event of error
setState
protected void setState(ObjectInputStream state,
NodeSPI 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.
- Parameters:
state
- a serialized byte[][] array where element 0 is the
transient state (or null) , and element 1 is the
persistent state (or null)targetRoot
- node into which the state should be integrated
- Throws:
Exception
Copyright © 2009 JBoss, a division of Red Hat. All Rights Reserved.