@Service public class JavaEETransactionManagerSimplifiedDelegate extends Object implements JavaEETransactionManagerDelegate, org.glassfish.hk2.api.PostConstruct
| Constructor and Description |
|---|
JavaEETransactionManagerSimplifiedDelegate() |
| Modifier and Type | Method and Description |
|---|---|
void |
acquireWriteLock()
Allows the delegate to acquire a write lock.
|
void |
commitDistributedTransaction()
Throws an exception if called as it means that there is
no active local transaction to commit.
|
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.
|
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 tran)
Return TransactionAdminBean with delegate specific implementation details
of an active Transaction.
|
String |
getTxLogLocation()
Return location of transaction logs
|
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.
|
javax.resource.spi.XATerminator |
getXATerminator()
This is used by importing transactions via the Connector contract.
|
void |
handlePropertyUpdate(String name,
Object value)
Handle configuration change.
|
void |
initRecovery(boolean force)
Initialize recovery framework.
|
boolean |
isNullTransaction()
Return false as this delegate doesn't support tx interop.
|
boolean |
isWriteLocked()
Return
true if the delegate had its write lock acquired. |
void |
postConstruct() |
void |
recover(XAResource[] resourceList)
Recover an array of XAResource objects for a failed XA transaction.
|
boolean |
recoverIncompleteTx(boolean delegated,
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()
Throws an exception if called as it means that there is
no active local transaction to rollback.
|
void |
setRollbackOnlyDistributedTransaction()
Throws an exception if called as it means that there is
no active local transaction.
|
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. |
public JavaEETransactionManagerSimplifiedDelegate()
public void postConstruct()
postConstruct in interface org.glassfish.hk2.api.PostConstructpublic boolean useLAO()
JavaEETransactionManagerDelegatetrue if this implementation supports
last agent optimization.useLAO in interface JavaEETransactionManagerDelegatepublic void setUseLAO(boolean b)
JavaEETransactionManagerDelegatesetUseLAO in interface JavaEETransactionManagerDelegateb - the boolean value for the LAO flag.public void commitDistributedTransaction()
throws RollbackException,
HeuristicMixedException,
HeuristicRollbackException,
SecurityException,
IllegalStateException,
SystemException
public void rollbackDistributedTransaction()
throws IllegalStateException,
SecurityException,
SystemException
rollbackDistributedTransaction in interface JavaEETransactionManagerDelegateIllegalStateExceptionSecurityExceptionSystemExceptionpublic int getStatus()
throws SystemException
JavaEETransactionManagerDelegategetStatus in interface JavaEETransactionManagerDelegateSystemExceptionpublic Transaction getTransaction() throws SystemException
JavaEETransactionManagerDelegategetTransaction in interface JavaEETransactionManagerDelegateSystemExceptionpublic JavaEETransaction getJavaEETransaction(Transaction t)
JavaEETransactionManagerDelegategetJavaEETransaction in interface JavaEETransactionManagerDelegatepublic boolean enlistDistributedNonXAResource(Transaction tran, TransactionalResource h) throws RollbackException, IllegalStateException, SystemException
JavaEETransactionManagerDelegateenlistDistributedNonXAResource in interface JavaEETransactionManagerDelegatetran - the Transaction object to be used to enlist the resource.h - the TransactionalResource object to be enlisted.true if the resource was enlisted successfully.RollbackExceptionIllegalStateExceptionSystemExceptionpublic boolean enlistLAOResource(Transaction tran, TransactionalResource h) throws RollbackException, IllegalStateException, SystemException
JavaEETransactionManagerDelegateenlistLAOResource in interface JavaEETransactionManagerDelegatetran - the Transaction object to be used to enlist the resource.h - the TransactionalResource object to be enlisted.true if the resource was enlisted successfully.RollbackExceptionIllegalStateExceptionSystemExceptionpublic void setRollbackOnlyDistributedTransaction()
throws IllegalStateException,
SystemException
setRollbackOnlyDistributedTransaction in interface JavaEETransactionManagerDelegateIllegalStateExceptionSystemExceptionpublic Transaction suspend(JavaEETransaction tx) throws SystemException
JavaEETransactionManagerDelegatesuspend in interface JavaEETransactionManagerDelegatetx - the JavaEETransaction object to be suspend.SystemExceptionpublic void resume(Transaction tx) throws InvalidTransactionException, IllegalStateException, SystemException
JavaEETransactionManagerDelegateresume in interface JavaEETransactionManagerDelegatetx - the Transaction object that represents the transaction to be resumed.InvalidTransactionExceptionIllegalStateExceptionSystemExceptionpublic void removeTransaction(Transaction tx)
JavaEETransactionManagerDelegateremoveTransaction in interface JavaEETransactionManagerDelegatetx - the Transaction object to be removed.public int getOrder()
JavaEETransactionManagerDelegategetOrder in interface JavaEETransactionManagerDelegatepublic void setTransactionManager(JavaEETransactionManager tm)
JavaEETransactionManagerDelegatesetTransactionManager in interface JavaEETransactionManagerDelegatetm - the JavaEETransactionManager object.public TransactionInternal startJTSTx(JavaEETransaction t, boolean isAssociatedTimeout) throws RollbackException, IllegalStateException, SystemException
JavaEETransactionManagerDelegatestartJTSTx in interface JavaEETransactionManagerDelegatet - the JavaEETransaction object.isAssociatedTimeout - true if transaction has a timeout
associated with it.RollbackExceptionIllegalStateExceptionSystemExceptionpublic boolean supportsXAResource()
JavaEETransactionManagerDelegatetrue> if this delegate supports XA resources.supportsXAResource in interface JavaEETransactionManagerDelegatepublic void initRecovery(boolean force)
JavaEETransactionManagerDelegateinitRecovery in interface JavaEETransactionManagerDelegatepublic void recover(XAResource[] resourceList)
JavaEETransactionManagerDelegaterecover in interface JavaEETransactionManagerDelegateresourceList - the array of XAResource objects to recover.public javax.resource.spi.XATerminator getXATerminator()
JavaEETransactionManagerDelegategetXATerminator in interface JavaEETransactionManagerDelegateXATerminator instance.public void release(Xid xid) throws javax.resource.spi.work.WorkException
JavaEETransactionManagerDelegateThis is used by importing transactions via the Connector contract.
release in interface JavaEETransactionManagerDelegatexid - the Xid object representing a transaction.javax.resource.spi.work.WorkExceptionpublic void recreate(Xid xid, long timeout) throws javax.resource.spi.work.WorkException
JavaEETransactionManagerDelegateThis is used by importing transactions via the Connector contract.
recreate in interface JavaEETransactionManagerDelegatexid - the Xid object representing a transaction.timeout - the timeout for the transaction to be recreated.javax.resource.spi.work.WorkExceptionpublic boolean recoverIncompleteTx(boolean delegated,
String logPath,
XAResource[] xaresArray)
throws Exception
JavaEETransactionManagerDelegaterecoverIncompleteTx in interface JavaEETransactionManagerDelegatedelegated - true if the recovery process is owned by this instance.logPath - the name of the transaction logging directoryxaresArray - the array of XA Resources to be recovered.Exceptionpublic XAResourceWrapper getXAResourceWrapper(String clName)
JavaEETransactionManagerDelegatenull otherwise.getXAResourceWrapper in interface JavaEETransactionManagerDelegatenull if this
delegate doesn't support transaction recovery or a wrapper is not available.public void handlePropertyUpdate(String name, Object value)
JavaEETransactionManagerDelegatehandlePropertyUpdate in interface JavaEETransactionManagerDelegatename - the name of the configuration property.value - the ne value of the configuration.public Lock getReadLock()
JavaEETransactionManagerDelegategetReadLock in interface JavaEETransactionManagerDelegatepublic boolean isWriteLocked()
JavaEETransactionManagerDelegatetrue if the delegate had its write lock acquired.isWriteLocked in interface JavaEETransactionManagerDelegatepublic void acquireWriteLock()
JavaEETransactionManagerDelegateacquireWriteLock in interface JavaEETransactionManagerDelegatepublic void releaseWriteLock()
JavaEETransactionManagerDelegatereleaseWriteLock in interface JavaEETransactionManagerDelegatepublic boolean isNullTransaction()
isNullTransaction in interface JavaEETransactionManagerDelegatepublic TransactionAdminBean getTransactionAdminBean(Transaction tran) throws SystemException
JavaEETransactionManagerDelegategetTransactionAdminBean in interface JavaEETransactionManagerDelegateSystemExceptionpublic String getTxLogLocation()
getTxLogLocation in interface JavaEETransactionManagerDelegatepublic void registerRecoveryResourceHandler(XAResource xaResource)
registerRecoveryResourceHandler in interface JavaEETransactionManagerDelegatexaResource - XAResource to register for recoveryCopyright © 2017. All rights reserved.