pt.ist.fenixframework.core
Class AbstractTransaction
java.lang.Object
pt.ist.fenixframework.core.AbstractTransaction
- All Implemented Interfaces:
- Transaction
- Direct Known Subclasses:
- MemTransaction
public abstract class AbstractTransaction
- extends Object
- implements Transaction
Abstract implementation of Transaction
. This
class provides life-cycle management for free, as well as an implementation
of TxIntrospector, requiring concrete implementations to provide the behavior
for committing/rolling back.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
synchronizations
protected final ConcurrentLinkedQueue<Synchronization> synchronizations
- List of synchronizations associated with the current transaction.
status
protected int status
- Status of the Transaction.
AbstractTransaction
public AbstractTransaction()
commit
public void commit()
throws RollbackException,
HeuristicMixedException,
HeuristicRollbackException,
SecurityException,
IllegalStateException,
SystemException
- Specified by:
commit
in interface Transaction
- Throws:
RollbackException
HeuristicMixedException
HeuristicRollbackException
SecurityException
IllegalStateException
SystemException
notifyBeforeCommit
protected void notifyBeforeCommit()
notifyAfterCommit
protected void notifyAfterCommit()
delistResource
public boolean delistResource(XAResource xaRes,
int flag)
throws IllegalStateException,
SystemException
- Specified by:
delistResource
in interface Transaction
- Throws:
IllegalStateException
SystemException
enlistResource
public boolean enlistResource(XAResource xaRes)
throws RollbackException,
IllegalStateException,
SystemException
- Specified by:
enlistResource
in interface Transaction
- Throws:
RollbackException
IllegalStateException
SystemException
getStatus
public int getStatus()
throws SystemException
- Specified by:
getStatus
in interface Transaction
- Throws:
SystemException
registerSynchronization
public void registerSynchronization(Synchronization sync)
throws RollbackException,
IllegalStateException,
SystemException
- Specified by:
registerSynchronization
in interface Transaction
- Throws:
RollbackException
IllegalStateException
SystemException
rollback
public void rollback()
throws IllegalStateException,
SystemException
- Specified by:
rollback
in interface Transaction
- Throws:
IllegalStateException
SystemException
setRollbackOnly
public void setRollbackOnly()
throws IllegalStateException,
SystemException
- Specified by:
setRollbackOnly
in interface Transaction
- Throws:
IllegalStateException
SystemException
getTxIntrospector
public TxStats getTxIntrospector()
- Description copied from interface:
Transaction
- Get the TxIntrospector object that contains the changes caused by this
transaction. Multiple calls to this method will return the same object.
- Returns:
- TxIntrospector The TxIntrospector object associated with this
transaction.
backendCommit
protected abstract void backendCommit()
throws RollbackException,
HeuristicMixedException,
HeuristicRollbackException,
SecurityException,
IllegalStateException,
SystemException
- Throws:
RollbackException
HeuristicMixedException
HeuristicRollbackException
SecurityException
IllegalStateException
SystemException
backendRollback
protected abstract void backendRollback()
throws IllegalStateException,
SystemException
- Throws:
IllegalStateException
SystemException
Copyright © 2013. All Rights Reserved.