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 servername)
Construct a new instance with a default XidFactory.
|
XATransactionalResource(java.lang.String servername,
XidFactory factory)
Construct a new instance with a custom XidFactory.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
acceptsAllXAResources() |
void |
close()
The default close operation.
|
protected XID |
createXid(java.lang.String tid)
Create an XID for the given tx.
|
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.
|
boolean |
isClosed()
Test if the resource is closed.
|
boolean |
isSameRM(RecoverableResource res) |
protected boolean |
needsRefresh()
Check if the XAResource needs to be refreshed.
|
void |
recover() |
protected abstract javax.transaction.xa.XAResource |
refreshXAConnection()
Utility method to establish and refresh the XAResource.
|
void |
setAcceptAllXAResources(boolean val)
Specify whether to entirely shortcut the isSameRM method of the
XAResource implementations, and always return true for usesXAResource.
|
void |
setRecoveryService(RecoveryService recoveryService) |
void |
setXidFactory(XidFactory factory)
Set the XID factory, needed for online management tools.
|
boolean |
usesWeakCompare()
Test if this instance uses weak compare mode.
|
boolean |
usesXAResource(javax.transaction.xa.XAResource xares)
Test if the XAResource is used by this instance.
|
void |
useWeakCompare(boolean weakCompare)
Set this instance to use the weak compare mode setting.
|
public XATransactionalResource(java.lang.String servername)
servername - The servername, needed to identify the xid instances for the
current configuration. Max BYTE length is 64!public XATransactionalResource(java.lang.String servername,
XidFactory factory)
servername - The servername, needed to identify the xid instances for the
current configuration. Max BYTE length is 64!factory - The custom XidFactory.protected abstract javax.transaction.xa.XAResource refreshXAConnection()
throws ResourceException
ResourceException - On failure.public XidFactory getXidFactory()
protected boolean needsRefresh()
public void useWeakCompare(boolean weakCompare)
java.lang.IllegalStateException - If recovery was already done, meaning that the transaction
service is already running.public boolean usesWeakCompare()
public void setAcceptAllXAResources(boolean val)
val - public boolean acceptsAllXAResources()
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 void recover()
recover in interface RecoverableResourceCopyright © 2018. All Rights Reserved.