javax.slee.transaction
Interface SleeTransaction

All Superinterfaces:
javax.transaction.Transaction

public interface SleeTransaction
extends javax.transaction.Transaction

The SleeTransaction interface extends the JTA Transaction interface by providing asynchronous commit and rollback operations.

Since:
SLEE 1.1

Method Summary
 void asyncCommit(CommitListener listener)
          Request that the transaction represented by this SleeTransaction object asynchronously commit.
 void asyncRollback(RollbackListener listener)
          Request that the transaction represented by this SleeTransaction object asynchronously roll back.
 boolean delistResource(javax.transaction.xa.XAResource resource, int flag)
          This method, defined by the JTA Transaction interface, has no defined behavior in SLEE 1.1.
 boolean enlistResource(javax.transaction.xa.XAResource resource)
          This method, defined by the JTA Transaction interface, has no defined behavior in SLEE 1.1.
 boolean equals(java.lang.Object obj)
          Compare this SLEE Transaction object for equality with another object.
 int hashCode()
          Get a hash code value for the transaction represented by this SLEE Transaction object.
 java.lang.String toString()
          Get a string representation for the transaction represented by this SleeTransaction object.
 
Methods inherited from interface javax.transaction.Transaction
commit, getStatus, registerSynchronization, rollback, setRollbackOnly
 

Method Detail

asyncCommit

void asyncCommit(CommitListener listener)
                 throws java.lang.IllegalStateException,
                        java.lang.SecurityException
Request that the transaction represented by this SleeTransaction object asynchronously commit. The calling thread is not required to have this transaction associated with the thread. The transaction must be currently active (Status.STATUS_ACTIVE) or marked for rollback (Status.STATUS_MARKED_ROLLBACK). This method initiates the commit operation and may return before the transaction completes. If any threads are associated with the transaction then those associations are cleared before this method returns.

If the transaction has been marked for rollback, or if execution of any Synchronization.beforeCompletion() callbacks cause it to be marked for rollback, then a rollback will be started (equivalent to calling asyncRollback(javax.slee.transaction.RollbackListener)).

At some point after calling this method, the transaction state will become either Status.STATUS_COMMITTED or Status.STATUS_ROLLEDBACK.

Parameters:
listener - listener object that will receive callbacks depending on the final outcome of the transaction. If this argument is null, no callbacks will be made by the SLEE.
Throws:
java.lang.IllegalStateException - if the transaction is not in the active or marked for rollback state.
java.lang.SecurityException - if the current thread is not allowed to commit the transaction.

asyncRollback

void asyncRollback(RollbackListener listener)
                   throws java.lang.IllegalStateException,
                          java.lang.SecurityException
Request that the transaction represented by this SleeTransaction object asynchronously roll back. The calling thread is not required to have this transaction associated with the thread. The transaction must be currently active (Status.STATUS_ACTIVE) or marked for rollback (Status.STATUS_MARKED_ROLLBACK). This method initiates the rollback operation and may return before the transaction completes. If any thread are associated with the transaction then those associations are cleared before this method returns.

At some point after calling this method, the transaction state will become Status.STATUS_ROLLEDBACK.

Parameters:
listener - listener object that will receive callbacks depending on the final outcome of the transaction. If this argument is null, no callbacks will be made by the SLEE.
Throws:
java.lang.IllegalStateException - if the transactions is not in the active or marked for rollback state.
java.lang.SecurityException - if the current thread is not allowed to roll back the transaction.

enlistResource

boolean enlistResource(javax.transaction.xa.XAResource resource)
                       throws java.lang.IllegalStateException,
                              javax.transaction.RollbackException
This method, defined by the JTA Transaction interface, has no defined behavior in SLEE 1.1.

Specified by:
enlistResource in interface javax.transaction.Transaction
Throws:
java.lang.IllegalStateException
javax.transaction.RollbackException

delistResource

boolean delistResource(javax.transaction.xa.XAResource resource,
                       int flag)
                       throws java.lang.IllegalStateException,
                              javax.transaction.SystemException
This method, defined by the JTA Transaction interface, has no defined behavior in SLEE 1.1.

Specified by:
delistResource in interface javax.transaction.Transaction
Throws:
java.lang.IllegalStateException
javax.transaction.SystemException

equals

boolean equals(java.lang.Object obj)
Compare this SLEE Transaction object for equality with another object.

Overrides:
equals in class java.lang.Object
Parameters:
obj - the object to compare this with.
Returns:
true if obj is a SleeTransaction object that represents the same transaction as this, false otherwise.
See Also:
Object.equals(Object)

hashCode

int hashCode()
Get a hash code value for the transaction represented by this SLEE Transaction object. Two SleeTransaction objects t1 and t2 must return the same hash code if t1.equals(t2).

Overrides:
hashCode in class java.lang.Object
Returns:
a hash code value for this SLEE Transaction object.
See Also:
Object.hashCode()

toString

java.lang.String toString()
Get a string representation for the transaction represented by this SleeTransaction object. For any two SleeTransaction objects t1 and t2:

Overrides:
toString in class java.lang.Object
Returns:
a string representation for the transaction.
See Also:
Object.toString()


Copyright © 2008. All Rights Reserved.