javax.transaction.xa
Interface XAResource

All Known Subinterfaces:
ManagedXAResource
All Known Implementing Classes:
DisjointXAResource, HessianXAResource, JmsSession, QueueSessionImpl, SpyXAResource, TopicSessionImpl, XAResourceWrapper

public interface XAResource

The interface for a transaction resource.


Field Summary
static int TMENDRSCAN
           
static int TMFAIL
           
static int TMJOIN
           
static int TMNOFLAGS
           
static int TMONEPHASE
           
static int TMRESUME
           
static int TMSTARTRSCAN
           
static int TMSUCCESS
           
static int TMSUSPEND
           
static int XA_OK
           
static int XA_RDONLY
           
 
Method Summary
 void commit(Xid xid, boolean onePhase)
          Called to commit.
 void end(Xid xid, int flags)
          Called when the resource is is done with a transaction.
 void forget(Xid xid)
          Called to forget an Xid that had a heuristic commit.
 int getTransactionTimeout()
          Gets the transaction timeout in seconds.
 boolean isSameRM(XAResource xa)
          Returns true if the specified resource has the same RM.
 int prepare(Xid xid)
          Called to start the first phase of the commit.
 Xid[] recover(int flag)
          Called to find Xid's that need recovery.
 void rollback(Xid xid)
          Called to roll back.
 boolean setTransactionTimeout(int timeout)
          Sets the transaction timeout in seconds.
 void start(Xid xid, int flags)
          Called when the resource is associated with a transaction.
 

Field Detail

TMENDRSCAN

static final int TMENDRSCAN
See Also:
Constant Field Values

TMFAIL

static final int TMFAIL
See Also:
Constant Field Values

TMJOIN

static final int TMJOIN
See Also:
Constant Field Values

TMNOFLAGS

static final int TMNOFLAGS
See Also:
Constant Field Values

TMONEPHASE

static final int TMONEPHASE
See Also:
Constant Field Values

TMRESUME

static final int TMRESUME
See Also:
Constant Field Values

TMSTARTRSCAN

static final int TMSTARTRSCAN
See Also:
Constant Field Values

TMSUCCESS

static final int TMSUCCESS
See Also:
Constant Field Values

TMSUSPEND

static final int TMSUSPEND
See Also:
Constant Field Values

XA_OK

static final int XA_OK
See Also:
Constant Field Values

XA_RDONLY

static final int XA_RDONLY
See Also:
Constant Field Values
Method Detail

isSameRM

boolean isSameRM(XAResource xa)
                 throws XAException
Returns true if the specified resource has the same RM.

Throws:
XAException

setTransactionTimeout

boolean setTransactionTimeout(int timeout)
                              throws XAException
Sets the transaction timeout in seconds.

Throws:
XAException

getTransactionTimeout

int getTransactionTimeout()
                          throws XAException
Gets the transaction timeout in seconds.

Throws:
XAException

start

void start(Xid xid,
           int flags)
           throws XAException
Called when the resource is associated with a transaction.

Throws:
XAException

end

void end(Xid xid,
         int flags)
         throws XAException
Called when the resource is is done with a transaction.

Throws:
XAException

prepare

int prepare(Xid xid)
            throws XAException
Called to start the first phase of the commit.

Throws:
XAException

commit

void commit(Xid xid,
            boolean onePhase)
            throws XAException
Called to commit.

Throws:
XAException

rollback

void rollback(Xid xid)
              throws XAException
Called to roll back.

Throws:
XAException

forget

void forget(Xid xid)
            throws XAException
Called to forget an Xid that had a heuristic commit.

Throws:
XAException

recover

Xid[] recover(int flag)
              throws XAException
Called to find Xid's that need recovery.

Throws:
XAException