|
||||||||||
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
An implementation of ResourceTransaction for XA transactions.
Field Summary |
---|
Fields inherited from interface com.atomikos.icatch.Participant |
---|
READ_ONLY |
Constructor Summary | |
---|---|
XAResourceTransaction()
|
Method Summary | |
---|---|
void |
addCompensationContext(Dictionary context)
|
void |
addHeuristicMessage(HeuristicMessage mesg)
Adds heuristic resolution information. |
HeuristicMessage[] |
commit(boolean onePhase)
Commits the participant's work. |
boolean |
equals(Object o)
Absolutely necessary for coordinator to work correctly |
protected void |
forceRefreshXAConnection()
|
void |
forget()
Indicates that a heuristic participant can forget about its work. |
Dictionary |
getCompensationContext()
|
HeuristicMessage[] |
getHeuristicMessages()
|
Object |
getState()
|
String |
getTid()
|
String |
getURI()
|
Xid |
getXid()
Get the Xid. |
int |
hashCode()
Absolutely necessary for coordinator to work correctly |
protected static String |
interpretErrorCode(String resourceName,
String opCode,
Xid xid,
int errorCode)
|
boolean |
isActive()
Test if the restx is active (in use). |
boolean |
isXaSuspended()
Test if the resource has been ended with TMSUSPEND. |
int |
prepare()
Prepares the participant. |
void |
readExternal(ObjectInput in)
|
boolean |
recover()
Called by the transaction manager (TM) at recovery time, and this should reconstruct the internal state. |
void |
resume()
Resumes a previously suspended tx. |
HeuristicMessage[] |
rollback()
Rollback of 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. |
protected void |
setRecoveredXAResource(XAResource xaresource)
|
void |
setXAResource(XAResource xaresource)
Set the XAResource attribute. |
void |
suspend()
Suspends the work, 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 |
Constructor Detail |
---|
public XAResourceTransaction()
Method Detail |
---|
protected static String interpretErrorCode(String resourceName, String opCode, Xid xid, int errorCode)
protected void testOrRefreshXAResourceFor2PC() throws XAException
XAException
protected void forceRefreshXAConnection() throws XAException
XAException
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
IOException
ClassNotFoundException
public String getTid()
getTid
in interface ResourceTransaction
ResourceTransaction.
public void addCompensationContext(Dictionary context) throws IllegalStateException
IllegalStateException
ResourceTransaction.
public void addHeuristicMessage(HeuristicMessage mesg) throws IllegalStateException
ResourceTransaction
addHeuristicMessage
in interface ResourceTransaction
mesg
- The heuristic message.
IllegalStateException
- If no longer active.ResourceTransaction.
public HeuristicMessage[] getHeuristicMessages()
getHeuristicMessages
in interface ResourceTransaction
getHeuristicMessages
in interface Participant
ResourceTransaction.
public Dictionary getCompensationContext()
ResourceTransaction.
public void suspend() throws ResourceException
ResourceTransaction
suspend
in interface ResourceTransaction
ResourceException
ResourceTransaction.
public void resume() throws ResourceException
ResourceTransaction
resume
in interface ResourceTransaction
ResourceException
ResourceTransaction.
public void setCascadeList(Dictionary allParticipants) throws SysException
Participant
setCascadeList
in interface Participant
allParticipants
- The information needed by
the transaction monitor.
SysException
Participant
public Object getState()
public boolean recover() throws SysException
Participant
recover
in interface Participant
SysException
Participant
public void setGlobalSiblingCount(int count)
Participant
setGlobalSiblingCount
in interface Participant
count
- The global count.Participant
public void forget()
Participant
forget
in interface Participant
Participant
public int prepare() throws RollbackException, HeurHazardException, HeurMixedException, SysException
Participant
prepare
in interface Participant
RollbackException
- 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
Participant
public HeuristicMessage[] rollback() throws HeurCommitException, HeurMixedException, HeurHazardException, SysException
Participant
rollback
in interface Participant
HeurCommitException
- If the participant committed.
HeurMixedException
- If part of the work was rolled back.
HeurHazardException
- If the participant's final state
is unsure.
SysException
Participant.
public HeuristicMessage[] commit(boolean onePhase) throws HeurRollbackException, HeurHazardException, HeurMixedException, RollbackException, SysException
Participant
commit
in interface Participant
onePhase
- 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
HeurRollbackException
HeurMixedException
Participant
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
public Xid getXid()
protected void setRecoveredXAResource(XAResource xaresource)
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
XAException
public boolean isXaSuspended()
public boolean isActive()
public String getURI()
getURI
in interface Participant
Participant.getURI()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |