com.sun.enterprise.transaction.spi
Interface JavaEETransactionManagerDelegate


@Contract
public interface JavaEETransactionManagerDelegate


Method Summary
 void acquireWriteLock()
          Allows the delegate to acquire a write lock.
 void commitDistributedTransaction()
          Commit distributed transaction if there is any.
 boolean enlistDistributedNonXAResource(Transaction tran, TransactionalResource h)
          Perform implementation specific steps to enlist a non-XA resource with a distribute transaction.
 boolean enlistLAOResource(Transaction tran, TransactionalResource h)
          Perform implementation specific steps to enlist resource as a LAO.
 JavaEETransaction getJavaEETransaction(Transaction t)
          Get local transaction object that corresponds to this transaction instance.
 int getOrder()
          The delegate with the largest order will be used.
 java.util.concurrent.locks.Lock getReadLock()
          Return the delegate specific read lock that implements Lock interface.
 int getStatus()
          Get implementation specific status of the transaction associated with the current thread.
 Transaction getTransaction()
          Get implementation specific transaction object that represents the transaction context of the calling thread.
 TransactionAdminBean getTransactionAdminBean(Transaction t)
          Return TransactionAdminBean with delegate specific implementation details of an active Transaction.
 java.lang.String getTxLogLocation()
          Return location of transaction logs
 XAResourceWrapper getXAResourceWrapper(java.lang.String clName)
          Returns an instance of an XAResourceWrapper if this delegate supports transaction recovery and there is a wrapper available for this class name.
 XATerminator getXATerminator()
          This is used by importing transactions via the Connector contract.
 void handlePropertyUpdate(java.lang.String name, java.lang.Object value)
          Handle configuration change.
 void initRecovery(boolean force)
          Initialize recovery framework.
 boolean isNullTransaction()
          Return the delegate specific implementation when a "null transaction context" was received from the client.
 boolean isWriteLocked()
          Return true if the delegate had its write lock acquired.
 void recover(XAResource[] resourceList)
          Recover an array of XAResource objects for a failed XA transaction.
 boolean recoverIncompleteTx(boolean delegated, java.lang.String logPath, XAResource[] xaresArray)
          Recover the populated array of XAResource if this delegate supports transaction recovery.
 void recreate(Xid xid, long timeout)
          Recreate a transaction based on the Xid.
 void registerRecoveryResourceHandler(XAResource xaResource)
          Allows an arbitrary XAResource to register for recovery
 void release(Xid xid)
          Release a transaction.
 void releaseWriteLock()
          Allows the delegate to release a write lock.
 void removeTransaction(Transaction tx)
          Remove the Transaction object from the cache.
 void resume(Transaction tx)
          Perform implementation specific steps to resume a Transaction.
 void rollbackDistributedTransaction()
          Rollback distributed transaction if there is any.
 void setRollbackOnlyDistributedTransaction()
          Perform implementation specific steps to set setRollbackOnly status for distributed transaction if there is any.
 void setTransactionManager(JavaEETransactionManager tm)
          Set the JavaEETransactionManager reference.
 void setUseLAO(boolean b)
          Reset LAO value.
 TransactionInternal startJTSTx(JavaEETransaction t, boolean isAssociatedTimeout)
          Start new JTS transaction for the existing local transaction object.
 boolean supportsXAResource()
          Returns true if this delegate supports XA resources.
 Transaction suspend(JavaEETransaction tx)
          Perform implementation specific steps to suspend a JavaEETransaction.
 boolean useLAO()
          Returns true if this implementation supports last agent optimization.
 

Method Detail

useLAO

boolean useLAO()
Returns true if this implementation supports last agent optimization.


setUseLAO

void setUseLAO(boolean b)
Reset LAO value.

Parameters:
b - the boolean value for the LAO flag.

commitDistributedTransaction

void commitDistributedTransaction()
                                  throws RollbackException,
                                         HeuristicMixedException,
                                         HeuristicRollbackException,
                                         java.lang.SecurityException,
                                         java.lang.IllegalStateException,
                                         SystemException
Commit distributed transaction if there is any.

Throws:
RollbackException
HeuristicMixedException
HeuristicRollbackException
java.lang.SecurityException
java.lang.IllegalStateException
SystemException

rollbackDistributedTransaction

void rollbackDistributedTransaction()
                                    throws java.lang.IllegalStateException,
                                           java.lang.SecurityException,
                                           SystemException
Rollback distributed transaction if there is any.

Throws:
java.lang.IllegalStateException
java.lang.SecurityException
SystemException

getStatus

int getStatus()
              throws SystemException
Get implementation specific status of the transaction associated with the current thread.

Returns:
the status value as an int.
Throws:
SystemException

getTransaction

Transaction getTransaction()
                           throws SystemException
Get implementation specific transaction object that represents the transaction context of the calling thread.

Returns:
the transaction object.
Throws:
SystemException

getJavaEETransaction

JavaEETransaction getJavaEETransaction(Transaction t)
Get local transaction object that corresponds to this transaction instance.

Returns:
the transaction object.

enlistDistributedNonXAResource

boolean enlistDistributedNonXAResource(Transaction tran,
                                       TransactionalResource h)
                                       throws RollbackException,
                                              java.lang.IllegalStateException,
                                              SystemException
Perform implementation specific steps to enlist a non-XA resource with a distribute transaction.

Parameters:
tran - the Transaction object to be used to enlist the resource.
h - the TransactionalResource object to be enlisted.
Returns:
true if the resource was enlisted successfully.
Throws:
RollbackException
java.lang.IllegalStateException
SystemException

enlistLAOResource

boolean enlistLAOResource(Transaction tran,
                          TransactionalResource h)
                          throws RollbackException,
                                 java.lang.IllegalStateException,
                                 SystemException
Perform implementation specific steps to enlist resource as a LAO.

Parameters:
tran - the Transaction object to be used to enlist the resource.
h - the TransactionalResource object to be enlisted.
Returns:
true if the resource was enlisted successfully.
Throws:
RollbackException
java.lang.IllegalStateException
SystemException

setRollbackOnlyDistributedTransaction

void setRollbackOnlyDistributedTransaction()
                                           throws java.lang.IllegalStateException,
                                                  SystemException
Perform implementation specific steps to set setRollbackOnly status for distributed transaction if there is any.

Throws:
java.lang.IllegalStateException
SystemException

suspend

Transaction suspend(JavaEETransaction tx)
                    throws SystemException
Perform implementation specific steps to suspend a JavaEETransaction.

Parameters:
tx - the JavaEETransaction object to be suspend.
Returns:
Transaction object representing the suspended transaction.
Throws:
SystemException

resume

void resume(Transaction tx)
            throws InvalidTransactionException,
                   java.lang.IllegalStateException,
                   SystemException
Perform implementation specific steps to resume a Transaction.

Parameters:
tx - the Transaction object that represents the transaction to be resumed.
Throws:
InvalidTransactionException
java.lang.IllegalStateException
SystemException

removeTransaction

void removeTransaction(Transaction tx)
Remove the Transaction object from the cache.

Parameters:
tx - the Transaction object to be removed.

getOrder

int getOrder()
The delegate with the largest order will be used.

Returns:
the order in which this delegate should be used.

setTransactionManager

void setTransactionManager(JavaEETransactionManager tm)
Set the JavaEETransactionManager reference.

Parameters:
tm - the JavaEETransactionManager object.

supportsXAResource

boolean supportsXAResource()
Returns true if this delegate supports XA resources.


startJTSTx

TransactionInternal startJTSTx(JavaEETransaction t,
                               boolean isAssociatedTimeout)
                               throws RollbackException,
                                      java.lang.IllegalStateException,
                                      SystemException
Start new JTS transaction for the existing local transaction object.

Parameters:
t - the JavaEETransaction object.
isAssociatedTimeout - true if transaction has a timeout associated with it.
Returns:
the new JTS Transaction instance.
Throws:
RollbackException
java.lang.IllegalStateException
SystemException

recover

void recover(XAResource[] resourceList)
Recover an array of XAResource objects for a failed XA transaction.

Parameters:
resourceList - the array of XAResource objects to recover.
Throws:
java.lang.UnsupportedOperationException - if a delegate doesn't support this functionality.

initRecovery

void initRecovery(boolean force)
Initialize recovery framework. Is a no-op if a delegate doesn't support this functionality.


getXATerminator

XATerminator getXATerminator()
This is used by importing transactions via the Connector contract. Should not be called

Returns:
a XATerminator instance.
Throws:
java.lang.UnsupportedOperationException - if a delegate doesn't support this functionality.

release

void release(Xid xid)
             throws WorkException
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.

Parameters:
xid - the Xid object representing a transaction.
Throws:
java.lang.UnsupportedOperationException - if a delegate doesn't support this functionality.
WorkException

recreate

void recreate(Xid xid,
              long timeout)
              throws WorkException
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.

Parameters:
xid - the Xid object representing a transaction.
timeout - the timeout for the transaction to be recreated.
Throws:
java.lang.UnsupportedOperationException - if a delegate doesn't support this functionality.
WorkException

getXAResourceWrapper

XAResourceWrapper getXAResourceWrapper(java.lang.String clName)
Returns an instance of an XAResourceWrapper if this delegate supports transaction recovery and there is a wrapper available for this class name. Returns null otherwise.

Returns:
an instance of an XAResourceWrapper or null if this delegate doesn't support transaction recovery or a wrapper is not available.

handlePropertyUpdate

void handlePropertyUpdate(java.lang.String name,
                          java.lang.Object value)
Handle configuration change.

Parameters:
name - the name of the configuration property.
value - the ne value of the configuration.

recoverIncompleteTx

boolean recoverIncompleteTx(boolean delegated,
                            java.lang.String logPath,
                            XAResource[] xaresArray)
                            throws java.lang.Exception
Recover the populated array of XAResource if this delegate supports transaction recovery.

Parameters:
delegated - true if the recovery process is owned by this instance.
logPath - the name of the transaction logging directory
xaresArray - the array of XA Resources to be recovered.
Returns:
true if the recovery has been successful.
Throws:
java.lang.Exception

getReadLock

java.util.concurrent.locks.Lock getReadLock()
Return the delegate specific read lock that implements Lock interface.


isWriteLocked

boolean isWriteLocked()
Return true if the delegate had its write lock acquired.


acquireWriteLock

void acquireWriteLock()
Allows the delegate to acquire a write lock.


releaseWriteLock

void releaseWriteLock()
Allows the delegate to release a write lock.


isNullTransaction

boolean isNullTransaction()
Return the delegate specific implementation when a "null transaction context" was received from the client. See EJB2.0 spec section 19.6.2.1. A null tx context has no Coordinator objref. It indicates that the client had an active tx but the client container did not support tx interop.


getTransactionAdminBean

TransactionAdminBean getTransactionAdminBean(Transaction t)
                                             throws SystemException
Return TransactionAdminBean with delegate specific implementation details of an active Transaction.

Throws:
SystemException

getTxLogLocation

java.lang.String getTxLogLocation()
Return location of transaction logs

Returns:
String location of transaction logs

registerRecoveryResourceHandler

void registerRecoveryResourceHandler(XAResource xaResource)
Allows an arbitrary XAResource to register for recovery

Parameters:
xaResource - XAResource to register for recovery


Copyright © 2012 GlassFish Community. All Rights Reserved.