if(connectorPoolObj == null) {
if(_logger.isLoggable(Level.FINE)) {
_logger.log(Level.FINE, "Wrong parameters for pool creation ");
}
String i18nMsg = localStrings.getString("ccp_adm.wrong_params_for_create");
throw new ConnectorRuntimeException(i18nMsg);
}
PoolInfo poolInfo = connectorPoolObj.getPoolInfo();
String jndiNameForPool = ConnectorAdminServiceUtils.getReservePrefixedJNDINameForPool(poolInfo);
try {
_runtime.getResourceNamingService().publishObject(poolInfo, jndiNameForPool, connectorPoolObj, true);
ManagedConnectionFactory mcf = obtainManagedConnectionFactory(poolInfo);
if (mcf == null) {
_runtime.getResourceNamingService().unpublishObject(poolInfo, jndiNameForPool);
String i18nMsg = localStrings.getString("ccp_adm.failed_to_create_mcf", poolInfo);
ConnectorRuntimeException cre = new ConnectorRuntimeException(i18nMsg);
_logger.log(Level.SEVERE, "rardeployment.mcf_creation_failure", poolInfo);
_logger.log(Level.SEVERE, "", cre);
throw cre;
}
} catch (NamingException ex) {
String i18nMsg = localStrings.getString("ccp_adm.failed_to_publish_in_jndi", poolInfo);
ConnectorRuntimeException cre = new ConnectorRuntimeException(i18nMsg);
cre.initCause(ex);
_logger.log(Level.SEVERE, "rardeployment.pool_jndi_bind_failure", poolInfo);
_logger.log(Level.SEVERE, "", cre);
throw cre;
} catch (NullPointerException ex) {
try {
_runtime.getResourceNamingService().unpublishObject(poolInfo, jndiNameForPool);
} catch (NamingException ne) {
if(_logger.isLoggable(Level.FINE)) {
_logger.log(Level.FINE, "Failed to unbind connection pool object ", poolInfo);
}
}
String i18nMsg = localStrings.getString("ccp_adm.failed_to_register_mcf", poolInfo);
ConnectorRuntimeException cre = new ConnectorRuntimeException(i18nMsg);
cre.initCause(ex);
_logger.log(Level.SEVERE, "rardeployment.mcf_registration_failure", poolInfo);
_logger.log(Level.SEVERE, "", cre);
throw cre;
}
}