// we can run the recovery manager out of process? The server addr would need to be on a per
// jndiname basis, as we may be doing recovery for a whole cluster. We would need AS
// jmx classes (and the db drivers naturally) on the recovery manager classpath.
InitialContext context = new InitialContext();
MBeanServerConnection server = (MBeanServerConnection)context.lookup("jmx/invoker/RMIAdaptor");
ObjectName objectName = new ObjectName("jboss.jca:name="+_dataSourceId+",service=ManagedConnectionFactory");
if(_username !=null && _password !=null)
{
SecurityAssociation.setPrincipal(new SimplePrincipal(_username));
SecurityAssociation.setCredential(_password);
}
String className = (String)server.invoke(objectName, "getManagedConnectionFactoryAttribute", new Object[] {"XADataSourceClass"}, new String[] {"java.lang.String"});
if (log.isDebugEnabled())
{
log.debug("AppServerJDBCXARecovery datasource classname = "+className);
}
if(_username !=null && _password !=null)
{
SecurityAssociation.setPrincipal(new SimplePrincipal(_username));
SecurityAssociation.setCredential(_password);
}
String properties = (String)server.invoke(objectName, "getManagedConnectionFactoryAttribute", new Object[] {"XADataSourceProperties"}, new String[] {"java.lang.String"});
// debug disabled due to security paranoia - it may log datasource password in cleartext.
// log.debug("AppServerJDBCXARecovery.result="+properties);
/*
ObjectName txCmObjectName = new ObjectName("jboss.jca:name=" +_dataSourceId + ",service=XATxCM");