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

All Known Implementing Classes:
AbstractTransactionalResource

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.
 javax.transaction.xa.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

public void commit()
            throws javax.transaction.xa.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:
javax.transaction.xa.XAException - when anything goes wrong the error must be described in XA notation

prepare

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

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

rollback

public void rollback()
              throws javax.transaction.xa.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:
javax.transaction.xa.XAException - when anything goes wrong the error must be described in XA notation

begin

public void begin()
           throws javax.transaction.xa.XAException
Throws:
javax.transaction.xa.XAException

suspend

public void suspend()
             throws javax.transaction.xa.XAException
Throws:
javax.transaction.xa.XAException

resume

public void resume()
            throws javax.transaction.xa.XAException
Throws:
javax.transaction.xa.XAException

getStatus

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

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

setStatus

public 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

public javax.transaction.xa.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-2007 The Apache Software Foundation. All Rights Reserved.