Interface JavaEETransactionManagerDelegate
-
- All Known Implementing Classes:
JavaEETransactionManagerJTSDelegate,JavaEETransactionManagerSimplifiedDelegate
@Contract public interface JavaEETransactionManagerDelegate
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidacquireWriteLock()Allows the delegate to acquire a write lock.voidcommitDistributedTransaction()Commit distributed transaction if there is any.booleanenlistDistributedNonXAResource(jakarta.transaction.Transaction tran, TransactionalResource h)Perform implementation specific steps to enlist a non-XA resource with a distribute transaction.booleanenlistLAOResource(jakarta.transaction.Transaction tran, TransactionalResource h)Perform implementation specific steps to enlist resource as a LAO.JavaEETransactiongetJavaEETransaction(jakarta.transaction.Transaction t)Get local transaction object that corresponds to this transaction instance.intgetOrder()The delegate with the largest order will be used.LockgetReadLock()Return the delegate specific read lock that implements Lock interface.intgetStatus()Get implementation specific status of the transaction associated with the current thread.jakarta.transaction.TransactiongetTransaction()Get implementation specific transaction object that represents the transaction context of the calling thread.TransactionAdminBeangetTransactionAdminBean(jakarta.transaction.Transaction t)Return TransactionAdminBean with delegate specific implementation details of an active Transaction.StringgetTxLogLocation()Return location of transaction logsXAResourceWrappergetXAResourceWrapper(String clName)Returns an instance of an XAResourceWrapper if this delegate supports transaction recovery and there is a wrapper available for this class name.jakarta.resource.spi.XATerminatorgetXATerminator()This is used by importing transactions via the Connector contract.voidhandlePropertyUpdate(String name, Object value)Handle configuration change.voidinitRecovery(boolean force)Initialize recovery framework.booleanisNullTransaction()Return the delegate specific implementation when a "null transaction context" was received from the client.booleanisWriteLocked()Returntrueif the delegate had its write lock acquired.voidrecover(XAResource[] resourceList)Recover an array of XAResource objects for a failed XA transaction.booleanrecoverIncompleteTx(boolean delegated, String logPath, XAResource[] xaresArray)Recover the populated array of XAResource if this delegate supports transaction recovery.voidrecreate(Xid xid, long timeout)Recreate a transaction based on the Xid.voidregisterRecoveryResourceHandler(XAResource xaResource)Allows an arbitrary XAResource to register for recoveryvoidrelease(Xid xid)Release a transaction.voidreleaseWriteLock()Allows the delegate to release a write lock.voidremoveTransaction(jakarta.transaction.Transaction tx)Remove the Transaction object from the cache.voidresume(jakarta.transaction.Transaction tx)Perform implementation specific steps to resume a Transaction.voidrollbackDistributedTransaction()Rollback distributed transaction if there is any.voidsetRollbackOnlyDistributedTransaction()Perform implementation specific steps to set setRollbackOnly status for distributed transaction if there is any.voidsetTransactionManager(JavaEETransactionManager tm)Set the JavaEETransactionManager reference.voidsetUseLAO(boolean b)Reset LAO value.TransactionInternalstartJTSTx(JavaEETransaction t, boolean isAssociatedTimeout)Start new JTS transaction for the existing local transaction object.booleansupportsXAResource()Returnstrue> if this delegate supports XA resources.jakarta.transaction.Transactionsuspend(JavaEETransaction tx)Perform implementation specific steps to suspend a JavaEETransaction.booleanuseLAO()Returnstrueif this implementation supports last agent optimization.
-
-
-
Method Detail
-
useLAO
boolean useLAO()
Returnstrueif 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 jakarta.transaction.RollbackException, jakarta.transaction.HeuristicMixedException, jakarta.transaction.HeuristicRollbackException, SecurityException, IllegalStateException, jakarta.transaction.SystemExceptionCommit distributed transaction if there is any.- Throws:
jakarta.transaction.RollbackExceptionjakarta.transaction.HeuristicMixedExceptionjakarta.transaction.HeuristicRollbackExceptionSecurityExceptionIllegalStateExceptionjakarta.transaction.SystemException
-
rollbackDistributedTransaction
void rollbackDistributedTransaction() throws IllegalStateException, SecurityException, jakarta.transaction.SystemExceptionRollback distributed transaction if there is any.- Throws:
IllegalStateExceptionSecurityExceptionjakarta.transaction.SystemException
-
getStatus
int getStatus() throws jakarta.transaction.SystemExceptionGet implementation specific status of the transaction associated with the current thread.- Returns:
- the status value as an int.
- Throws:
jakarta.transaction.SystemException
-
getTransaction
jakarta.transaction.Transaction getTransaction() throws jakarta.transaction.SystemExceptionGet implementation specific transaction object that represents the transaction context of the calling thread.- Returns:
- the transaction object.
- Throws:
jakarta.transaction.SystemException
-
getJavaEETransaction
JavaEETransaction getJavaEETransaction(jakarta.transaction.Transaction t)
Get local transaction object that corresponds to this transaction instance.- Returns:
- the transaction object.
-
enlistDistributedNonXAResource
boolean enlistDistributedNonXAResource(jakarta.transaction.Transaction tran, TransactionalResource h) throws jakarta.transaction.RollbackException, IllegalStateException, jakarta.transaction.SystemExceptionPerform 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:
trueif the resource was enlisted successfully.- Throws:
jakarta.transaction.RollbackExceptionIllegalStateExceptionjakarta.transaction.SystemException
-
enlistLAOResource
boolean enlistLAOResource(jakarta.transaction.Transaction tran, TransactionalResource h) throws jakarta.transaction.RollbackException, IllegalStateException, jakarta.transaction.SystemExceptionPerform 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:
trueif the resource was enlisted successfully.- Throws:
jakarta.transaction.RollbackExceptionIllegalStateExceptionjakarta.transaction.SystemException
-
setRollbackOnlyDistributedTransaction
void setRollbackOnlyDistributedTransaction() throws IllegalStateException, jakarta.transaction.SystemExceptionPerform implementation specific steps to set setRollbackOnly status for distributed transaction if there is any.- Throws:
IllegalStateExceptionjakarta.transaction.SystemException
-
suspend
jakarta.transaction.Transaction suspend(JavaEETransaction tx) throws jakarta.transaction.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:
jakarta.transaction.SystemException
-
resume
void resume(jakarta.transaction.Transaction tx) throws jakarta.transaction.InvalidTransactionException, IllegalStateException, jakarta.transaction.SystemExceptionPerform implementation specific steps to resume a Transaction.- Parameters:
tx- the Transaction object that represents the transaction to be resumed.- Throws:
jakarta.transaction.InvalidTransactionExceptionIllegalStateExceptionjakarta.transaction.SystemException
-
removeTransaction
void removeTransaction(jakarta.transaction.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()
Returnstrue> if this delegate supports XA resources.
-
startJTSTx
TransactionInternal startJTSTx(JavaEETransaction t, boolean isAssociatedTimeout) throws jakarta.transaction.RollbackException, IllegalStateException, jakarta.transaction.SystemException
Start new JTS transaction for the existing local transaction object.- Parameters:
t- the JavaEETransaction object.isAssociatedTimeout-trueif transaction has a timeout associated with it.- Returns:
- the new JTS Transaction instance.
- Throws:
jakarta.transaction.RollbackExceptionIllegalStateExceptionjakarta.transaction.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:
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
jakarta.resource.spi.XATerminator getXATerminator()
This is used by importing transactions via the Connector contract. Should not be called- Returns:
- a
XATerminatorinstance. - Throws:
UnsupportedOperationException- if a delegate doesn't support this functionality.
-
release
void release(Xid xid) throws jakarta.resource.spi.work.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:
UnsupportedOperationException- if a delegate doesn't support this functionality.jakarta.resource.spi.work.WorkException
-
recreate
void recreate(Xid xid, long timeout) throws jakarta.resource.spi.work.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:
UnsupportedOperationException- if a delegate doesn't support this functionality.jakarta.resource.spi.work.WorkException
-
getXAResourceWrapper
XAResourceWrapper getXAResourceWrapper(String clName)
Returns an instance of an XAResourceWrapper if this delegate supports transaction recovery and there is a wrapper available for this class name. Returnsnullotherwise.- Returns:
- an instance of an XAResourceWrapper or
nullif this delegate doesn't support transaction recovery or a wrapper is not available.
-
handlePropertyUpdate
void handlePropertyUpdate(String name, 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, String logPath, XAResource[] xaresArray) throws ExceptionRecover the populated array of XAResource if this delegate supports transaction recovery.- Parameters:
delegated-trueif the recovery process is owned by this instance.logPath- the name of the transaction logging directoryxaresArray- the array of XA Resources to be recovered.- Returns:
- true if the recovery has been successful.
- Throws:
Exception
-
getReadLock
Lock getReadLock()
Return the delegate specific read lock that implements Lock interface.
-
isWriteLocked
boolean isWriteLocked()
Returntrueif 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(jakarta.transaction.Transaction t) throws jakarta.transaction.SystemException
Return TransactionAdminBean with delegate specific implementation details of an active Transaction.- Throws:
jakarta.transaction.SystemException
-
getTxLogLocation
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
-
-