use of com.sun.appserv.connectors.spi.ConfigurableTransactionSupport in project Payara by payara.
the class ActiveResourceAdapterImpl method createManagedConnectionFactory.
/**
* Creates managed Connection factory instance.
*
* @param ccp Connector connection pool which contains the pool properties
* and ra.xml values pertaining to managed connection factory
* class. These values are used in MCF creation.
* @param jcl Classloader used to managed connection factory class.
* @return ManagedConnectionFactory created managed connection factory
* instance
*/
public ManagedConnectionFactory createManagedConnectionFactory(ConnectorConnectionPool ccp, ClassLoader jcl) {
final String mcfClass = ccp.getConnectorDescriptorInfo().getManagedConnectionFactoryClass();
try {
ManagedConnectionFactory mcf = null;
mcf = instantiateMCF(mcfClass, jcl);
if (mcf instanceof ConfigurableTransactionSupport) {
TransactionSupport ts = ConnectionPoolObjectsUtils.getTransactionSupport(ccp.getTransactionSupport());
((ConfigurableTransactionSupport) mcf).setTransactionSupport(ts);
}
SetMethodAction setMethodAction = new SetMethodAction(mcf, ccp.getConnectorDescriptorInfo().getMCFConfigProperties());
setMethodAction.run();
if (_logger.isLoggable(Level.FINE)) {
_logger.log(Level.FINE, "Created MCF object : ", mcfClass);
}
return mcf;
} catch (ClassNotFoundException Ex) {
_logger.log(Level.SEVERE, "rardeployment.class_not_found", new Object[] { mcfClass, Ex.getMessage() });
if (_logger.isLoggable(Level.FINE)) {
_logger.log(Level.FINE, "rardeployment.class_not_found", Ex);
}
return null;
} catch (InstantiationException Ex) {
_logger.log(Level.SEVERE, "rardeployment.class_instantiation_error", new Object[] { mcfClass, Ex.getMessage() });
if (_logger.isLoggable(Level.FINE)) {
_logger.log(Level.FINE, "rardeployment.class_instantiation_error", Ex);
}
return null;
} catch (IllegalAccessException Ex) {
_logger.log(Level.SEVERE, "rardeployment.illegalaccess_error", new Object[] { mcfClass, Ex.getMessage() });
if (_logger.isLoggable(Level.FINE)) {
_logger.log(Level.FINE, "rardeployment.illegalaccess_error", Ex);
}
return null;
} catch (Exception Ex) {
_logger.log(Level.SEVERE, "rardeployment.mcfcreation_error", new Object[] { mcfClass, Ex.getMessage() });
if (_logger.isLoggable(Level.FINE)) {
_logger.log(Level.FINE, "rardeployment.mcfcreation_error", Ex);
}
return null;
}
}
Aggregations