com.atomikos.datasource.xa.jca
Class JcaTransactionalResource

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

public class JcaTransactionalResource
extends XATransactionalResource

A TransactionalResource that works with the JCA architecture.


Field Summary
 
Fields inherited from class com.atomikos.datasource.xa.XATransactionalResource
recoveryMap_, servername_, siblingmappers_, xares_, xidFact_
 
Constructor Summary
JcaTransactionalResource(String servername, javax.resource.spi.ManagedConnectionFactory mcf)
           
JcaTransactionalResource(String servername, javax.resource.spi.ManagedConnectionFactory mcf, XidFactory xidFactory)
           
 
Method Summary
 void close()
          Overrides default close to include closing any open connections to the source.
protected  XAResource refreshXAConnection()
          Utility method to establish and refresh the XAResource.
 boolean usesXAResource(XAResource xares)
          Test if the XAResource is used by this instance.
 
Methods inherited from class com.atomikos.datasource.xa.XATransactionalResource
acceptsAllXAResources, createXid, endRecovery, getName, getResourceTransaction, getXAResource, getXidFactory, isClosed, isSameRM, needsRefresh, printMsg, recover, recover, setAcceptAllXAResources, setRecoveryService, setXidFactory, usesWeakCompare, useWeakCompare
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JcaTransactionalResource

public JcaTransactionalResource(String servername,
                                javax.resource.spi.ManagedConnectionFactory mcf)

JcaTransactionalResource

public JcaTransactionalResource(String servername,
                                javax.resource.spi.ManagedConnectionFactory mcf,
                                XidFactory xidFactory)
Method Detail

usesXAResource

public boolean usesXAResource(XAResource xares)
Description copied from class: XATransactionalResource
Test if the XAResource is used by this instance.

Overrides:
usesXAResource in class XATransactionalResource
Parameters:
xares - The XAResource to test.
Returns:
boolean True iff this instance uses the same back-end resource, in as far as this can be determined by this instance.

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.

close

public void close()
           throws ResourceException
Overrides default close to include closing any open connections to the source.

Specified by:
close in interface RecoverableResource
Overrides:
close in class XATransactionalResource
Throws:
ResourceException


Copyright © 2011. All Rights Reserved.