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

com.atomikos.datasource.xa

## Class AcceptAllXATransactionalResource

- java.lang.Object
- - com.atomikos.datasource.xa.XATransactionalResource
  - - com.atomikos.datasource.xa.AcceptAllXATransactionalResource

- All Implemented Interfaces:
    RecoverableResource, TransactionalResource

      public class AcceptAllXATransactionalResource
      extends XATransactionalResource

  This class is useful only for enlist via the JTA API. In particular, this class is a 'workaround' for buggy XAResource implementations where isSameRM returns false even if it should not. With the default automatic resource registration mode, this situation would lead to another XATransactionalResource being added to the configuration for each such enlist. As an alternative, this class pretends to recognize any XAResource and can be used to avoid problems when automatic registration is disabled: instead of reporting errors claiming that the XAResource is unknown for faulty isSameRM cases, this class will silently accept them.

- - ### Field Summary

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

      `xares_`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AcceptAllXATransactionalResource(java.lang.String servername)`
    `AcceptAllXATransactionalResource(java.lang.String servername, XidFactory factory)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `endRecovery()`
    `protected void` | `recoverTheDeprecatedWay()`
    `protected javax.transaction.xa.XAResource` | `refreshXAConnection()` Utility method to establish and refresh the XAResource.
    `boolean` | `usesXAResource(javax.transaction.xa.XAResource res)` Always returns true.

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

      `acceptsAllXAResources, close, createXid, getName, getResourceTransaction, getXAResource, getXidFactory, isClosed, isSameRM, needsRefresh, 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

    - #### AcceptAllXATransactionalResource

          public AcceptAllXATransactionalResource(java.lang.String servername)

      Parameters:
        `servername` -

    - #### AcceptAllXATransactionalResource

          public AcceptAllXATransactionalResource(java.lang.String servername,
                                          XidFactory factory)

      Parameters:
        `servername` -
        `factory` -

  - ### 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()`

    - #### usesXAResource

          public boolean usesXAResource(javax.transaction.xa.XAResource res)

      Always returns true.
      Overrides:
        `usesXAResource` in class `XATransactionalResource`
      Parameters:
        `res` - 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.

    - #### recoverTheDeprecatedWay

          protected void recoverTheDeprecatedWay()

    - #### endRecovery

          public void endRecovery()

Copyright © 2018. All Rights Reserved.