public abstract class XATransactionalResource extends java.lang.Object implements TransactionalResource
| Modifier and Type | Field and Description |
|---|---|
protected javax.transaction.xa.XAResource |
xares_ |
| Constructor and Description |
|---|
XATransactionalResource(java.lang.String uniqueResourceName)
Construct a new instance with a default XidFactory.
|
XATransactionalResource(java.lang.String uniqueResourceName,
XidFactory factory)
Construct a new instance with a custom XidFactory.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
The default close operation.
|
protected XID |
createXid(java.lang.String tid)
Create an XID for the given tx.
|
boolean |
equals(java.lang.Object o) |
java.lang.String |
getName() |
ResourceTransaction |
getResourceTransaction(CompositeTransaction ct) |
javax.transaction.xa.XAResource |
getXAResource()
Get the XAResource instance that this instance is using.
|
XidFactory |
getXidFactory()
Get the xidFactory for this instance.
|
int |
hashCode() |
boolean |
hasMoreToRecover() |
boolean |
isClosed()
Test if the resource is closed.
|
boolean |
isSameRM(RecoverableResource res) |
protected boolean |
needsRefresh()
Check if the XAResource needs to be refreshed.
|
boolean |
recover(long startOfRecoveryScan,
java.util.Collection<PendingTransactionRecord> expiredCommittingCoordinators,
java.util.Collection<PendingTransactionRecord> indoubtForeignCoordinatorsToKeep) |
protected abstract javax.transaction.xa.XAResource |
refreshXAConnection()
Utility method to establish and refresh the XAResource.
|
void |
setRecoveryService(RecoveryService recoveryService) |
void |
setXidFactory(XidFactory factory)
Set the XID factory, needed for online management tools.
|
boolean |
usesXAResource(javax.transaction.xa.XAResource xares)
Test if the XAResource is used by this instance.
|
public XATransactionalResource(java.lang.String uniqueResourceName)
public XATransactionalResource(java.lang.String uniqueResourceName,
XidFactory factory)
protected abstract javax.transaction.xa.XAResource refreshXAConnection()
throws ResourceException
ResourceException - On failure.public XidFactory getXidFactory()
protected boolean needsRefresh()
public boolean usesXAResource(javax.transaction.xa.XAResource xares)
xares - The XAResource to test.public javax.transaction.xa.XAResource getXAResource()
public ResourceTransaction getResourceTransaction(CompositeTransaction ct) throws ResourceException, java.lang.IllegalStateException
getResourceTransaction in interface TransactionalResourceResourceExceptionjava.lang.IllegalStateExceptionTransactionalResourcepublic java.lang.String getName()
getName in interface RecoverableResourceTransactionalResourcepublic void close()
throws ResourceException
close in interface RecoverableResourceResourceExceptionpublic boolean isClosed()
throws ResourceException
isClosed in interface RecoverableResourceResourceExceptionpublic boolean isSameRM(RecoverableResource res) throws ResourceException
isSameRM in interface RecoverableResourceResourceExceptionRecoverableResourcepublic void setRecoveryService(RecoveryService recoveryService) throws ResourceException
setRecoveryService in interface RecoverableResourceResourceExceptionRecoverableResourcepublic void setXidFactory(XidFactory factory)
factory - protected XID createXid(java.lang.String tid)
tid - The tx id.public boolean recover(long startOfRecoveryScan,
java.util.Collection<PendingTransactionRecord> expiredCommittingCoordinators,
java.util.Collection<PendingTransactionRecord> indoubtForeignCoordinatorsToKeep)
recover in interface RecoverableResourcepublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean hasMoreToRecover()
hasMoreToRecover in interface RecoverableResourceCopyright © 2020. All Rights Reserved.