|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atomikos.icatch.imp.AbstractCompositeTransaction
com.atomikos.icatch.imp.CompositeTransactionImp
public class CompositeTransactionImp
A complete composite transaction implementation for use in LOCAL VM.
| Field Summary | |
|---|---|
protected CoordinatorImp |
coordinator_
|
protected Extent |
extent_
|
protected boolean |
localRoot_
|
protected TransactionServiceImp |
txservice_
|
| Fields inherited from class com.atomikos.icatch.imp.AbstractCompositeTransaction |
|---|
lineage_, properties_, serial_, tag_, tid_ |
| Constructor Summary | |
|---|---|
CompositeTransactionImp(TransactionServiceImp txservice,
Stack lineage,
String tid,
boolean serial,
CoordinatorImp coordinator)
Constructor. |
|
| Method Summary | |
|---|---|
RecoveryCoordinator |
addParticipant(Participant participant)
|
void |
addSubTxAwareParticipant(SubTxAwareParticipant subtxaware)
Resources that support lock inheritance can use this feature to be notified whenever a lock should be inherited. |
void |
commit()
Commits the composite transaction. |
CompositeTransaction |
createSubTransaction()
Create a subtx for this transaction. |
protected void |
doCommit()
Successfully end the composite transaction. |
protected void |
doRollback()
|
void |
entered(FSMEnterEvent event)
Called when the FSM has entered a new state. |
CompositeCoordinator |
getCompositeCoordinator()
|
Extent |
getExtent()
Get the extent for the transaction. |
int |
getLocalSubTxCount()
Get the number of subtxs that were locally started for this instance. |
Object |
getState()
Gets the current state. |
CompositeTerminator |
getTerminator()
Get a terminator for this tx. |
long |
getTimeout()
Get the timeout in ms. |
TransactionControl |
getTransactionControl()
|
boolean |
isLocal()
|
void |
registerSynchronization(Synchronization sync)
|
void |
rollback()
Rollback of the current transaction. |
void |
setRollbackOnly()
Marks the transaction so that the only possible termination is rollback. |
void |
setSerial()
Sets the serial mode. |
| Methods inherited from class com.atomikos.icatch.imp.AbstractCompositeTransaction |
|---|
equals, getLineage, getProperties, getProperty, getTid, hashCode, isAncestorOf, isDescendantOf, isRelatedTransaction, isRoot, isSameTransaction, isSerial, setProperty, setTag |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.atomikos.icatch.TransactionControl |
|---|
setTag |
| Field Detail |
|---|
protected CoordinatorImp coordinator_
protected TransactionServiceImp txservice_
protected Extent extent_
protected boolean localRoot_
| Constructor Detail |
|---|
public CompositeTransactionImp(TransactionServiceImp txservice,
Stack lineage,
String tid,
boolean serial,
CoordinatorImp coordinator)
throws IllegalStateException
txservice - The Transaction Service this is for.lineage - The ancestor information.tid - The identifier for this one.serial - If true, no parallel calls allowed.coordinator - The coordinator to use.
IllegalStateException - If coordinator no longer activatable.| Method Detail |
|---|
public TransactionControl getTransactionControl()
getTransactionControl in interface CompositeTransactiongetTransactionControl in class AbstractCompositeTransactionCompositeTransaction.public int getLocalSubTxCount()
TransactionControl
getLocalSubTxCount in interface CompositeTransactiongetLocalSubTxCount in interface TransactionControlgetLocalSubTxCount in class AbstractCompositeTransactionTransactionControl
public void setSerial()
throws IllegalStateException,
SysException
CompositeTransaction
setSerial in interface CompositeTransactionsetSerial in interface TransactionControlsetSerial in class AbstractCompositeTransactionIllegalStateException - If called for non-root tx.
SysException - For unexpected errors.TransactionControl.
public CompositeTransaction createSubTransaction()
throws SysException,
IllegalStateException
TransactionControl
createSubTransaction in interface CompositeTransactioncreateSubTransaction in interface TransactionControlcreateSubTransaction in class AbstractCompositeTransactionIllegalStateException - If no longer active.
SysExceptionTransactionControl.
public RecoveryCoordinator addParticipant(Participant participant)
throws SysException,
IllegalStateException
addParticipant in interface CompositeTransactionaddParticipant in class AbstractCompositeTransactionSysException
IllegalStateExceptionCompositeTransaction
public void registerSynchronization(Synchronization sync)
throws IllegalStateException,
UnsupportedOperationException,
SysException
registerSynchronization in interface CompositeTransactionregisterSynchronization in class AbstractCompositeTransactionIllegalStateException
SysException
UnsupportedOperationExceptionCompositeTransaction
public void addSubTxAwareParticipant(SubTxAwareParticipant subtxaware)
throws SysException,
IllegalStateException
CompositeTransaction
addSubTxAwareParticipant in interface CompositeTransactionaddSubTxAwareParticipant in class AbstractCompositeTransactionSysException
IllegalStateExceptionCompositeTransaction
protected void doRollback()
throws IllegalStateException,
SysException
IllegalStateException
SysExceptionTransactionControl.
public CompositeCoordinator getCompositeCoordinator()
throws SysException
getCompositeCoordinator in interface CompositeTransactiongetCompositeCoordinator in class AbstractCompositeTransactionSysExceptionCompositeTransaction.public boolean isLocal()
isLocal in interface CompositeTransactionisLocal in class AbstractCompositeTransactionCompositeTransaction.public CompositeTerminator getTerminator()
TransactionControl
getTerminator in interface TransactionControlTransactionControl.
protected void doCommit()
throws SysException,
IllegalStateException,
RollbackException
IllegalStateException - If no longer active.
SysException - Unexpected failure.
RollbackExceptionpublic long getTimeout()
TransactionControl
getTimeout in interface CompositeTransactiongetTimeout in interface TransactionControlgetTimeout in class AbstractCompositeTransactionTransactionControlpublic Extent getExtent()
TransactionControl
getExtent in interface CompositeTransactiongetExtent in interface TransactionControlgetExtent in class AbstractCompositeTransactionTransactionControl.public void setRollbackOnly()
CompositeTransaction
setRollbackOnly in interface CompositeTransactionsetRollbackOnly in interface TransactionControlsetRollbackOnly in class AbstractCompositeTransactionTransactionControl.
public void commit()
throws HeurRollbackException,
HeurMixedException,
HeurHazardException,
SysException,
SecurityException,
RollbackException
CompositeTransaction
commit in interface CompositeTransactioncommit in class AbstractCompositeTransactionHeurRollbackException - On heuristic rollback.
HeurMixedException - On heuristic mixed outcome.
HeurHazardException - In case of heuristic hazard.
SysException - For unexpected failures.
SecurityException - If calling thread does not have
right to commit.
RollbackException - If the transaction was rolled back
before prepare.CompositeTransaction.commit()
public void rollback()
throws IllegalStateException,
SysException
CompositeTransaction
rollback in interface CompositeTransactionrollback in class AbstractCompositeTransactionIllegalStateException - If prepared or inactive.
SysException - If unexpected error.CompositeTransaction.rollback()public Object getState()
CompositeTransaction
getState in interface StatefulgetState in interface CompositeTransactiongetState in class AbstractCompositeTransactioncom.atomikos.finitestates.Stateful.public void entered(FSMEnterEvent event)
FSMEnterListener
entered in interface FSMEnterListenercom.atomikos.finitestates.FSMEnterListener#preEnter(com.atomikos.finitestates.FSMEnterEvent)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||