WrappedTransaction
, AutoCloseable
AbstractTx
public class DelegatingTransaction extends Object implements WrappedTransaction
Constructor | Description |
---|---|
DelegatingTransaction(org.apache.tinkerpop.gremlin.structure.Transaction delegate,
WrappedFramedGraph<? extends org.apache.tinkerpop.gremlin.structure.Graph> parentGraph) |
Modifier and Type | Method | Description |
---|---|---|
void |
addTransactionListener(Consumer<org.apache.tinkerpop.gremlin.structure.Transaction.Status> listener) |
Adds a listener that is called back with a status when a commit or rollback is successful.
|
void |
clearTransactionListeners() |
Removes all transaction listeners.
|
void |
close() |
|
void |
commit() |
Commits a transaction.
|
WrappedFramedGraph<? extends org.apache.tinkerpop.gremlin.structure.Graph> |
createThreadedTx() |
Creates a transaction that can be executed across multiple threads.
|
org.apache.tinkerpop.gremlin.structure.Transaction |
getDelegate() |
Returns the raw wrapped tinkerpop transaction.
|
WrappedFramedGraph<? extends org.apache.tinkerpop.gremlin.structure.Graph> |
getGraph() |
Returns the parent graph for the transaction.
|
boolean |
isOpen() |
Determines if a transaction is currently open.
|
void |
open() |
Opens a transaction.
|
void |
readWrite() |
An internal function that signals a read or a write has occurred - not meant to be called directly by end users.
|
void |
removeTransactionListener(Consumer<org.apache.tinkerpop.gremlin.structure.Transaction.Status> listener) |
Removes a transaction listener.
|
void |
rollback() |
Rolls back a transaction.
|
public DelegatingTransaction(org.apache.tinkerpop.gremlin.structure.Transaction delegate, WrappedFramedGraph<? extends org.apache.tinkerpop.gremlin.structure.Graph> parentGraph)
public void open()
WrappedTransaction
open
in interface WrappedTransaction
public void commit()
WrappedTransaction
commit
in interface WrappedTransaction
public void rollback()
WrappedTransaction
rollback
in interface WrappedTransaction
public WrappedFramedGraph<? extends org.apache.tinkerpop.gremlin.structure.Graph> createThreadedTx()
WrappedTransaction
WrappedFramedGraph
returned from this
method is not meant to represent some form of child transaction that can be committed from this object.
A threaded transaction is a Graph
instance that has a transaction context that enables multiple
threads to collaborate on the same transaction. A standard transactional context tied to a WrappedFramedGraph
that supports transactions will typically bind a transaction to a single thread via ThreadLocal
.createThreadedTx
in interface WrappedTransaction
public boolean isOpen()
WrappedTransaction
isOpen
in interface WrappedTransaction
public void readWrite()
WrappedTransaction
readWrite
in interface WrappedTransaction
public void close()
close
in interface AutoCloseable
close
in interface WrappedTransaction
public void addTransactionListener(Consumer<org.apache.tinkerpop.gremlin.structure.Transaction.Status> listener)
WrappedTransaction
addTransactionListener
in interface WrappedTransaction
listener
- the transaction listener to be addedpublic void removeTransactionListener(Consumer<org.apache.tinkerpop.gremlin.structure.Transaction.Status> listener)
WrappedTransaction
removeTransactionListener
in interface WrappedTransaction
listener
- The listener to be removed.public void clearTransactionListeners()
WrappedTransaction
clearTransactionListeners
in interface WrappedTransaction
public org.apache.tinkerpop.gremlin.structure.Transaction getDelegate()
WrappedTransaction
getDelegate
in interface WrappedTransaction
public WrappedFramedGraph<? extends org.apache.tinkerpop.gremlin.structure.Graph> getGraph()
WrappedTransaction
getGraph
in interface WrappedTransaction
Copyright © 2018 Syncleus. All rights reserved.