public abstract class XATransactionalResource extends Object implements TransactionalResource
Modifier and Type | Field and Description |
---|---|
protected XAResource |
xares_ |
Constructor and Description |
---|
XATransactionalResource(String uniqueResourceName)
Construct a new instance with a default XidFactory.
|
XATransactionalResource(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(String tid)
Create an XID for the given tx.
|
boolean |
equals(Object o) |
String |
getName() |
ResourceTransaction |
getResourceTransaction(CompositeTransaction ct) |
XAResource |
getXAResource()
Get the XAResource instance that this instance is using.
|
XidFactory |
getXidFactory()
Get the xidFactory for this instance.
|
int |
hashCode() |
boolean |
hasPendingParticipantsFromLastRecoveryScan() |
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,
Collection<PendingTransactionRecord> expiredCommittingCoordinators,
Collection<PendingTransactionRecord> indoubtForeignCoordinatorsToKeep) |
protected abstract 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(XAResource xares)
Test if the XAResource is used by this instance.
|
protected XAResource xares_
public XATransactionalResource(String uniqueResourceName)
public XATransactionalResource(String uniqueResourceName, XidFactory factory)
protected abstract XAResource refreshXAConnection() throws ResourceException
ResourceException
- On failure.public XidFactory getXidFactory()
protected boolean needsRefresh()
public boolean usesXAResource(XAResource xares)
xares
- The XAResource to test.public XAResource getXAResource()
public ResourceTransaction getResourceTransaction(CompositeTransaction ct) throws ResourceException, IllegalStateException
getResourceTransaction
in interface TransactionalResource
ResourceException
IllegalStateException
TransactionalResource
public String getName()
getName
in interface RecoverableResource
TransactionalResource
public void close() throws ResourceException
close
in interface RecoverableResource
ResourceException
public boolean isClosed() throws ResourceException
isClosed
in interface RecoverableResource
ResourceException
public boolean isSameRM(RecoverableResource res) throws ResourceException
isSameRM
in interface RecoverableResource
ResourceException
RecoverableResource
public void setRecoveryService(RecoveryService recoveryService) throws ResourceException
setRecoveryService
in interface RecoverableResource
ResourceException
RecoverableResource
public void setXidFactory(XidFactory factory)
factory
- protected XID createXid(String tid)
tid
- The tx id.public boolean recover(long startOfRecoveryScan, Collection<PendingTransactionRecord> expiredCommittingCoordinators, Collection<PendingTransactionRecord> indoubtForeignCoordinatorsToKeep)
recover
in interface RecoverableResource
public boolean hasPendingParticipantsFromLastRecoveryScan()
hasPendingParticipantsFromLastRecoveryScan
in interface RecoverableResource
Copyright © 2023. All rights reserved.