org.neo4j.kernel.impl.transaction.xaframework
Interface TransactionInterceptor

All Superinterfaces:
CommandRecordVisitor

public interface TransactionInterceptor
extends CommandRecordVisitor

A TransactionInterceptor has the opportunity to perform a check on a transaction before it touches the store and logical log, potentially interrupting the process by throwing an exception. The initial idea around this functionality was a consistency checking implementation but any sort of run over the commands that comprise the transaction can be done. Extending CommandRecordVisitor enables for visiting all the records in the transaction and perform whatever work is necessary. TransactionInterceptors are instantiated by TransactionInterceptorProviders and are possible to form a chain of responsibility.


Method Summary
 void complete()
          The main work method, supposed to be called by users when the whole required set of Commands has been met.
 void setCommitEntry(LogEntry.Commit entry)
          Set, if available, the log commit entry for this transaction.
 void setStartEntry(LogEntry.Start entry)
          Set, if available, the log start entry for this transaction.
 
Methods inherited from interface org.neo4j.kernel.impl.nioneo.xa.CommandRecordVisitor
visitNode, visitProperty, visitPropertyIndex, visitRelationship, visitRelationshipType
 

Method Detail

complete

void complete()
The main work method, supposed to be called by users when the whole required set of Commands has been met. The last operation in a normal completion scenario for this method must be calling complete() on the following member of the chain, if present.


setStartEntry

void setStartEntry(LogEntry.Start entry)
Set, if available, the log start entry for this transaction. The implementation is not expected to act on it in any meaningful way but it is required to pass it on in the chain before throwing it out. Also, the implementation should not count on it being set during its lifetime - it is possible that it is not available.

Parameters:
entry - The start log entry for this transaction

setCommitEntry

void setCommitEntry(LogEntry.Commit entry)
Set, if available, the log commit entry for this transaction. The implementation is not expected to act on it in any meaningful way but it is required to pass it on in the chain before throwing it out. Also, the implementation should not count on it being set during its lifetime - it is possible that it is not available.

Parameters:
entry - The commit log entry for this transaction


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