|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.atomikos.icatch.imp.AbstractCompositeTransaction
public abstract class AbstractCompositeTransaction
Copyright © 2001, Atomikos. All rights reserved. An abstract base implementation of CompositeTransaction, for common behaviour of both proxy and local instances.
| Field Summary | |
|---|---|
protected Stack |
lineage_
|
protected Properties |
properties_
|
protected boolean |
serial_
|
protected HeuristicMessage |
tag_
|
protected String |
tid_
|
| Constructor Summary | |
|---|---|
AbstractCompositeTransaction()
Required for externalization of subclasses |
|
AbstractCompositeTransaction(String tid,
Stack lineage,
boolean serial)
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. |
boolean |
equals(Object o)
|
CompositeCoordinator |
getCompositeCoordinator()
Get the coordinator for this tx. |
Extent |
getExtent()
Get the extent for the transaction. |
Stack |
getLineage()
Get the ancestor info. |
int |
getLocalSubTxCount()
Get the number of subtxs that were locally started for this instance. |
Properties |
getProperties()
Gets all properties of this instance. |
String |
getProperty(String name)
Gets the specified metadata property. |
Object |
getState()
Get the current state. |
String |
getTid()
Getter for tid. |
long |
getTimeout()
Get the timeout in ms. |
TransactionControl |
getTransactionControl()
Get a control object for this tx. |
boolean |
isAncestorOf(CompositeTransaction ct)
Test if this instance is an ancestor of ct. |
boolean |
isDescendantOf(CompositeTransaction ct)
Test if this instance is a descendant of ct. |
boolean |
isLocal()
Test if the transaction is a locally started transaction or not. |
boolean |
isRelatedTransaction(CompositeTransaction ct)
Test if this instance is related to ct. |
boolean |
isRoot()
Test if this instance is a root or not. |
boolean |
isSameTransaction(CompositeTransaction ct)
Test if this intance represents the same transaction as ct. |
boolean |
isSerial()
Test if serial tx or not. |
void |
registerSynchronization(Synchronization sync)
Add a synchronization callback. |
void |
rollback()
Rollback the current transaction. |
void |
setProperty(String name,
String value)
Sets metadata property information on the transaction object. |
void |
setRollbackOnly()
Marks the transaction so that the only possible termination is rollback. |
void |
setSerial()
Set serial mode for root. |
void |
setTag(HeuristicMessage tag)
Sets the tag for this transaction. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Stack lineage_
protected String tid_
protected boolean serial_
protected HeuristicMessage tag_
protected Properties properties_
| Constructor Detail |
|---|
public AbstractCompositeTransaction()
public AbstractCompositeTransaction(String tid,
Stack lineage,
boolean serial)
| Method Detail |
|---|
public String getTid()
CompositeTransaction
getTid in interface CompositeTransactionCompositeTransaction.public void setTag(HeuristicMessage tag)
CompositeTransaction
setTag in interface CompositeTransactiontag - The tag to add to the transaction.CompositeTransaction.public boolean isSerial()
CompositeTransaction
isSerial in interface CompositeTransactionCompositeTransaction.public boolean isLocal()
CompositeTransaction
isLocal in interface CompositeTransactionDefaults to false.
public TransactionControl getTransactionControl()
throws UnsupportedOperationException
CompositeTransaction
getTransactionControl in interface CompositeTransactionUnsupportedOperationExceptionCompositeTransaction.
public RecoveryCoordinator addParticipant(Participant participant)
throws SysException,
IllegalStateException
CompositeTransaction
addParticipant in interface CompositeTransactionparticipant - The participant to add.
SysException - Unexpected.
IllegalStateException - Illegal state.CompositeTransaction
public void registerSynchronization(Synchronization sync)
throws IllegalStateException,
UnsupportedOperationException,
SysException
CompositeTransaction
registerSynchronization in interface CompositeTransactionsync - The callback object.
IllegalStateException - If no tx longer active.
SysException - Unexptected failure.
UnsupportedOperationExceptionCompositeTransactionpublic Stack getLineage()
CompositeTransaction
getLineage in interface CompositeTransactionCompositeTransaction.public boolean isRoot()
CompositeTransaction
isRoot in interface CompositeTransactionCompositeTransaction.public boolean isAncestorOf(CompositeTransaction ct)
CompositeTransaction
isAncestorOf in interface CompositeTransactionct - The argument to test for ancestor.
CompositeTransaction.public boolean isDescendantOf(CompositeTransaction ct)
CompositeTransaction
isDescendantOf in interface CompositeTransactionct - The argument to test for descendant.
CompositeTransaction.public boolean isRelatedTransaction(CompositeTransaction ct)
CompositeTransaction
isRelatedTransaction in interface CompositeTransactionCompositeTransaction.public boolean isSameTransaction(CompositeTransaction ct)
CompositeTransaction
isSameTransaction in interface CompositeTransactionCompositeTransaction.public boolean equals(Object o)
equals in class Object
public CompositeCoordinator getCompositeCoordinator()
throws SysException,
UnsupportedOperationException
CompositeTransaction
getCompositeCoordinator in interface CompositeTransactionSysException - On failure.
UnsupportedOperationExceptionCompositeTransaction.
public void addSubTxAwareParticipant(SubTxAwareParticipant subtxaware)
throws SysException,
UnsupportedOperationException,
IllegalStateException
CompositeTransaction
addSubTxAwareParticipant in interface CompositeTransactionsubtxaware - The participant to be notified
on local termination.
IllegalStateException - If no longer active.
SysException
UnsupportedOperationExceptionCompositeTransaction
public CompositeTransaction createSubTransaction()
throws SysException,
IllegalStateException
CompositeTransaction
createSubTransaction in interface CompositeTransactionIllegalStateException - If no longer active.
SysExceptionCompositeTransaction.createSubTransaction()
public void setSerial()
throws IllegalStateException,
SysException
CompositeTransaction
setSerial in interface CompositeTransactionIllegalStateException - If called for non-root tx.
SysException - For unexpected errors.CompositeTransaction.setSerial()public int getLocalSubTxCount()
CompositeTransaction
getLocalSubTxCount in interface CompositeTransactionCompositeTransaction.getLocalSubTxCount()public Extent getExtent()
CompositeTransaction
getExtent in interface CompositeTransactionCompositeTransaction.getExtent()public long getTimeout()
CompositeTransaction
getTimeout in interface CompositeTransactionCompositeTransaction.getTimeout()public void setRollbackOnly()
CompositeTransaction
setRollbackOnly in interface CompositeTransactionCompositeTransaction.setRollbackOnly()
public void commit()
throws HeurRollbackException,
HeurMixedException,
HeurHazardException,
SysException,
SecurityException,
RollbackException
CompositeTransaction
commit in interface CompositeTransactionHeurRollbackException - 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 CompositeTransactionIllegalStateException - If prepared or inactive.
SysException - If unexpected error.CompositeTransaction.rollback()
public void setProperty(String name,
String value)
CompositeTransaction
setProperty in interface CompositeTransactionpublic String getProperty(String name)
CompositeTransaction
getProperty in interface CompositeTransactionname - The name of the property.
public Properties getProperties()
CompositeTransaction
getProperties in interface CompositeTransactionpublic Object getState()
CompositeTransaction
getState in interface StatefulgetState in interface CompositeTransactioncom.atomikos.finitestates.Stateful.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||