|
|||||||||
| 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
Copyright © 2001, Atomikos. All rights reserved. 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)
Add a new participant. |
void |
addSubTxAwareParticipant(SubTxAwareParticipant subtxaware)
Register a participant on behalf of a subtransaction, to be notified as soon as the locally finished state is reached. |
void |
commit()
Commit 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()
Get the coordinator for this tx. |
Extent |
getExtent()
Get the extent for the transaction. |
int |
getLocalSubTxCount()
Get the number of subtxs that were locally started for this instance. |
Object |
getState()
Get the current state. |
CompositeTerminator |
getTerminator()
Get a terminator for this tx. |
long |
getTimeout()
Get the timeout in ms. |
TransactionControl |
getTransactionControl()
Get a control object for this tx. |
boolean |
isLocal()
Test if the transaction is a locally started transaction or not. |
void |
registerSynchronization(Synchronization sync)
Add a synchronization callback. |
void |
rollback()
Rollback the current transaction. |
void |
setRollbackOnly()
Marks the transaction so that the only possible termination is rollback. |
void |
setSerial()
Set serial mode for root. |
| Methods inherited from class com.atomikos.icatch.imp.AbstractCompositeTransaction |
|---|
equals, getLineage, getProperties, getProperty, getTid, isAncestorOf, isDescendantOf, isRelatedTransaction, isRoot, isSameTransaction, isSerial, setProperty, setTag |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, 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()
CompositeTransaction
getTransactionControl in interface CompositeTransactiongetTransactionControl in class AbstractCompositeTransactionCompositeTransaction.public int getLocalSubTxCount()
CompositeTransaction
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
CompositeTransaction
createSubTransaction in interface CompositeTransactioncreateSubTransaction in interface TransactionControlcreateSubTransaction in class AbstractCompositeTransactionIllegalStateException - If no longer active.
SysExceptionTransactionControl.
public RecoveryCoordinator addParticipant(Participant participant)
throws SysException,
IllegalStateException
CompositeTransaction
addParticipant in interface CompositeTransactionaddParticipant in class AbstractCompositeTransactionparticipant - The participant to add.
SysException - Unexpected.
IllegalStateException - Illegal state.CompositeTransaction
public void registerSynchronization(Synchronization sync)
throws IllegalStateException,
UnsupportedOperationException,
SysException
CompositeTransaction
registerSynchronization in interface CompositeTransactionregisterSynchronization in class AbstractCompositeTransactionsync - The callback object.
IllegalStateException - If no tx longer active.
SysException - Unexptected failure.
UnsupportedOperationExceptionCompositeTransaction
public void addSubTxAwareParticipant(SubTxAwareParticipant subtxaware)
throws SysException,
IllegalStateException
CompositeTransaction
addSubTxAwareParticipant in interface CompositeTransactionaddSubTxAwareParticipant in class AbstractCompositeTransactionsubtxaware - The participant to be notified
on local termination.
IllegalStateException - If no longer active.
SysExceptionCompositeTransaction
protected void doRollback()
throws IllegalStateException,
SysException
IllegalStateException
SysExceptionTransactionControl.
public CompositeCoordinator getCompositeCoordinator()
throws SysException
CompositeTransaction
getCompositeCoordinator in interface CompositeTransactiongetCompositeCoordinator in class AbstractCompositeTransactionSysException - On failure.CompositeTransaction.public boolean isLocal()
CompositeTransaction
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()
CompositeTransaction
getTimeout in interface CompositeTransactiongetTimeout in interface TransactionControlgetTimeout in class AbstractCompositeTransactionTransactionControlpublic Extent getExtent()
CompositeTransaction
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 | ||||||||