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

java.lang.Object
  extended by org.neo4j.helpers.Service
      extended by org.neo4j.kernel.impl.transaction.xaframework.TransactionInterceptorProvider
Direct Known Subclasses:
InconsistencyLoggingTransactionInterceptorProvider, VerifyingTransactionInterceptorProvider

public abstract class TransactionInterceptorProvider
extends Service

The basic service implementation for TransactionInterceptorProviders. Offers two ways to instantiate a TransactionInterceptor - one is standalone, the other is with an existing one as the next in the chain of responsibility.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.neo4j.helpers.Service
Service.CaseInsensitiveService, Service.Implementation
 
Constructor Summary
TransactionInterceptorProvider(String name)
           
 
Method Summary
abstract  TransactionInterceptor create(TransactionInterceptor next, XaDataSource ds, Object options)
          Creates a TransactionInterceptor with the given datasource and options and the given TransactionInterceptor as the next in the chain.
abstract  TransactionInterceptor create(XaDataSource ds, Object options)
          Creates a TransactionInterceptor with the given datasource and options.
abstract  String name()
          Returns the name of this provider
static TransactionInterceptor resolveChain(List<Pair<TransactionInterceptorProvider,Object>> providers, XaDataSource ds)
          A utility method that given some TransactionInterceptorProviders and their configuration objects returns a fully resolved chain of TransactionInterceptors - the return object is the first interceptor in the chain.
 
Methods inherited from class org.neo4j.helpers.Service
load, load, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TransactionInterceptorProvider

public TransactionInterceptorProvider(String name)
Method Detail

name

public abstract String name()
Returns the name of this provider

Returns:
The name of this provider

create

public abstract TransactionInterceptor create(XaDataSource ds,
                                              Object options)
Creates a TransactionInterceptor with the given datasource and options. It is possible for this method to return null, signifying that the options passed did not allow for instantiation.

Parameters:
ds - The datasource the TransactionInterceptor will communicate with
options - An object that can be the options to instantiate the interceptor with - e.g "false" to prevent instantiation
Returns:
An implementation of TransactionInterceptor or null if the options say so.

create

public abstract TransactionInterceptor create(TransactionInterceptor next,
                                              XaDataSource ds,
                                              Object options)
Creates a TransactionInterceptor with the given datasource and options and the given TransactionInterceptor as the next in the chain. It is possible for this method to return null, signifying that the options passed did not allow for instantiation.

Parameters:
ds - The datasource the TransactionInterceptor will communicate with
options - An object that can be the options to instantiate the interceptor with - e.g "false" to prevent instantiation
next - The next interceptor in the chain - can be null
Returns:
An implementation of TransactionInterceptor or null if the options say so.

resolveChain

public static TransactionInterceptor resolveChain(List<Pair<TransactionInterceptorProvider,Object>> providers,
                                                  XaDataSource ds)
A utility method that given some TransactionInterceptorProviders and their configuration objects returns a fully resolved chain of TransactionInterceptors - the return object is the first interceptor in the chain.

Parameters:
providers - A list of Pair of TransactionInterceptorProviders with the detected config objects
ds - The datasource to instantiate the TransactionInterceptors with
Returns:
The fist interceptor in the chain, possibly null


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