javax.slee.transaction
Interface SleeTransactionManager

All Superinterfaces:
javax.transaction.TransactionManager

public interface SleeTransactionManager
extends javax.transaction.TransactionManager

The SleeTransactionManager interface extends the JTA TransactionManager interface by providing asynchronous commit and rollback operations.

Since:
SLEE 1.1

Method Summary
 SleeTransaction asSleeTransaction(javax.transaction.Transaction tx)
          Get a SleeTransaction object for a generic Transaction object.
 void asyncCommit(CommitListener listener)
          Request that the transaction associated with the current thread asynchronously commit.
 void asyncRollback(RollbackListener listener)
          Request that the transaction associated with the current thread asynchronously roll back.
 SleeTransaction beginSleeTransaction()
          Begin a new transaction and associate it with the current thread.
 SleeTransaction getSleeTransaction()
          Get the SleeTransaction object that represents the transaction context of the calling thread.
 
Methods inherited from interface javax.transaction.TransactionManager
begin, commit, getStatus, getTransaction, resume, rollback, setRollbackOnly, setTransactionTimeout, suspend
 

Method Detail

beginSleeTransaction

SleeTransaction beginSleeTransaction()
                                     throws javax.transaction.NotSupportedException,
                                            javax.transaction.SystemException
Begin a new transaction and associate it with the current thread. This method is equivalent to:

This method is a non-transactional method, however after this method returns a new transaction has become associated with the calling thread.

Returns:
a SleeTransaction object representing the new transaction.
Throws:
javax.transaction.NotSupportedException - if the thread is already associated with a transaction and the transaction manager implementation does not support nested transactions.
javax.transaction.SystemException - if the transaction could not be started due to a system-level failure.

getSleeTransaction

SleeTransaction getSleeTransaction()
                                   throws javax.transaction.SystemException
Get the SleeTransaction object that represents the transaction context of the calling thread. This method is a convenience method equivalent to:

This method is a non-transactional method.

Returns:
the SleeTransaction object that represents the transaction context of the calling thread, or null if the thread is not currently associated with a transaction.
Throws:
javax.transaction.SystemException - if the transaction object could not be obtained due to a system-level failure.

asSleeTransaction

SleeTransaction asSleeTransaction(javax.transaction.Transaction tx)
                                  throws java.lang.NullPointerException,
                                         java.lang.IllegalArgumentException,
                                         javax.transaction.SystemException
Get a SleeTransaction object for a generic Transaction object.

Parameters:
tx - the Transaction object. The transaction represented by this object must have been started by this transaction manager.
Returns:
a SleeTransaction object for the specified transaction.
Throws:
java.lang.NullPointerException - if tx is null.
java.lang.IllegalArgumentException - if tx represents a transaction that was not started by this transaction manager.
javax.transaction.SystemException - if the transaction object could not be obtained due to a system-level failure.

asyncCommit

void asyncCommit(CommitListener listener)
                 throws java.lang.IllegalStateException,
                        java.lang.SecurityException
Request that the transaction associated with the current thread asynchronously commit. This method initiates the commit operation and may return before the transaction completes, however the association between the transaction and the thread is cleared before returning.

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.

This method is a mandatory transactional method.

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 a transaction is not currently associated with the calling thread.
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 associated with the current thread asynchronously roll back. This method initiates the rollback operation and may return before the transaction completes, however the association between the transaction and the thread is cleared before returning.

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

This method is a mandatory transactional method.

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 a transaction is not currently associated with the calling thread.
java.lang.SecurityException - if the current thread is not allowed to roll back the transaction.


Copyright © 2009. All Rights Reserved.