|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.atomikos.datasource.xa.XAResourceTransaction
public class XAResourceTransaction
Copyright © 2001, Atomikos. All rights reserved. An implementation of ResourceTransaction for XA transactions.
| Field Summary | |
|---|---|
protected boolean |
enlisted_
|
protected Vector |
heuristicMessages_
|
protected XATransactionalResource |
resource_
|
protected String |
resourcename_
|
protected String |
root_
|
protected TxState |
state_
|
protected String |
tid_
|
protected int |
timeout_
|
protected CompositeTransaction |
transaction_
|
protected XAResource |
xaresource_
|
protected Xid |
xid_
|
| Fields inherited from interface com.atomikos.icatch.Participant |
|---|
READ_ONLY |
| Constructor Summary | |
|---|---|
XAResourceTransaction()
|
|
| Method Summary | |
|---|---|
void |
addCompensationContext(Dictionary context)
Add a compensation context for this resourcetx. |
void |
addHeuristicMessage(HeuristicMessage mesg)
Add heuristic resolution information. |
HeuristicMessage[] |
commit(boolean onePhase)
Commit the participant's work. |
boolean |
equals(Object o)
Absolutely necessary for coordinator to work correctly |
void |
forget()
Indicate that a heuristic participant can forget about its work. |
Dictionary |
getCompensationContext()
Get the compensation information. |
HeuristicMessage[] |
getHeuristicMessages()
Get heuristic context info. |
Object |
getState()
|
String |
getTid()
Get identifier for this tx. |
String |
getURI()
Gets a unique URI for this participant. |
Xid |
getXid()
Get the Xid. |
int |
hashCode()
Absolutely necessary for coordinator to work correctly |
protected static String |
interpretErrorCode(String opCode,
Xid xid,
int errorCode)
|
boolean |
isActive()
Test if the restx is active (in use). |
protected boolean |
isValid()
|
boolean |
isXaSuspended()
Test if the resource has been ended with TMSUSPEND. |
int |
prepare()
Prepare the participant. |
protected void |
printMsg(String msg,
int level)
|
void |
readExternal(ObjectInput in)
|
boolean |
recover()
Recover this instance. |
void |
resume()
Resume a suspended tx. |
HeuristicMessage[] |
rollback()
Rollback the participant's work. |
void |
setCascadeList(Dictionary allParticipants)
For cascading 2PC, this method sets the information needed to cascade. |
void |
setGlobalSiblingCount(int count)
Set by the root coordinator: the total no of siblings detected. |
void |
setXAResource(XAResource xaresource)
Set the XAResource attribute. |
void |
suspend()
Suspend the resourcetransaction, so that underlying resources can be used for a next (sibling) invocation. |
protected void |
testOrRefreshXAResourceFor2PC()
|
String |
toString()
|
void |
writeExternal(ObjectOutput out)
|
void |
xaResume()
Perform an xa resume |
void |
xaSuspend()
Perform an XA suspend. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected String tid_
protected String root_
protected TxState state_
protected String resourcename_
protected transient Xid xid_
protected transient XATransactionalResource resource_
protected transient XAResource xaresource_
protected transient CompositeTransaction transaction_
protected Vector heuristicMessages_
protected transient boolean enlisted_
protected transient int timeout_
| Constructor Detail |
|---|
public XAResourceTransaction()
| Method Detail |
|---|
protected static String interpretErrorCode(String opCode,
Xid xid,
int errorCode)
protected void testOrRefreshXAResourceFor2PC()
protected void printMsg(String msg,
int level)
protected boolean isValid()
public void writeExternal(ObjectOutput out)
throws IOException
writeExternal in interface ExternalizableIOException
public void readExternal(ObjectInput in)
throws IOException,
ClassNotFoundException
readExternal in interface ExternalizableIOException
ClassNotFoundExceptionpublic String getTid()
ResourceTransaction
getTid in interface ResourceTransactionResourceTransaction.
public void addCompensationContext(Dictionary context)
throws IllegalStateException
ResourceTransaction
addCompensationContext in interface ResourceTransactioncontext - The compensation context.
IllegalStateException - If no longer active.ResourceTransaction.
public void addHeuristicMessage(HeuristicMessage mesg)
throws IllegalStateException
ResourceTransaction
addHeuristicMessage in interface ResourceTransactionmesg - The heuristic message.
IllegalStateException - If no longer active.ResourceTransaction.public HeuristicMessage[] getHeuristicMessages()
ResourceTransaction
getHeuristicMessages in interface ResourceTransactiongetHeuristicMessages in interface ParticipantResourceTransaction.public Dictionary getCompensationContext()
ResourceTransaction
getCompensationContext in interface ResourceTransactionResourceTransaction.
public void suspend()
throws ResourceException
ResourceTransaction
suspend in interface ResourceTransactionResourceExceptionResourceTransaction.
public void resume()
throws ResourceException
ResourceTransaction
resume in interface ResourceTransactionResourceExceptionResourceTransaction.
public void setCascadeList(Dictionary allParticipants)
throws SysException
Participant
setCascadeList in interface ParticipantallParticipants - The information needed by
the transaction monitor for
SysException - For unexpected failures.Participantpublic Object getState()
public boolean recover()
throws SysException
Participant
recover in interface ParticipantSysException - On failure.Participantpublic void setGlobalSiblingCount(int count)
Participant
setGlobalSiblingCount in interface Participantcount - The global count.Participantpublic void forget()
Participant
forget in interface ParticipantParticipant
public int prepare()
throws RollbackException,
HeurHazardException,
HeurMixedException,
SysException
Participant
prepare in interface ParticipantRollbackException - For a NO vote.
This indicates that the participant has already rolled back
(or marked for rollback) the work on behalf of this participant.
HeurHazardException - On possible conflicts.
This happens for remote participants instances, in case of
communication failures.
HeurMixedException - If some subordinate
participants voted YES, timed out and committed heuristically
whereas afterwards some NO votes where received.
SysException - Unexpected errors.Participant
public HeuristicMessage[] rollback()
throws HeurCommitException,
HeurMixedException,
HeurHazardException,
SysException
Participant
rollback in interface ParticipantHeurCommitException - If the participant committed.
HeurMixedException - If part of it was rolled back.
HeurHazardException - If the participant's final state
is unsure.
SysException - Unexpected failure.Participant.
public HeuristicMessage[] commit(boolean onePhase)
throws HeurRollbackException,
HeurHazardException,
HeurMixedException,
RollbackException,
SysException
Participant
commit in interface ParticipantonePhase - If true, one-phase commit is being started.
If the participant has received a prepare call earlier,
then it should throw a SysException here.
HeurHazardException - On possible conflicts.
RollbackException - In case of one-phase commit,
and the transaction has been rolled back at the time
commit is called.
SysException - Unexpected failure.
HeurRollbackException
HeurMixedExceptionParticipantpublic boolean equals(Object o)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic String toString()
toString in class Objectpublic Xid getXid()
public void setXAResource(XAResource xaresource)
xaresource - The new XAResource to use. This new XAResource represents the
new connection to the XA database. Necessary because on reuse,
the old xaresource may be in use by another thread, for
another transaction.
public void xaSuspend()
throws XAException
XAException
public void xaResume()
throws XAException
XAExceptionpublic boolean isXaSuspended()
public boolean isActive()
public String getURI()
Participant
getURI in interface ParticipantParticipant.getURI()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||