@Service public class JavaEETransactionManagerJTSDelegate extends Object implements JavaEETransactionManagerDelegate, org.glassfish.hk2.api.PostConstruct
Constructor and Description |
---|
JavaEETransactionManagerJTSDelegate() |
Modifier and Type | Method and Description |
---|---|
void |
acquireWriteLock()
Allows the delegate to acquire a write lock.
|
void |
beginJTS(int timeout) |
void |
commitDistributedTransaction()
An XA transaction commit
|
boolean |
enlistDistributedNonXAResource(Transaction tx,
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.
|
static JavaEETransactionManagerJTSDelegate |
getInstance() |
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 t)
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.
|
void |
initTransactionProperties() |
void |
initXA() |
boolean |
isNullTransaction()
Return true if a "null transaction context" was received
from the client.
|
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()
An XA transaction rollback
|
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 tran,
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 void postConstruct()
postConstruct
in interface org.glassfish.hk2.api.PostConstruct
public boolean useLAO()
JavaEETransactionManagerDelegate
true
if this implementation supports
last agent optimization.useLAO
in interface JavaEETransactionManagerDelegate
public void setUseLAO(boolean b)
JavaEETransactionManagerDelegate
setUseLAO
in interface JavaEETransactionManagerDelegate
b
- 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 JavaEETransactionManagerDelegate
IllegalStateException
SecurityException
SystemException
public int getStatus() throws SystemException
JavaEETransactionManagerDelegate
getStatus
in interface JavaEETransactionManagerDelegate
SystemException
public Transaction getTransaction() throws SystemException
JavaEETransactionManagerDelegate
getTransaction
in interface JavaEETransactionManagerDelegate
SystemException
public JavaEETransaction getJavaEETransaction(Transaction t)
JavaEETransactionManagerDelegate
getJavaEETransaction
in interface JavaEETransactionManagerDelegate
public boolean enlistDistributedNonXAResource(Transaction tx, TransactionalResource h) throws RollbackException, IllegalStateException, SystemException
JavaEETransactionManagerDelegate
enlistDistributedNonXAResource
in interface JavaEETransactionManagerDelegate
tx
- the Transaction object to be used to enlist the resource.h
- the TransactionalResource object to be enlisted.true
if the resource was enlisted successfully.RollbackException
IllegalStateException
SystemException
public boolean enlistLAOResource(Transaction tran, TransactionalResource h) throws RollbackException, IllegalStateException, SystemException
JavaEETransactionManagerDelegate
enlistLAOResource
in interface JavaEETransactionManagerDelegate
tran
- the Transaction object to be used to enlist the resource.h
- the TransactionalResource object to be enlisted.true
if the resource was enlisted successfully.RollbackException
IllegalStateException
SystemException
public void setRollbackOnlyDistributedTransaction() throws IllegalStateException, SystemException
JavaEETransactionManagerDelegate
setRollbackOnlyDistributedTransaction
in interface JavaEETransactionManagerDelegate
IllegalStateException
SystemException
public Transaction suspend(JavaEETransaction tx) throws SystemException
JavaEETransactionManagerDelegate
suspend
in interface JavaEETransactionManagerDelegate
tx
- the JavaEETransaction object to be suspend.SystemException
public void resume(Transaction tx) throws InvalidTransactionException, IllegalStateException, SystemException
JavaEETransactionManagerDelegate
resume
in interface JavaEETransactionManagerDelegate
tx
- the Transaction object that represents the transaction to be resumed.InvalidTransactionException
IllegalStateException
SystemException
public void removeTransaction(Transaction tx)
JavaEETransactionManagerDelegate
removeTransaction
in interface JavaEETransactionManagerDelegate
tx
- the Transaction object to be removed.public int getOrder()
JavaEETransactionManagerDelegate
getOrder
in interface JavaEETransactionManagerDelegate
public void setTransactionManager(JavaEETransactionManager tm)
JavaEETransactionManagerDelegate
setTransactionManager
in interface JavaEETransactionManagerDelegate
tm
- the JavaEETransactionManager object.public TransactionInternal startJTSTx(JavaEETransaction tran, boolean isAssociatedTimeout) throws RollbackException, IllegalStateException, SystemException
JavaEETransactionManagerDelegate
startJTSTx
in interface JavaEETransactionManagerDelegate
tran
- the JavaEETransaction object.isAssociatedTimeout
- true
if transaction has a timeout
associated with it.RollbackException
IllegalStateException
SystemException
public void initRecovery(boolean force)
JavaEETransactionManagerDelegate
initRecovery
in interface JavaEETransactionManagerDelegate
public void recover(XAResource[] resourceList)
JavaEETransactionManagerDelegate
recover
in interface JavaEETransactionManagerDelegate
resourceList
- the array of XAResource objects to recover.public void release(Xid xid) throws javax.resource.spi.work.WorkException
JavaEETransactionManagerDelegate
This is used by importing transactions via the Connector contract.
release
in interface JavaEETransactionManagerDelegate
xid
- the Xid object representing a transaction.javax.resource.spi.work.WorkException
public void recreate(Xid xid, long timeout) throws javax.resource.spi.work.WorkException
JavaEETransactionManagerDelegate
This is used by importing transactions via the Connector contract.
recreate
in interface JavaEETransactionManagerDelegate
xid
- the Xid object representing a transaction.timeout
- the timeout for the transaction to be recreated.javax.resource.spi.work.WorkException
public javax.resource.spi.XATerminator getXATerminator()
JavaEETransactionManagerDelegate
getXATerminator
in interface JavaEETransactionManagerDelegate
XATerminator
instance.public XAResourceWrapper getXAResourceWrapper(String clName)
JavaEETransactionManagerDelegate
null
otherwise.getXAResourceWrapper
in interface JavaEETransactionManagerDelegate
null
if this
delegate doesn't support transaction recovery or a wrapper is not available.public void handlePropertyUpdate(String name, Object value)
JavaEETransactionManagerDelegate
handlePropertyUpdate
in interface JavaEETransactionManagerDelegate
name
- the name of the configuration property.value
- the ne value of the configuration.public boolean recoverIncompleteTx(boolean delegated, String logPath, XAResource[] xaresArray) throws Exception
JavaEETransactionManagerDelegate
recoverIncompleteTx
in interface JavaEETransactionManagerDelegate
delegated
- 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.Exception
public void beginJTS(int timeout) throws NotSupportedException, SystemException
NotSupportedException
SystemException
public boolean supportsXAResource()
JavaEETransactionManagerDelegate
true> if this delegate supports XA resources.
supportsXAResource
in interface JavaEETransactionManagerDelegate
public void initTransactionProperties()
public boolean isNullTransaction()
isNullTransaction
in interface JavaEETransactionManagerDelegate
public TransactionAdminBean getTransactionAdminBean(Transaction t) throws SystemException
JavaEETransactionManagerDelegate
getTransactionAdminBean
in interface JavaEETransactionManagerDelegate
SystemException
public String getTxLogLocation()
getTxLogLocation
in interface JavaEETransactionManagerDelegate
public void registerRecoveryResourceHandler(XAResource xaResource)
registerRecoveryResourceHandler
in interface JavaEETransactionManagerDelegate
xaResource
- XAResource to register for recoverypublic Lock getReadLock()
JavaEETransactionManagerDelegate
getReadLock
in interface JavaEETransactionManagerDelegate
public void acquireWriteLock()
JavaEETransactionManagerDelegate
acquireWriteLock
in interface JavaEETransactionManagerDelegate
public void releaseWriteLock()
JavaEETransactionManagerDelegate
releaseWriteLock
in interface JavaEETransactionManagerDelegate
public boolean isWriteLocked()
JavaEETransactionManagerDelegate
true
if the delegate had its write lock acquired.isWriteLocked
in interface JavaEETransactionManagerDelegate
public static JavaEETransactionManagerJTSDelegate getInstance()
public void initXA()
Copyright © 2020. All rights reserved.