if (_logger.isLoggable(Level.FINE)) {
_logger.fine("ResourceAdapterAdminServiceImpl :: createActiveRA "
+ moduleName + " at " + moduleDir);
}
ActiveResourceAdapter activeResourceAdapter = _registry.getActiveResourceAdapter(moduleName);
if (activeResourceAdapter != null) {
if(_logger.isLoggable(Level.FINE)) {
_logger.log(Level.FINE, "rardeployment.resourceadapter.already.started", moduleName);
}
return;
}
//TODO V3 works fine ?
if (loader == null) {
try {
loader = connectorDescriptor.getClassLoader();
} catch (Exception ex) {
if(_logger.isLoggable(Level.FINE)) {
_logger.log(Level.FINE, "No classloader available with connector descriptor");
}
loader = null;
}
}
ConnectorRuntime connectorRuntime = ConnectorRuntime.getRuntime();
ModuleDescriptor moduleDescriptor = null;
Application application = null;
if(_logger.isLoggable(Level.FINE)) {
_logger.fine("ResourceAdapterAdminServiceImpl :: createActiveRA "
+ moduleName + " at " + moduleDir + " loader :: " + loader);
}
//class-loader can not be null for standalone rar as deployer should have provided one.
//class-laoder can (may) be null for system-rars as they are not actually deployed.
//TODO V3 don't check for system-ra if the resource-adapters are not loaded before recovery
// (standalone + embedded)
if (loader == null && ConnectorsUtil.belongsToSystemRA(moduleName)) {
if (connectorRuntime.isServer()) {
loader = connectorRuntime.getSystemRARClassLoader(moduleName);
}
} else {
connectorDescriptor.setClassLoader(null);
moduleDescriptor = connectorDescriptor.getModuleDescriptor();
application = connectorDescriptor.getApplication();
connectorDescriptor.setModuleDescriptor(null);
connectorDescriptor.setApplication(null);
}
try {
activeResourceAdapter =
connectorRuntime.getActiveRAFactory().
createActiveResourceAdapter(connectorDescriptor, moduleName, loader);
if(_logger.isLoggable(Level.FINE)) {
_logger.fine("ResourceAdapterAdminServiceImpl :: createActiveRA " +
moduleName + " at " + moduleDir +
" adding to registry " + activeResourceAdapter);
}
_registry.addActiveResourceAdapter(moduleName, activeResourceAdapter);
if(_logger.isLoggable(Level.FINE)) {
_logger.fine("ResourceAdapterAdminServiceImpl:: createActiveRA " +
moduleName + " at " + moduleDir
+ " env =server ? " + (connectorRuntime.isServer()));
}
if (connectorRuntime.isServer()) {
//Update RAConfig in Connector Descriptor and bind in JNDI
//so that ACC clients could use RAConfig
updateRAConfigInDescriptor(connectorDescriptor, moduleName);
String descriptorJNDIName = ConnectorAdminServiceUtils.getReservePrefixedJNDINameForDescriptor(moduleName);
if(_logger.isLoggable(Level.FINE)) {
_logger.fine("ResourceAdapterAdminServiceImpl :: createActiveRA "
+ moduleName + " at " + moduleDir
+ " publishing descriptor " + descriptorJNDIName);
}
_runtime.getNamingManager().publishObject(descriptorJNDIName, connectorDescriptor, true);
activeResourceAdapter.setup();
String securityWarningMessage=
connectorRuntime.getSecurityPermissionSpec(moduleName);
// To i18N.
if (securityWarningMessage != null) {