com.atomikos.datasource.xa
Class TemporaryXATransactionalResource

java.lang.Object
  extended by com.atomikos.datasource.xa.XATransactionalResource
      extended by com.atomikos.datasource.xa.TemporaryXATransactionalResource
All Implemented Interfaces:
RecoverableResource, TransactionalResource

public class TemporaryXATransactionalResource
extends XATransactionalResource

A class for temporary resources. This is useful for configurations that don't register any XATransactionalResources in advance (zero setup). These cases require a dynamic and temporary XATransactionalResource to be added. This resource will be closed with the connection it is created on, and therefore is temporary.


Field Summary
 
Fields inherited from class com.atomikos.datasource.xa.XATransactionalResource
recoveryMap_, servername_, siblingmappers_, xares_, xidFact_
 
Constructor Summary
TemporaryXATransactionalResource(XAResource xares)
           
 
Method Summary
 boolean isClosed()
          Test if the resource is closed.
protected  XAResource refreshXAConnection()
          Utility method to establish and refresh the XAResource.
 
Methods inherited from class com.atomikos.datasource.xa.XATransactionalResource
acceptsAllXAResources, close, createXid, endRecovery, getName, getResourceTransaction, getXAResource, getXidFactory, isSameRM, needsRefresh, printMsg, recover, recover, setAcceptAllXAResources, setRecoveryService, setXidFactory, usesWeakCompare, usesXAResource, useWeakCompare
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TemporaryXATransactionalResource

public TemporaryXATransactionalResource(XAResource xares)
Method Detail

refreshXAConnection

protected XAResource refreshXAConnection()
                                  throws ResourceException
Description copied from class: XATransactionalResource
Utility method to establish and refresh the XAResource. An XAResource is actually a connection to a back-end resource, and this connection needs to stay open for the transactional resource instance. The resource uses the XAResource regularly, but sometimes the back-end server can close the connection after a time-out. At intialization time and also after such a time-out, this method is called to refresh the XAResource instance. This is typically done by (re-)establishing a connection to the server and keeping this connection open!.

Specified by:
refreshXAConnection in class XATransactionalResource
Returns:
XAResource A XAResource instance that will be used to represent the server.
Throws:
ResourceException - On failure.
See Also:
XATransactionalResource.refreshXAConnection()

isClosed

public boolean isClosed()
Description copied from class: XATransactionalResource
Test if the resource is closed.

Specified by:
isClosed in interface RecoverableResource
Overrides:
isClosed in class XATransactionalResource
Returns:
boolean True if closed.


Copyright © 2011. All Rights Reserved.