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

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

public class XaContainer
extends Object

This is a wrapper class containing the logical log, command factory, transaction factory and resource manager. Using the static create method, a XaResourceManager will be created and the XaLogicalLog will be instantiated (not opened).

The purpose of this class is to make it easier to setup all that is needed when using the xaframework. Classes needs to be instantiated in a certain order and references passed between the. XaContainer will do that work so you only have to supply the logical log file, your XaCommandFactory and XaTransactionFactory implementations.


Method Summary
 void close()
          Closes the logical log and nulls out all instances.
static XaContainer create(XaDataSource dataSource, String logicalLog, XaCommandFactory cf, XaTransactionFactory tf, List<Pair<TransactionInterceptorProvider,Object>> providers, Map<Object,Object> config)
          Creates a XaContainer.
 XaCommandFactory getCommandFactory()
           
 XaLogicalLog getLogicalLog()
           
 XaResourceManager getResourceManager()
           
 XaTransactionFactory getTransactionFactory()
           
 void openLogicalLog()
          Opens the logical log.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

create

public static XaContainer create(XaDataSource dataSource,
                                 String logicalLog,
                                 XaCommandFactory cf,
                                 XaTransactionFactory tf,
                                 List<Pair<TransactionInterceptorProvider,Object>> providers,
                                 Map<Object,Object> config)
Creates a XaContainer.

Parameters:
logicalLog - The logical log file name
cf - The command factory implementation
tf - The transaction factory implementation
config - Configuration map or null if no config needed

openLogicalLog

public void openLogicalLog()
                    throws IOException
Opens the logical log. If the log doesn't exist a new log will be created. If the log exists it will be scaned and non completed transactions will be recovered.

This method is only valid to invoke once after the container has been created. Invoking this method again could cause the logical log to be corrupted.

Throws:
IOException

close

public void close()
Closes the logical log and nulls out all instances.


getCommandFactory

public XaCommandFactory getCommandFactory()

getLogicalLog

public XaLogicalLog getLogicalLog()

getResourceManager

public XaResourceManager getResourceManager()

getTransactionFactory

public XaTransactionFactory getTransactionFactory()


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