org.jboss.cache.statetransfer
Class DefaultStateTransferGenerator

java.lang.Object
  extended by org.jboss.cache.statetransfer.DefaultStateTransferGenerator
All Implemented Interfaces:
StateTransferGenerator

public class DefaultStateTransferGenerator
extends java.lang.Object
implements StateTransferGenerator


Field Summary
static short STATE_TRANSFER_VERSION
           
 
Constructor Summary
protected DefaultStateTransferGenerator(CacheImpl cache)
           
 
Method Summary
protected  void delimitStream(java.io.ObjectOutputStream out)
          Places a delimiter marker on the stream
protected  void generateNodeDataList(NodeSPI<?,?> node, java.util.List<NodeData> list)
           
 void generateState(java.io.ObjectOutputStream out, Node rootNode, boolean generateTransient, boolean generatePersistent, boolean suppressErrors)
           
protected  CacheImpl getTreeCache()
           
protected  void marshallAssociatedState(Fqn fqn, java.io.ObjectOutputStream baos)
          Does nothing in this base class; can be overridden in a subclass.
protected  void marshallTransientState(NodeSPI node, java.io.ObjectOutputStream out)
          Do a preorder traversal: visit the node first, then the node's children
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STATE_TRANSFER_VERSION

public static final short STATE_TRANSFER_VERSION
Constructor Detail

DefaultStateTransferGenerator

protected DefaultStateTransferGenerator(CacheImpl cache)
Method Detail

generateState

public void generateState(java.io.ObjectOutputStream out,
                          Node rootNode,
                          boolean generateTransient,
                          boolean generatePersistent,
                          boolean suppressErrors)
                   throws java.lang.Throwable
Specified by:
generateState in interface StateTransferGenerator
Throws:
java.lang.Throwable

delimitStream

protected void delimitStream(java.io.ObjectOutputStream out)
                      throws java.lang.Exception
Places a delimiter marker on the stream

Parameters:
out - stream
Throws:
java.io.IOException - if there are errs
java.lang.Exception

marshallTransientState

protected void marshallTransientState(NodeSPI node,
                                      java.io.ObjectOutputStream out)
                               throws java.lang.Exception
Do a preorder traversal: visit the node first, then the node's children

Parameters:
out -
Throws:
java.lang.Exception

generateNodeDataList

protected void generateNodeDataList(NodeSPI<?,?> node,
                                    java.util.List<NodeData> list)
                             throws java.lang.Exception
Throws:
java.lang.Exception

marshallAssociatedState

protected void marshallAssociatedState(Fqn fqn,
                                       java.io.ObjectOutputStream baos)
                                throws java.lang.Exception
Does nothing in this base class; can be overridden in a subclass.

Throws:
java.lang.Exception

getTreeCache

protected CacheImpl getTreeCache()