public interface SleeTransaction
SleeTransaction
interface extends the JTA Transaction
interface by providing asynchronous commit and rollback operations.Modifier and Type | Method and Description |
---|---|
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(XAResource resource,
int flag)
This method, defined by the JTA
Transaction interface, has no defined
behavior in SLEE 1.1. |
boolean |
enlistResource(XAResource resource)
This method, defined by the JTA
Transaction interface, has no defined
behavior in SLEE 1.1. |
boolean |
equals(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.
|
String |
toString()
Get a string representation for the transaction represented by this
SleeTransaction object. |
void asyncCommit(CommitListener listener) throws IllegalStateException, SecurityException
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
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
.
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.IllegalStateException
- if the transaction is not in the active or marked for
rollback state.SecurityException
- if the current thread is not allowed to commit the transaction.void asyncRollback(RollbackListener listener) throws IllegalStateException, SecurityException
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
.
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.IllegalStateException
- if the transactions is not in the active or marked for
rollback state.SecurityException
- if the current thread is not allowed to roll back the transaction.boolean enlistResource(XAResource resource) throws IllegalStateException, RollbackException
Transaction
interface, has no defined
behavior in SLEE 1.1.IllegalStateException
RollbackException
boolean delistResource(XAResource resource, int flag) throws IllegalStateException, SystemException
Transaction
interface, has no defined
behavior in SLEE 1.1.IllegalStateException
SystemException
boolean equals(Object obj)
equals
in class Object
obj
- the object to compare this with.true
if obj
is a SleeTransaction
object
that represents the same transaction as this, false
otherwise.Object.equals(Object)
int hashCode()
SleeTransaction
objects t1
and t2
must
return the same hash code if t1.equals(t2)
.hashCode
in class Object
Object.hashCode()
String toString()
SleeTransaction
object. For any two SleeTransaction
objects t1
and t2
:
t1
and t2
represent the same transaction,
ie. t1.equals(t2)
, then t1.toString().equals(t2.toString())
must hold true.
t1
and t2
represent different transactions,
then !t1.toString().equals(t2.toString())
must hold true.
toString
in class Object
Object.toString()