TemporaryXATransactionalResource (Transactions JTA 4.0.6 API)
Date: 2018-01-11

com.atomikos.datasource.xa

## Class TemporaryXATransactionalResource

- java.lang.Object
- - com.atomikos.datasource.xa.XATransactionalResource
  - - 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

      `xares_`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TemporaryXATransactionalResource(javax.transaction.xa.XAResource xares)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `isClosed()` Test if the resource is closed.
    `protected javax.transaction.xa.XAResource` | `refreshXAConnection()` Utility method to establish and refresh the XAResource.

    - ### Methods inherited from class com.atomikos.datasource.xa.XATransactionalResource

      `acceptsAllXAResources, close, createXid, getName, getResourceTransaction, getXAResource, getXidFactory, isSameRM, needsRefresh, 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(javax.transaction.xa.XAResource xares)

  - ### Method Detail

    - #### refreshXAConnection

          protected javax.transaction.xa.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 © 2018. All Rights Reserved.