Joram ${version}

org.objectweb.joram.client.jms
Class XAResource

java.lang.Object
  extended byorg.objectweb.joram.client.jms.XAResource
All Implemented Interfaces:
javax.transaction.xa.XAResource

public class XAResource
extends java.lang.Object
implements javax.transaction.xa.XAResource

A XAResource instance is used by a XASession instance as a delegate to a Transaction Manager.


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
XAResource(XAResourceMngr rm, Session sess)
          Constructs an XA resource representing a given session.
 
Method Summary
 void commit(javax.transaction.xa.Xid xid, boolean onePhase)
          Commits the resource.
 void end(javax.transaction.xa.Xid xid, int flag)
          Delists this resource.
 void forget(javax.transaction.xa.Xid xid)
          Not implemented as transactions are not heuristically completed.
 int getTransactionTimeout()
          Returns 0 as timeout feaure is not supported.
 boolean isSameRM(javax.transaction.xa.XAResource o)
          Checks wether this resource shares the same resource manager (XAConnection) with an other resource.
 int prepare(javax.transaction.xa.Xid xid)
          Prepares the resource.
 javax.transaction.xa.Xid[] recover(int flag)
          Recovers the prepared transactions identifiers.
 void rollback(javax.transaction.xa.Xid xid)
          Rolls the resource back.
 boolean setTransactionTimeout(int seconds)
          Returns false as timeout feaure is not supported.
 void start(javax.transaction.xa.Xid xid, int flag)
          Enlists this resource in a given transaction.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XAResource

public XAResource(XAResourceMngr rm,
                  Session sess)
Constructs an XA resource representing a given session.

Method Detail

start

public void start(javax.transaction.xa.Xid xid,
                  int flag)
           throws javax.transaction.xa.XAException
Enlists this resource in a given transaction.

Specified by:
start in interface javax.transaction.xa.XAResource
Throws:
javax.transaction.xa.XAException - If the resource is already enlisted in a transaction, or if the RM fails to enlist the resource.

end

public void end(javax.transaction.xa.Xid xid,
                int flag)
         throws javax.transaction.xa.XAException
Delists this resource.

Specified by:
end in interface javax.transaction.xa.XAResource
Throws:
javax.transaction.xa.XAException - If the resource is not enlisted in the specified transaction, or if the RM fails to delist the resource.

prepare

public int prepare(javax.transaction.xa.Xid xid)
            throws javax.transaction.xa.XAException
Prepares the resource.

Specified by:
prepare in interface javax.transaction.xa.XAResource
Throws:
javax.transaction.xa.XAException - If the RM fails to prepare the resource.

commit

public void commit(javax.transaction.xa.Xid xid,
                   boolean onePhase)
            throws javax.transaction.xa.XAException
Commits the resource.

Specified by:
commit in interface javax.transaction.xa.XAResource
Throws:
javax.transaction.xa.XAException - If the RM fails to commit the resource.

rollback

public void rollback(javax.transaction.xa.Xid xid)
              throws javax.transaction.xa.XAException
Rolls the resource back.

Specified by:
rollback in interface javax.transaction.xa.XAResource
Throws:
javax.transaction.xa.XAException - If the RM fails to roll the resource back.

recover

public javax.transaction.xa.Xid[] recover(int flag)
                                   throws javax.transaction.xa.XAException
Recovers the prepared transactions identifiers.

Specified by:
recover in interface javax.transaction.xa.XAResource
Throws:
javax.transaction.xa.XAException - If the RM fails to recover.

forget

public void forget(javax.transaction.xa.Xid xid)
            throws javax.transaction.xa.XAException
Not implemented as transactions are not heuristically completed.

Specified by:
forget in interface javax.transaction.xa.XAResource
Throws:
javax.transaction.xa.XAException - Always thrown.

setTransactionTimeout

public boolean setTransactionTimeout(int seconds)
                              throws javax.transaction.xa.XAException
Returns false as timeout feaure is not supported.

Specified by:
setTransactionTimeout in interface javax.transaction.xa.XAResource
Throws:
javax.transaction.xa.XAException - Never thrown.

getTransactionTimeout

public int getTransactionTimeout()
                          throws javax.transaction.xa.XAException
Returns 0 as timeout feaure is not supported.

Specified by:
getTransactionTimeout in interface javax.transaction.xa.XAResource
Throws:
javax.transaction.xa.XAException - Never thrown.

isSameRM

public boolean isSameRM(javax.transaction.xa.XAResource o)
                 throws javax.transaction.xa.XAException
Checks wether this resource shares the same resource manager (XAConnection) with an other resource.

Specified by:
isSameRM in interface javax.transaction.xa.XAResource
Throws:
javax.transaction.xa.XAException - Never thrown.

Joram ${version}

Copyright ? 2005 Scalagent - All rights reserved