org.rhq.jbossatx.jta.recovery
Class AppServerJDBCXARecovery

java.lang.Object
  extended by org.rhq.jbossatx.jta.recovery.AppServerJDBCXARecovery
All Implemented Interfaces:
com.arjuna.ats.jta.recovery.XAResourceRecovery

public class AppServerJDBCXARecovery
extends Object
implements com.arjuna.ats.jta.recovery.XAResourceRecovery

This is an enhanced version of JBossTM's AppServerJDBCXARecovery implementation. The only thing this implementation does differently is it becomes tolerant of the times when the data source is not yet deployed. This provides recovery for compliant JDBC drivers accessed via datasources deployed in JBossAS 4.2 It is not meant to be db driver specific. This code is based on JDBCXARecovery, which expects JNDI to contain an XADataSource implementation. In JBossAS, the object created in JNDI when a -ds.xml file containing element is used, does not implement the XADataSource interface. We therefore use this modified code to pull the datasource configuration information from the app server's JMX and instantiate an XADataSource from which it can then create an XAConnection. To use this class, add an XAResourceRecovery entry in the jta section of jbossjta-properties.xml for each datasource for which you need recovery, ensuring the value ends with ; i.e. the same value as is in the -ds.xml jndi-name element. You also need the XARecoveryModule enabled and appropriate values for nodeIdentifier and xaRecoveryNode set. See the JBossTS recovery guide if you are unclear on how the recovery system works. Note: This implementation expects to run inside the app server JVM. It probably won't work if you configure the recovery manager to run as a separate process. (JMX can be accessed remotely, but it would need code changes to the lookup function and some classpath additions). ...


Constructor Summary
AppServerJDBCXARecovery()
           
 
Method Summary
 XAResource getXAResource()
           
 boolean hasMoreResources()
           
 boolean initialise(String parameter)
          The recovery module will have chopped off this class name already.
 void retrieveData(String parameter, String delimiter)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AppServerJDBCXARecovery

public AppServerJDBCXARecovery()
                        throws SQLException
Throws:
SQLException
Method Detail

initialise

public boolean initialise(String parameter)
                   throws SQLException
The recovery module will have chopped off this class name already. The parameter should specify a jndi name for the datasource.

Specified by:
initialise in interface com.arjuna.ats.jta.recovery.XAResourceRecovery
Throws:
SQLException

getXAResource

public XAResource getXAResource()
                         throws SQLException
Specified by:
getXAResource in interface com.arjuna.ats.jta.recovery.XAResourceRecovery
Throws:
SQLException

hasMoreResources

public boolean hasMoreResources()
Specified by:
hasMoreResources in interface com.arjuna.ats.jta.recovery.XAResourceRecovery

retrieveData

public void retrieveData(String parameter,
                         String delimiter)


Copyright © 2008-2012 Red Hat, Inc.. All Rights Reserved.