|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.csc.phynixx.xa.PhynixxXAResource<C>
public class PhynixxXAResource<C extends IPhynixxConnection>
A transactional branch may be associated with differnt XAResources (TMJOIN) or a XAResource may be shared with different transaction branches
Therefore a transactional branch might be associated to many XAResources or to many transactions (==XIDs) A XAresourec can be initialized with a connection. This connection is used, the first time an TX is opened on the XAResource. Any following TX get an new connection
Field Summary |
---|
Fields inherited from interface javax.transaction.xa.XAResource |
---|
TMENDRSCAN, TMFAIL, TMJOIN, TMNOFLAGS, TMONEPHASE, TMRESUME, TMSTARTRSCAN, TMSUCCESS, TMSUSPEND, XA_OK, XA_RDONLY |
Constructor Summary | |
---|---|
PhynixxXAResource(String xaId,
TransactionManager transactionManager,
PhynixxXAResourceFactory<C> xaResourceFactory)
TODO timeOut ueber einen Listener steuern und konfigierbar machen |
Method Summary | |
---|---|
void |
addXAResourceListener(IPhynixxXAResourceListener listener)
|
void |
close()
finds the transactional branch of the current XAResource associated with die XID Close this XA XAResourceProgressState. |
void |
commit(Xid xid,
boolean onePhase)
|
void |
conditionViolated()
called when the current XAresource is expired (time out occurred) The current Impl. does nothing but marked the associated TX as rollback only The underlying core connection are not treated .... |
void |
end(Xid xid,
int flags)
This method ends the work performed on behalf of a transaction branch. |
boolean |
equals(Object obj)
|
void |
forget(Xid xid)
finds the transactional branch of the current XAResource associated with die XID and closes it without commit or explicit rollback |
Object |
getId()
|
int |
getTransactionTimeout()
|
IPhynixxXAConnection<C> |
getXAConnection()
accessing the XAConnection forces the XAResource to enlist to the Transaction. |
int |
hashCode()
|
boolean |
isClosed()
|
boolean |
isSameRM(XAResource xaResource)
This method is called to determine if the resource manager instance represented by the target object is the same as the resource manager instance represented by the parameter xares . |
boolean |
isSupportsTimeOut()
|
int |
prepare(Xid xid)
finds the transactional branch of the current XAResource associated with die XID Prepares to perform a commit. |
Xid[] |
recover(int flags)
the system is recovered by the xaResourceFactory representing the persistence management system, |
void |
removeXAResourceListener(IPhynixxXAResourceListener<C> listener)
|
void |
rollback(Xid xid)
|
void |
setSupportsTimeOut(boolean supportsTimeOut)
|
boolean |
setTransactionTimeout(int seconds)
This method sets the transaction timeout value for this XAResource instance. |
void |
start(Xid xid,
int flags)
transaction branch is interchangeably with transaction context situation : XAResource is associtaed with XID(1) flags=TMNOFLAGS with XID(1) result : XAResource creates a new transactional context situation : XAResource is associtaed with XID(1) flags=TMJOIN/TNRESUME with XID(1) (may be different in branch) result : XAResource joins the transactional context with the XAResource already associated with XID(1) If TMRESUME is specified, start is to resume a suspended transaction branch specified in xid. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PhynixxXAResource(String xaId, TransactionManager transactionManager, PhynixxXAResourceFactory<C> xaResourceFactory)
Method Detail |
---|
public void conditionViolated()
public boolean isSupportsTimeOut()
public void setSupportsTimeOut(boolean supportsTimeOut)
public IPhynixxXAConnection<C> getXAConnection()
getXAConnection()
must be called in the appropriate TransactionContext
getXAConnection
in interface IPhynixxXAResource<C extends IPhynixxConnection>
public boolean isClosed()
public void start(Xid xid, int flags) throws XAException
situation : XAResource is associtaed with XID(1) flags=TMNOFLAGS with XID(1) result : XAResource creates a new transactional context
situation : XAResource is associtaed with XID(1) flags=TMJOIN/TNRESUME with XID(1) (may be different in branch) result : XAResource joins the transactional context with the XAResource already associated with XID(1) If TMRESUME is specified, start is to resume a suspended transaction branch specified in xid.
This method starts work on behalf of a transaction branch. If TMJOIN is specified, start is for joining an exisiting transaction branch xid. If neither TMJOIN nor TMRESUME is specified and the transaction branch specified in xid already exists, the resource manager throw the XAException with XAER_DUPID error code. If the XAResource has a current connection and flags ==TMJOIN/TMRESUME, the current connection is substituted by the connection of the existing TX.
start
in interface XAResource
xid
- A global transaction identifier to be associated with the resource.flags
- One of TMNOFLAGS, TMJOIN, or TMRESUME.
XAException
public void commit(Xid xid, boolean onePhase) throws XAException
commit
in interface XAResource
XAException
public int prepare(Xid xid) throws XAException
prepare
in interface XAResource
xid
- A global transaction identifier.
XAException
- An error has occurred.
Possible exception values are:
XA_RB*, XAER_RMERR, XAER_RMFAIL, XAER_NOTA, XAER_INVAL, or XAER_PROTO.public void rollback(Xid xid) throws XAException
rollback
in interface XAResource
XAException
public void end(Xid xid, int flags) throws XAException
the spec doesn't no fix the order of commit/rollback and end and we have to take of both orders. If end comes before rollback/commit, the transactional branch has to be freeze. If rollback/commit comes before end, the transactional branch has to be closed
If TMSUCCESS is specified, the portion of work has completed successfully. end is called in Transaction.delistResource
end
in interface XAResource
xid
- A global transaction identifier.flags
- If true, the resource manager should use a one-phase commit protocol
to commit the work done on behalf of xid.
XAException
public void forget(Xid xid) throws XAException
forget
in interface XAResource
xid
-
XAException
public int getTransactionTimeout() throws XAException
getTransactionTimeout
in interface XAResource
XAException
public boolean isSameRM(XAResource xaResource) throws XAException
isSameRM
in interface XAResource
xaResource
- An XAResource object.
XAException
public void close()
public Xid[] recover(int flags) throws XAException
recover
in interface XAResource
XAException
public boolean setTransactionTimeout(int seconds) throws XAException
setTransactionTimeout
in interface XAResource
seconds
- An positive integer specifying the timout value in seconds.
Zero resets the transaction timeout value to the default one used
by the resource manager. A negative value results in XAExceptio to be thrown
with XAER_INVAL error code.
XAException
- An error has occurred. Possible exception values are: XAER_RMERR, XAER_RMFAIL, or XAER_INVAL.public final boolean equals(Object obj)
equals
in class Object
public final int hashCode()
hashCode
in class Object
public Object getId()
public String toString()
toString
in class Object
public void addXAResourceListener(IPhynixxXAResourceListener listener)
public void removeXAResourceListener(IPhynixxXAResourceListener<C> listener)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |