Class TransactionalBase
- java.lang.Object
-
- org.apache.jena.dboe.transaction.txn.TransactionalBase
-
- All Implemented Interfaces:
Transactional,TransactionalSystem,Transactional
public class TransactionalBase extends java.lang.Object implements TransactionalSystem
Framework for implementing aTransactionalviaTransactionalSystem. This base class provides the "per thread" aspect - theTransactionCoordinatoritself is not thread aware.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.jena.sparql.core.Transactional
Transactional.Promote
-
-
Constructor Summary
Constructors Constructor Description TransactionalBase(java.lang.String label, TransactionCoordinator txnMgr)TransactionalBase(TransactionCoordinator txnMgr)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidabort()voidattach(TransactionCoordinatorState coordinatorState)Attach a transaction to this thread.voidbegin(ReadWrite readWrite)voidbegin(TxnType txnType)voidcommit()voidcommitExec()Do the 2-phase "commit" stepvoidcommitPrepare()Do the 2-phase "prepare" step after which the transaction coordinator decides whether to commit or abort.TransactionCoordinatorStatedetach()Suspend this transaction, detaching from the current thread.voidend()TransactiongetThreadTransaction()Return the transaction object for this thread.TransactionInfogetTransactionInfo()Return an information view of the transaction for this thread, if any.TransactionCoordinatorgetTxnMgr()Get the associatedTransactionCoordinatorbooleanisInTransaction()booleanpromote()booleanpromote(Transactional.Promote promoteMode)voidshutdown()Shutdown component, aborting any in-progress transactions.ReadWritetransactionMode()TxnTypetransactionType()-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.jena.sparql.core.Transactional
begin, calc, calculate, calculateRead, calculateWrite, exec, execute, executeRead, executeWrite
-
-
-
-
Constructor Detail
-
TransactionalBase
public TransactionalBase(java.lang.String label, TransactionCoordinator txnMgr)
-
TransactionalBase
public TransactionalBase(TransactionCoordinator txnMgr)
-
-
Method Detail
-
getTxnMgr
public TransactionCoordinator getTxnMgr()
Description copied from interface:TransactionalSystemGet the associatedTransactionCoordinator- Specified by:
getTxnMgrin interfaceTransactionalSystem
-
detach
public TransactionCoordinatorState detach()
Description copied from interface:TransactionalSystemSuspend this transaction, detaching from the current thread. A new transaction on this thread can performed but the detached transaction still exists and if it is a write transaction it can still block other write transactions.- Specified by:
detachin interfaceTransactionalSystem
-
attach
public void attach(TransactionCoordinatorState coordinatorState)
Description copied from interface:TransactionalSystemAttach a transaction to this thread. A transaction system implementation usually imposes a rule that only one thread can have a transaction attached at a time.- Specified by:
attachin interfaceTransactionalSystem
-
begin
public final void begin(ReadWrite readWrite)
- Specified by:
beginin interfaceTransactional
-
begin
public final void begin(TxnType txnType)
- Specified by:
beginin interfaceTransactional
-
promote
public final boolean promote()
- Specified by:
promotein interfaceTransactional
-
promote
public final boolean promote(Transactional.Promote promoteMode)
- Specified by:
promotein interfaceTransactional
-
commit
public final void commit()
- Specified by:
commitin interfaceTransactional- Specified by:
commitin interfaceTransactionalSystem
-
commitPrepare
public void commitPrepare()
Description copied from interface:TransactionalSystemDo the 2-phase "prepare" step after which the transaction coordinator decides whether to commit or abort. A TransactionalSystem must be prepared for both possibilities.- Specified by:
commitPreparein interfaceTransactionalSystem
-
commitExec
public void commitExec()
Description copied from interface:TransactionalSystemDo the 2-phase "commit" step- Specified by:
commitExecin interfaceTransactionalSystem
-
abort
public final void abort()
- Specified by:
abortin interfaceTransactional
-
end
public final void end()
- Specified by:
endin interfaceTransactional
-
transactionMode
public ReadWrite transactionMode()
- Specified by:
transactionModein interfaceTransactional
-
transactionType
public TxnType transactionType()
- Specified by:
transactionTypein interfaceTransactional
-
isInTransaction
public boolean isInTransaction()
- Specified by:
isInTransactionin interfaceTransactional
-
getTransactionInfo
public final TransactionInfo getTransactionInfo()
Description copied from interface:TransactionalSystemReturn an information view of the transaction for this thread, if any. Returns null when there is no active transaction for this tread.- Specified by:
getTransactionInfoin interfaceTransactionalSystem
-
getThreadTransaction
public final Transaction getThreadTransaction()
Description copied from interface:TransactionalSystemReturn the transaction object for this thread. Low-level use only. To get information about the current transaction, callTransactionalSystem.getTransactionInfo().- Specified by:
getThreadTransactionin interfaceTransactionalSystem
-
shutdown
public void shutdown()
Shutdown component, aborting any in-progress transactions. This operation is not guaranteed to be called.
-
-