T - implementation of TxDrivenModule that this runtime supports.public abstract class TxDrivenRuntime<T extends TxDrivenModule> extends BaseGraphAwareRuntime implements org.neo4j.graphdb.event.TransactionEventHandler<Map<String,Object>>
BaseGraphAwareRuntime that registers itself as a Neo4j TransactionEventHandler,
translates TransactionData into ImprovedTransactionData
and lets registered TxDrivenModules deal with the data before each transaction
commits, in the order the modules were registered.| Modifier | Constructor and Description |
|---|---|
protected |
TxDrivenRuntime(RuntimeConfiguration configuration)
Create a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
afterCommit(org.neo4j.graphdb.event.TransactionData data,
Map<String,Object> states) |
void |
afterRollback(org.neo4j.graphdb.event.TransactionData data,
Map<String,Object> states) |
Map<String,Object> |
beforeCommit(org.neo4j.graphdb.event.TransactionData data) |
protected void |
checkNotAlreadyRegistered(RuntimeModule module)
Check that the given module isn't already registered with the runtime.
|
protected void |
cleanupMetadata(Set<String> usedModules)
Perform cleanup of metadata potentially written to the graph by modules that aren't used any more.
|
<M extends RuntimeModule> |
getModule(Class<M> clazz) |
<M extends RuntimeModule> |
getModule(String moduleId,
Class<M> clazz) |
protected abstract TxDrivenModuleManager<T> |
getTxDrivenModuleManager()
Get the manager for
TxDrivenModules. |
protected Set<String> |
loadMetadata()
Load module metadata.
|
protected void |
shutdownModules()
Shutdown all modules.
|
protected void |
startModules()
Perform the actual start of the runtime, being certain that it is the right time to do so.
|
afterShutdown, beforeShutdown, doRegisterModule, getConfiguration, getResource, isStarted, kernelPanic, orderComparedTo, registerModule, start, waitUntilStartedclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetDatabaseWriterprotected TxDrivenRuntime(RuntimeConfiguration configuration)
configuration - config.protected abstract TxDrivenModuleManager<T> getTxDrivenModuleManager()
TxDrivenModules.protected void checkNotAlreadyRegistered(RuntimeModule module)
checkNotAlreadyRegistered in class BaseGraphAwareRuntimemodule - to check.public Map<String,Object> beforeCommit(org.neo4j.graphdb.event.TransactionData data) throws Exception
public final void afterCommit(org.neo4j.graphdb.event.TransactionData data,
Map<String,Object> states)
public final void afterRollback(org.neo4j.graphdb.event.TransactionData data,
Map<String,Object> states)
public <M extends RuntimeModule> M getModule(String moduleId, Class<M> clazz) throws org.neo4j.graphdb.NotFoundException
getModule in interface GraphAwareRuntimeorg.neo4j.graphdb.NotFoundExceptionpublic <M extends RuntimeModule> M getModule(Class<M> clazz) throws org.neo4j.graphdb.NotFoundException
getModule in interface GraphAwareRuntimeorg.neo4j.graphdb.NotFoundExceptionprotected Set<String> loadMetadata()
loadMetadata in class BaseGraphAwareRuntimeprotected void cleanupMetadata(Set<String> usedModules)
cleanupMetadata in class BaseGraphAwareRuntimeusedModules - IDs of all the used modules (should be the same as returned by BaseGraphAwareRuntime.loadMetadata().protected void startModules()
startModules in class BaseGraphAwareRuntimeprotected void shutdownModules()
shutdownModules in class BaseGraphAwareRuntimeCopyright © 2013-2016–2018 Graph Aware Limited. All rights reserved.