org.neo4j.kernel.impl.transaction.xaframework
Class XaCommandFactory

java.lang.Object
  extended by org.neo4j.kernel.impl.transaction.xaframework.XaCommandFactory

public abstract class XaCommandFactory
extends Object

During recovery (after system crash) the XaLogicalLog will examine the the logical log and re-create any transaction that didn't complete. XaCommandFactory job is to read in commands from the logical log and re-create them.


Constructor Summary
XaCommandFactory()
           
 
Method Summary
abstract  XaCommand readCommand(ReadableByteChannel byteChannel, ByteBuffer buffer)
          Reads the data from a commad previosly written to the logical log and creates the command again.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XaCommandFactory

public XaCommandFactory()
Method Detail

readCommand

public abstract XaCommand readCommand(ReadableByteChannel byteChannel,
                                      ByteBuffer buffer)
                               throws IOException
Reads the data from a commad previosly written to the logical log and creates the command again.

The implementation has to guard against the command beeing corrupt and not completly written to the logical log. When unable to read the command null should be returned. IOException should only be thrown in case of real IO failure. The null return is a signal to the recovery mechanism to stop scaning for more entries.

Parameters:
fileChannel - The channel to read the command data from
buffer - A small buffer that can be used to read data into
Returns:
The command or null if unable to read command
Throws:
IOException - In case of real IO failure


Copyright © 2002-2012 The Neo4j Graph Database Project. All Rights Reserved.