|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.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)
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, 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()
CompositeTransaction
getTransactionControl
in interface CompositeTransaction
getTransactionControl
in class AbstractCompositeTransaction
CompositeTransaction.
public int getLocalSubTxCount()
CompositeTransaction
getLocalSubTxCount
in interface CompositeTransaction
getLocalSubTxCount
in interface TransactionControl
getLocalSubTxCount
in class AbstractCompositeTransaction
TransactionControl
public void setSerial() throws IllegalStateException, SysException
CompositeTransaction
setSerial
in interface CompositeTransaction
setSerial
in interface TransactionControl
setSerial
in class AbstractCompositeTransaction
IllegalStateException
- If called for non-root tx.
SysException
- For unexpected errors.TransactionControl.
public CompositeTransaction createSubTransaction() throws SysException, IllegalStateException
CompositeTransaction
createSubTransaction
in interface CompositeTransaction
createSubTransaction
in interface TransactionControl
createSubTransaction
in class AbstractCompositeTransaction
IllegalStateException
- If no longer active.
SysException
TransactionControl.
public RecoveryCoordinator addParticipant(Participant participant) throws SysException, IllegalStateException
CompositeTransaction
addParticipant
in interface CompositeTransaction
addParticipant
in class AbstractCompositeTransaction
participant
- The participant to add.
SysException
- Unexpected.
IllegalStateException
- Illegal state.CompositeTransaction
public void registerSynchronization(Synchronization sync) throws IllegalStateException, UnsupportedOperationException, SysException
CompositeTransaction
registerSynchronization
in interface CompositeTransaction
registerSynchronization
in class AbstractCompositeTransaction
sync
- The callback object.
IllegalStateException
- If no tx longer active.
SysException
- Unexptected failure.
UnsupportedOperationException
CompositeTransaction
public void addSubTxAwareParticipant(SubTxAwareParticipant subtxaware) throws SysException, IllegalStateException
CompositeTransaction
addSubTxAwareParticipant
in interface CompositeTransaction
addSubTxAwareParticipant
in class AbstractCompositeTransaction
subtxaware
- The participant to be notified
on local termination.
IllegalStateException
- If no longer active.
SysException
CompositeTransaction
protected void doRollback() throws IllegalStateException, SysException
IllegalStateException
SysException
TransactionControl.
public CompositeCoordinator getCompositeCoordinator() throws SysException
CompositeTransaction
getCompositeCoordinator
in interface CompositeTransaction
getCompositeCoordinator
in class AbstractCompositeTransaction
SysException
- On failure.CompositeTransaction.
public boolean isLocal()
CompositeTransaction
isLocal
in interface CompositeTransaction
isLocal
in class AbstractCompositeTransaction
CompositeTransaction.
public CompositeTerminator getTerminator()
TransactionControl
getTerminator
in interface TransactionControl
TransactionControl.
protected void doCommit() throws SysException, IllegalStateException, RollbackException
IllegalStateException
- If no longer active.
SysException
- Unexpected failure.
RollbackException
public long getTimeout()
CompositeTransaction
getTimeout
in interface CompositeTransaction
getTimeout
in interface TransactionControl
getTimeout
in class AbstractCompositeTransaction
TransactionControl
public Extent getExtent()
CompositeTransaction
getExtent
in interface CompositeTransaction
getExtent
in interface TransactionControl
getExtent
in class AbstractCompositeTransaction
TransactionControl.
public void setRollbackOnly()
CompositeTransaction
setRollbackOnly
in interface CompositeTransaction
setRollbackOnly
in interface TransactionControl
setRollbackOnly
in class AbstractCompositeTransaction
TransactionControl.
public void commit() throws HeurRollbackException, HeurMixedException, HeurHazardException, SysException, SecurityException, RollbackException
CompositeTransaction
commit
in interface CompositeTransaction
commit
in class AbstractCompositeTransaction
HeurRollbackException
- 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 CompositeTransaction
rollback
in class AbstractCompositeTransaction
IllegalStateException
- If prepared or inactive.
SysException
- If unexpected error.CompositeTransaction.rollback()
public Object getState()
CompositeTransaction
getState
in interface Stateful
getState
in interface CompositeTransaction
getState
in class AbstractCompositeTransaction
com.atomikos.finitestates.Stateful.
public void entered(FSMEnterEvent event)
FSMEnterListener
entered
in interface FSMEnterListener
com.atomikos.finitestates.FSMEnterListener#preEnter(com.atomikos.finitestates.FSMEnterEvent)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |