public abstract class AbstractTransaction extends Object implements Transaction
Transaction that provides some common functionality and default behavior.
 While vendors can choose to use this class, it is generally better to extend from
 AbstractThreadedTransaction or AbstractThreadLocalTransaction which include default "listener"
 functionality.  Implementers should note that this class assumes that threaded transactions are not enabled
 and should explicitly override createThreadedTx() to implement that functionality if required.| Modifier and Type | Class and Description | 
|---|---|
| static class  | AbstractTransaction.TransactionExceptionAn "internal" exception thrown by vendors when calls to  doCommit()ordoRollback()fail. | 
Transaction.CLOSE_BEHAVIOR, Transaction.Exceptions, Transaction.READ_WRITE_BEHAVIOR, Transaction.Status, Transaction.Workload<R>| Constructor and Description | 
|---|
| AbstractTransaction(Graph g) | 
| Modifier and Type | Method and Description | 
|---|---|
| void | close()Closes the transaction where the default close behavior defined by { Transaction.onClose(Consumer)} will be
 executed. | 
| void | commit()Commits a transaction. | 
| <G extends Graph> | createThreadedTx()Creates a transaction that can be executed across multiple threads. | 
| protected abstract void | doClose()Called  close(). | 
| protected abstract void | doCommit()Called with  commit()after theTransaction.onReadWrite(Consumer)has been notified. | 
| protected abstract void | doOpen()Called within  open()if it is determined that the transaction is not yet open givenTransaction.isOpen(). | 
| protected abstract void | doReadWrite()Called  readWrite(). | 
| protected abstract void | doRollback()Called with  rollback()after theTransaction.onReadWrite(Consumer)has been notified. | 
| protected abstract void | fireOnCommit()Called within  commit()just after the internal call todoCommit(). | 
| protected abstract void | fireOnRollback()Called within  rollback()just after the internal call todoRollback()()}. | 
| 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 | rollback()Rolls back a transaction. | 
| <R> Transaction.Workload<R> | submit(Function<Graph,R> work)Submit a unit of work that represents a transaction returning a  Transaction.Workloadthat can be automatically
 retried in the event of failure. | 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddTransactionListener, clearTransactionListeners, isOpen, onClose, onReadWrite, removeTransactionListenerpublic AbstractTransaction(Graph g)
protected abstract void doOpen()
open() if it is determined that the transaction is not yet open given Transaction.isOpen().
 Implementers should assume the transaction is not yet started and should thus open one.protected abstract void doCommit()
                          throws AbstractTransaction.TransactionException
commit() after the Transaction.onReadWrite(Consumer) has been notified.  Implementers should
 include their commit logic here.protected abstract void doRollback()
                            throws AbstractTransaction.TransactionException
rollback() after the Transaction.onReadWrite(Consumer) has been notified.  Implementers should
 include their rollback logic here.protected abstract void fireOnCommit()
commit() just after the internal call to doCommit(). Implementations of this
 method should raise Status#COMMIT events to any listeners added via
 Transaction.addTransactionListener(Consumer).protected abstract void fireOnRollback()
rollback() just after the internal call to doRollback() ()}. Implementations
 of this method should raise Status#ROLLBACK events to any listeners added via
 Transaction.addTransactionListener(Consumer).protected abstract void doReadWrite()
readWrite().  
 Implementers should run their readWrite consumer here.protected abstract void doClose()
close().  
 Implementers should run their readWrite consumer here.public void open()
open in interface Transactionpublic void commit()
commit in interface Transactionpublic void rollback()
rollback in interface Transactionpublic <R> Transaction.Workload<R> submit(Function<Graph,R> work)
Transaction.Workload that can be automatically
 retried in the event of failure.submit in interface Transactionpublic <G extends Graph> G createThreadedTx()
Graph 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 Graph
 that supports transactions will typically bind a transaction to a single thread via ThreadLocal.createThreadedTx in interface Transactionpublic void readWrite()
readWrite in interface Transactionpublic void close()
Transaction.onClose(Consumer)} will be
 executed.close in interface AutoCloseableclose in interface TransactionCopyright © 2013–2015 Apache Software Foundation. All rights reserved.