|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atomikos.datasource.xa.XATransactionalResource
public abstract class XATransactionalResource
An abstract XA implementation of a transactional resource. For a particular XA data source, it is necessary to implement the refreshXAConnection method, because in general there is no standard way of getting XAResource instances. Therefore, this class is agnostic about it.
| Field Summary | |
|---|---|
protected Hashtable |
recoveryMap_
|
protected String |
servername_
|
protected Hashtable |
siblingmappers_
|
protected XAResource |
xares_
|
protected XidFactory |
xidFact_
|
| Constructor Summary | |
|---|---|
XATransactionalResource(String servername)
Construct a new instance with a default XidFactory. |
|
XATransactionalResource(String servername,
XidFactory factory)
Construct a new instance with a custom XidFactory. |
|
| Method Summary | |
|---|---|
boolean |
acceptsAllXAResources()
|
void |
close()
The default close operation. |
protected Xid |
createXid(String tid)
Create an XID for the given tx. |
void |
endRecovery()
|
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. |
boolean |
isClosed()
Test if the resource is closed. |
boolean |
isSameRM(RecoverableResource res)
|
protected boolean |
needsRefresh()
Check if the XAResource needs to be refreshed. |
protected void |
printMsg(String msg,
int level)
|
protected void |
recover()
Recover the contained XAResource, and retrieve the xid instances that start with our server's name. |
boolean |
recover(Participant participant)
|
protected abstract 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(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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected XAResource xares_
protected String servername_
protected Hashtable recoveryMap_
protected Hashtable siblingmappers_
protected XidFactory xidFact_
| Constructor Detail |
|---|
public XATransactionalResource(String servername)
servername - The servername, needed to identify the xid instances for the
current configuration. Max BYTE length is 64!
public XATransactionalResource(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.| Method Detail |
|---|
protected abstract XAResource refreshXAConnection()
throws ResourceException
ResourceException - On failure.public XidFactory getXidFactory()
protected void printMsg(String msg,
int level)
protected boolean needsRefresh()
public void useWeakCompare(boolean weakCompare)
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(XAResource xares)
xares - The XAResource to test.
public XAResource getXAResource()
public ResourceTransaction getResourceTransaction(CompositeTransaction ct)
throws ResourceException,
IllegalStateException
getResourceTransaction in interface TransactionalResourceResourceException
IllegalStateExceptionTransactionalResourcepublic String getName()
getName in interface RecoverableResourceTransactionalResource
public void close()
throws ResourceException
close in interface RecoverableResourceResourceException
public boolean isClosed()
throws ResourceException
isClosed in interface RecoverableResourceResourceException
public boolean isSameRM(RecoverableResource res)
throws ResourceException
isSameRM in interface RecoverableResourceResourceExceptionRecoverableResource
public void setRecoveryService(RecoveryService recoveryService)
throws ResourceException
setRecoveryService in interface RecoverableResourceResourceExceptionRecoverableResource
public boolean recover(Participant participant)
throws ResourceException
recover in interface RecoverableResourceResourceExceptionTransactionalResource
protected void recover()
throws ResourceException
ResourceException - If a failure occurs.
public void endRecovery()
throws ResourceException
endRecovery in interface RecoverableResourceResourceExceptionTransactionalResource.public void setXidFactory(XidFactory factory)
factory - protected Xid createXid(String tid)
tid - The tx id.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||