T - The type of a state object that the module can use to
pass information from the TxDrivenModule.beforeCommit(com.graphaware.tx.event.improved.api.ImprovedTransactionData)
method to the afterCommit(Object) method.public abstract class BaseTxDrivenModule<T> extends BaseRuntimeModule implements TxDrivenModule<T>
TxDrivenModule implementations.| Modifier | Constructor and Description |
|---|---|
protected |
BaseTxDrivenModule(String moduleId)
Construct a new module.
|
| Modifier and Type | Method and Description |
|---|---|
void |
afterCommit(T state)
Perform the core business logic of this module after a transaction commits.
|
void |
afterRollback(T state)
Cleanup if needed after a transaction rolled back.
|
TxDrivenModuleConfiguration |
getConfiguration()
Return the configuration of this module.
|
void |
initialize(org.neo4j.graphdb.GraphDatabaseService database)
Initialize this module.
|
void |
reinitialize(org.neo4j.graphdb.GraphDatabaseService database,
TxDrivenModuleMetadata oldMetadata)
Re-initialize this module.
|
void |
shutdown() |
void |
start(org.neo4j.graphdb.GraphDatabaseService database)
Start the module.
|
getIdclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitbeforeCommitgetIdprotected BaseTxDrivenModule(String moduleId)
moduleId - ID of this module. Must not be null.public TxDrivenModuleConfiguration getConfiguration()
TxDrivenModuleConfiguration implementation. Use NullTxDrivenModuleConfiguration
if this module needs no configuration.getConfiguration in interface TxDrivenModule<T>public void start(org.neo4j.graphdb.GraphDatabaseService database)
start in interface TxDrivenModule<T>database - to start this module against.public void initialize(org.neo4j.graphdb.GraphDatabaseService database)
Note that the implementation in this base class doesn't do anything and can be safely overridden without calling super.
initialize in interface TxDrivenModule<T>database - to initialize this module for.public void reinitialize(org.neo4j.graphdb.GraphDatabaseService database,
TxDrivenModuleMetadata oldMetadata)
reinitialize in interface TxDrivenModule<T>database - to re-initialize this module for.oldMetadata - metadata stored for this module from its previous run. Can be null in case metadata
was corrupt or there was no metadata.public void shutdown()
Note that the implementation in this base class doesn't do anything and can be safely overridden without calling super.
shutdown in interface RuntimeModulepublic void afterCommit(T state)
afterCommit in interface TxDrivenModule<T>state - returned by TxDrivenModule.beforeCommit(com.graphaware.tx.event.improved.api.ImprovedTransactionData). Will
be null if TxDrivenModule.beforeCommit(com.graphaware.tx.event.improved.api.ImprovedTransactionData)
threw an exception but the transaction still committed. This is the case for all exceptions except DeliberateTransactionRollbackException.public void afterRollback(T state)
TxDrivenModule.beforeCommit(com.graphaware.tx.event.improved.api.ImprovedTransactionData)
method was called.afterRollback in interface TxDrivenModule<T>state - returned by TxDrivenModule.beforeCommit(com.graphaware.tx.event.improved.api.ImprovedTransactionData). Will
be null if it is this module that caused the rollback by throwing DeliberateTransactionRollbackException.
Will also be null if TxDrivenModule.beforeCommit(com.graphaware.tx.event.improved.api.ImprovedTransactionData) threw
a non-rollback-causing exception, but some other module caused rollback after that.Copyright © 2013-2016–2018 Graph Aware Limited. All rights reserved.