|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atomikos.icatch.imp.AbstractCompositeTransaction
public abstract class AbstractCompositeTransaction
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 obj)
|
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. |
int |
hashCode()
|
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, 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 CompositeTransaction
CompositeTransaction.
public void setTag(HeuristicMessage tag)
CompositeTransaction
setTag
in interface CompositeTransaction
tag
- The tag to add to the transaction.CompositeTransaction.
public boolean isSerial()
CompositeTransaction
isSerial
in interface CompositeTransaction
CompositeTransaction.
public boolean isLocal()
CompositeTransaction
isLocal
in interface CompositeTransaction
Defaults to false.
public TransactionControl getTransactionControl() throws UnsupportedOperationException
CompositeTransaction
getTransactionControl
in interface CompositeTransaction
UnsupportedOperationException
CompositeTransaction.
public RecoveryCoordinator addParticipant(Participant participant) throws SysException, IllegalStateException
CompositeTransaction
addParticipant
in interface CompositeTransaction
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
sync
- The callback object.
IllegalStateException
- If no tx longer active.
SysException
- Unexptected failure.
UnsupportedOperationException
CompositeTransaction
public Stack getLineage()
CompositeTransaction
getLineage
in interface CompositeTransaction
CompositeTransaction.
public boolean isRoot()
CompositeTransaction
isRoot
in interface CompositeTransaction
CompositeTransaction.
public boolean isAncestorOf(CompositeTransaction ct)
CompositeTransaction
isAncestorOf
in interface CompositeTransaction
ct
- The argument to test for ancestor.
CompositeTransaction.
public boolean isDescendantOf(CompositeTransaction ct)
CompositeTransaction
isDescendantOf
in interface CompositeTransaction
ct
- The argument to test for descendant.
CompositeTransaction.
public boolean isRelatedTransaction(CompositeTransaction ct)
CompositeTransaction
isRelatedTransaction
in interface CompositeTransaction
CompositeTransaction.
public boolean isSameTransaction(CompositeTransaction ct)
CompositeTransaction
isSameTransaction
in interface CompositeTransaction
CompositeTransaction.
public int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
public CompositeCoordinator getCompositeCoordinator() throws SysException, UnsupportedOperationException
CompositeTransaction
getCompositeCoordinator
in interface CompositeTransaction
SysException
- On failure.
UnsupportedOperationException
CompositeTransaction.
public void addSubTxAwareParticipant(SubTxAwareParticipant subtxaware) throws SysException, UnsupportedOperationException, IllegalStateException
CompositeTransaction
addSubTxAwareParticipant
in interface CompositeTransaction
subtxaware
- The participant to be notified
on local termination.
IllegalStateException
- If no longer active.
SysException
UnsupportedOperationException
CompositeTransaction
public CompositeTransaction createSubTransaction() throws SysException, IllegalStateException
CompositeTransaction
createSubTransaction
in interface CompositeTransaction
IllegalStateException
- If no longer active.
SysException
CompositeTransaction.createSubTransaction()
public void setSerial() throws IllegalStateException, SysException
CompositeTransaction
setSerial
in interface CompositeTransaction
IllegalStateException
- If called for non-root tx.
SysException
- For unexpected errors.CompositeTransaction.setSerial()
public int getLocalSubTxCount()
CompositeTransaction
getLocalSubTxCount
in interface CompositeTransaction
CompositeTransaction.getLocalSubTxCount()
public Extent getExtent()
CompositeTransaction
getExtent
in interface CompositeTransaction
CompositeTransaction.getExtent()
public long getTimeout()
CompositeTransaction
getTimeout
in interface CompositeTransaction
CompositeTransaction.getTimeout()
public void setRollbackOnly()
CompositeTransaction
setRollbackOnly
in interface CompositeTransaction
CompositeTransaction.setRollbackOnly()
public void commit() throws HeurRollbackException, HeurMixedException, HeurHazardException, SysException, SecurityException, RollbackException
CompositeTransaction
commit
in interface CompositeTransaction
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
IllegalStateException
- If prepared or inactive.
SysException
- If unexpected error.CompositeTransaction.rollback()
public void setProperty(String name, String value)
CompositeTransaction
setProperty
in interface CompositeTransaction
public String getProperty(String name)
CompositeTransaction
getProperty
in interface CompositeTransaction
name
- The name of the property.
public Properties getProperties()
CompositeTransaction
getProperties
in interface CompositeTransaction
public Object getState()
CompositeTransaction
getState
in interface Stateful
getState
in interface CompositeTransaction
com.atomikos.finitestates.Stateful.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |