FileDocCategorySizeDatePackage
J2EETransactionManager.javaAPI DocGlassfish v2 API10132Fri May 04 22:33:14 BST 2007com.sun.enterprise

J2EETransactionManager

public interface J2EETransactionManager implements TransactionManager
Manages transacations, acting as a gateway to the TM state machine.
author
Tony Ng

Fields Summary
Constructors Summary
Methods Summary
public voidbegin(int timeout)

public voidcheckTransactionExport(boolean isLocal)
Perform checks during export of a transaction on a remote call.

public voidcheckTransactionImport()
Perform checks during import of a transaction on a remote call. This is called from the reply interceptors after a remote call completes.

public voidcleanTxnTimeout()

public voidcomponentDestroyed(java.lang.Object instance)
This is called by Container to indicate that a component is being destroyed. All resources registered in the context should be released

param
instance The component instance

public voiddelistComponentResources(boolean suspend)
This is called by the Container to ask the Transaction Manager to delist all resources held by a component The TM finds the component through the InvocationManager

param
suspend true if the resources should be delisted with TMSUSPEND flag; false otherwise

public booleandelistResource(javax.transaction.Transaction tran, com.sun.enterprise.resource.ResourceHandle h, int flag)
Delist the resource specified from the transaction

param
tran The transaction object
param
h The resource handle object
param
flag One of the values of TMSUCCESS, TMSUSPEND, or TMFAIL.
exception
IllegalStateException Thrown if the transaction in the target object is inactive.
exception
SystemException Thrown if the transaction manager encounters an unexpected error condition

public voidejbDestroyed(ComponentContext context)

public voidenlistComponentResources()
This is called by the Container to ask the Transaction Manager to enlist all resources held by a component and to associate the current Transaction with the current Invocation The TM finds the component through the InvocationManager

public booleanenlistResource(javax.transaction.Transaction tran, com.sun.enterprise.resource.ResourceHandle h)
Enlist the resource specified with the transaction

param
tran The transaction object
param
h The resource handle object
return
true if the resource was enlisted successfully; otherwise * false.
exception
RollbackException Thrown to indicate that the transaction has been marked for rollback only.
exception
IllegalStateException Thrown if the transaction in the target object is in prepared state or the transaction is inactive.
exception
SystemException Thrown if the transaction manager encounters an unexpected error condition

public voidforceRollback(javax.transaction.Transaction tran)

public voidfreeze()

public java.util.ArrayListgetActiveTransactions()

public java.util.ListgetExistingResourceList(java.lang.Object instance, ComponentInvocation inv)
Returns a list of resource handles held by the component

public intgetNumberOfActiveTransactions()

public intgetNumberOfTransactionsCommitted()

public intgetNumberOfTransactionsRolledBack()

public javax.resource.spi.XATerminatorgetXATerminator()
Provides a handle to a XATerminator instance. The XATerminator instance could be used by a resource adapter to flow-in transaction completion and crash recovery calls from an EIS.

This is used by importing transactions via the Connector contract.

return
a XATerminator instance.

public booleanisFrozen()

public booleanisNullTransaction()
Return true if a "null transaction context" was received from the client or if the server's transaction.interoperability flag is false. A null tx context indicates that the client had an active tx but the client container did not support tx interop. See EJB2.0 spec section 18.5.2.1.

public booleanisTimedOut()
Utility for the ejb container to check if the transaction is marked for rollback because of timeout. This is applicable only for local transactions as jts transaction will rollback instead of setting the txn for rollback

public voidpostInvoke(ComponentInvocation curr, ComponentInvocation prev)
Called by InvocationManager

public voidpreInvoke(ComponentInvocation prev)
Called by InvocationManager

public voidrecover(javax.transaction.xa.XAResource[] resourceList)

public voidrecreate(javax.transaction.xa.Xid xid, long timeout)
recreate a transaction based on the Xid. This call causes the calling thread to be associated with the specified transaction.

This is used by importing transactions via the Connector contract.

param
xid the Xid object representing a transaction.

public voidregisterComponentResource(com.sun.enterprise.resource.ResourceHandle h)

public voidregisterSynchronization(javax.transaction.Synchronization sync)
register a synchronization object with the transaction associated with the current thread

param
sync the synchronization object
exception
IllegalStateException Thrown if the transaction in the target object is in prepared state or the transaction is inactive.
exception
SystemException Thrown if the transaction manager encounters an unexpected error condition

public voidrelease(javax.transaction.xa.Xid xid)
Release a transaction. This call causes the calling thread to be dissociated from the specified transaction.

This is used by importing transactions via the Connector contract.

param
xid the Xid object representing a transaction.

public voidsetDefaultTransactionTimeout(int seconds)

public voidsetMonitoringEnabled(boolean enabled)

public voidunfreeze()

public voidunregisterComponentResource(com.sun.enterprise.resource.ResourceHandle h)