org.apache.commons.transaction.util.xa
Interface TransactionalResource

All Known Implementing Classes:
AbstractTransactionalResource, MapXAResource.MapTransactionalResource

public interface TransactionalResource

Interface for something that makes up a transactional resource.


Method Summary
 void begin()
           
 void commit()
          Commits the changes done inside this transaction reasource.
 int getStatus()
          Returns the current status of this transaction resource.
 Xid getXid()
          Returns the Xid this transctional resource is associated with.
 int prepare()
          Prepares the changes done inside this transaction reasource.
 void resume()
           
 void rollback()
          Rolls back the changes done inside this transaction reasource.
 void setStatus(int status)
          Sets the status of this transctional resource.
 void suspend()
           
 

Method Detail

commit

void commit()
            throws XAException
Commits the changes done inside this transaction reasource. This can mean to call commit on a connection associated to the resource or any other action that needs to be taken to make changes in this resource permanent.

Throws:
XAException - when anything goes wrong the error must be described in XA notation

prepare

int prepare()
            throws XAException
Prepares the changes done inside this transaction reasource. Same semantics as XAResource.prepare(Xid).

Throws:
XAException - when anything goes wrong the error must be described in XA notation

rollback

void rollback()
              throws XAException
Rolls back the changes done inside this transaction reasource. This can mean to call roll back on a connection associated to the resource or any other action that needs to be taken to undo the changes in this resource permanent.

Throws:
XAException - when anything goes wrong the error must be described in XA notation

begin

void begin()
           throws XAException
Throws:
XAException

suspend

void suspend()
             throws XAException
Throws:
XAException

resume

void resume()
            throws XAException
Throws:
XAException

getStatus

int getStatus()
Returns the current status of this transaction resource.

Returns:
the current status of this resource as defined by Status.

setStatus

void setStatus(int status)
Sets the status of this transctional resource. The status set by this method must be available over getStatus() afterwards.

Parameters:
status - the status to be set

getXid

Xid getXid()
Returns the Xid this transctional resource is associated with. This might have been set in the constructor of implementing classes.

Returns:
the xid this transctional resource is associated with


Copyright ? 2004 The Apache Software Foundation. All Rights Reserved.