Class BasicXARecovery

java.lang.Object
com.arjuna.ats.internal.jdbc.recovery.BasicXARecovery
All Implemented Interfaces:
XAResourceRecovery

public class BasicXARecovery extends Object implements XAResourceRecovery
This class implements the XAResourceRecovery interface for XAResources. The parameter supplied in setParameters can contain arbitrary information necessary to initialise the class once created. In this instance it contains the name of the property file in which the db connection information is specified, as well as the number of connections that this file contains information on (separated by ;). IMPORTANT: this is only an *example* of the sorts of things an XAResourceRecovery implementor could do. This implementation uses a property file which is assumed to contain sufficient information to recreate connections used during the normal run of an application so that we can perform recovery on them. It is not recommended that information such as user name and password appear in such a raw text format as it opens up a potential security hole. The db parameters specified in the property file are assumed to be in the format: username password" DynamicClass theURL where X is the number of the connection information, starting from 1. The DynamicClass is optional. If not present, JNDI will be used for resolving the DatabaseURL value into a XADataSource.
Since:
JTS 2.1.
  • Constructor Details

  • Method Details

    • initialise

      public boolean initialise(String parameter) throws SQLException
      The recovery module will have chopped off this class name already. The parameter should specify a property file from which the url, user name, password, etc. can be read.
      Specified by:
      initialise in interface XAResourceRecovery
      Parameters:
      parameter - An arbitrary string from which initialization data is obtained.
      Returns:
      true if initialization happened successfully, false otherwise.
      Throws:
      SQLException
    • getXAResource

      public XAResource getXAResource() throws SQLException
      Description copied from interface: XAResourceRecovery
      Get a resource to use for recovery purposes.
      Specified by:
      getXAResource in interface XAResourceRecovery
      Returns:
      a new XAResource.
      Throws:
      SQLException
    • hasMoreResources

      public boolean hasMoreResources()
      Description copied from interface: XAResourceRecovery
      Iterate through all of the resources this instance provides access to.
      Specified by:
      hasMoreResources in interface XAResourceRecovery
      Returns:
      true if this instance can provide more resources, false otherwise.