use of com.sun.appserv.connectors.internal.api.ConnectorRuntimeException in project Payara by payara.
the class ConnectorConnectionPoolAdminServiceImpl method getConnectorConnectionPool.
/**
* Returns the connector connection pool object corresponding
* to the pool name
*
* @param poolInfo Name of the pool.MCF pertaining to this pool is
* created/returned.
* @return Connector connection pool corresponding to this instance
* @throws ConnectorRuntimeException if creation/retrieval
* of MCF fails
*/
private ConnectorConnectionPool getConnectorConnectionPool(PoolInfo poolInfo, Hashtable env) throws ConnectorRuntimeException, NamingException {
String jndiNameForPool = ConnectorAdminServiceUtils.getReservePrefixedJNDINameForPool(poolInfo);
ConnectorConnectionPool connectorConnectionPool = (ConnectorConnectionPool) _runtime.getResourceNamingService().lookup(poolInfo, jndiNameForPool, env);
if (connectorConnectionPool == null) {
String i18nMsg = localStrings.getString("ccp_adm.null_pool", poolInfo);
ConnectorRuntimeException cre = new ConnectorRuntimeException(i18nMsg);
_logger.log(Level.SEVERE, "rardeployment.connectionpool_object_null", poolInfo);
if (_logger.isLoggable(Level.FINE)) {
_logger.log(Level.FINE, "", cre);
}
throw cre;
}
return connectorConnectionPool;
}
use of com.sun.appserv.connectors.internal.api.ConnectorRuntimeException in project Payara by payara.
the class ConnectorConnectionPoolAdminServiceImpl method reconfigureConnectorConnectionPool.
/**
* Reconfigure a connection pool.
* This method compares the passed connector connection pool with the one
* in memory. If the pools are unequal and the MCF properties are changed
* a pool recreate is required. However if the pools are unequal and the
* MCF properties are not changed a recreate is not required
*
* @param ccp - the Updated connector connection pool object that admin
* hands over
* @param excludedProps - A set of excluded property names that we want
* to be excluded in the comparison check while
* comparing MCF properties
* @return true - if a pool restart is required, false otherwise
* @throws ConnectorRuntimeException
*/
public boolean reconfigureConnectorConnectionPool(ConnectorConnectionPool ccp, Set excludedProps) throws ConnectorRuntimeException {
if (ccp == null) {
throw new ConnectorRuntimeException("No pool to reconfigure, new pool object is null");
}
logFine("new ccp :\n" + ccp.toString());
// see if the new ConnectorConnectionPool is different from
// the original one and update relevant properties
PoolInfo poolInfo = ccp.getPoolInfo();
ConnectorConnectionPool origCcp = null;
try {
origCcp = getOriginalConnectorConnectionPool(poolInfo);
} catch (NamingException ne) {
throw new ConnectorRuntimeException(ne.getMessage());
}
if (origCcp == null) {
throw new ConnectorRuntimeException("No pool to reconfigure, original pool object is null");
}
logFine("original ccp :\n" + origCcp.toString());
ConnectionPoolReconfigHelper.ReconfigAction action = ConnectionPoolReconfigHelper.compare(origCcp, ccp, excludedProps);
logFine("pool reconfig action == " + action);
if (action == ConnectionPoolReconfigHelper.ReconfigAction.UPDATE_MCF_AND_ATTRIBUTES) {
updateMCFAndPoolAttributes(ccp);
} else if (action == ConnectionPoolReconfigHelper.ReconfigAction.RECREATE_POOL) {
return true;
}
return false;
}
use of com.sun.appserv.connectors.internal.api.ConnectorRuntimeException in project Payara by payara.
the class ConnectorConnectionPoolAdminServiceImpl method unloadAndKillPool.
/**
* unloads and kills the connector Connection pool without checking for
* resources in domain.xml.
*
* @param poolInfo Name of the pool to delete
* @throws ConnectorRuntimeException if pool unload or kill operation fails
*/
private void unloadAndKillPool(PoolInfo poolInfo) throws ConnectorRuntimeException {
killPool(poolInfo);
boolean result = _registry.removeManagedConnectionFactory(poolInfo);
if (result == false) {
_logger.log(Level.SEVERE, "rardeployment.mcf_removal_failure", poolInfo);
String i18nMsg = localStrings.getString("ccp_adm.wrong_params_for_create", poolInfo);
ConnectorRuntimeException cre = new ConnectorRuntimeException(i18nMsg);
if (_logger.isLoggable(Level.FINE)) {
_logger.log(Level.FINE, "", cre);
}
throw cre;
}
try {
String jndiNameForPool = ConnectorAdminServiceUtils.getReservePrefixedJNDINameForPool(poolInfo);
_runtime.getResourceNamingService().unpublishObject(poolInfo, jndiNameForPool);
} catch (NamingException ne) {
String i18nMsg = localStrings.getString("ccp_adm.failed_to_remove_from_jndi", poolInfo);
ConnectorRuntimeException cre = new ConnectorRuntimeException(i18nMsg);
cre.initCause(ne);
_logger.log(Level.SEVERE, "rardeployment.connectionpool_removal_from_jndi_error", poolInfo);
if (_logger.isLoggable(Level.FINE)) {
_logger.log(Level.FINE, "", cre);
}
throw cre;
}
}
use of com.sun.appserv.connectors.internal.api.ConnectorRuntimeException in project Payara by payara.
the class ConnectorConnectionPoolAdminServiceImpl method obtainManagedConnectionFactories.
/**
* Returns the MCF instances.
* @param poolInfo Name of the pool.MCF pertaining to this pool is
* created/returned.
* @return created/already present MCF instance
* @throws ConnectorRuntimeException if creation/retrieval of MCF fails
*/
public ManagedConnectionFactory[] obtainManagedConnectionFactories(PoolInfo poolInfo) throws ConnectorRuntimeException {
ManagedConnectionFactory[] mcfs = null;
String raName = null;
try {
ConnectorConnectionPool conPool = getConnectorConnectionPool(poolInfo);
ActiveResourceAdapter activeResourceAdapter = getResourceAdapter(conPool);
raName = activeResourceAdapter.getModuleName();
mcfs = activeResourceAdapter.createManagedConnectionFactories(conPool, null);
} catch (NamingException ne) {
String i18nMsg = localStrings.getString("pingpool.name_not_bound", poolInfo);
ConnectorRuntimeException cre = new ConnectorRuntimeException(i18nMsg);
cre.initCause(ne);
if (_logger.isLoggable(Level.FINE)) {
_logger.log(Level.FINE, "rardeployment.jndi_lookup_failed", poolInfo);
_logger.log(Level.FINE, "", cre);
}
// _logger.log(Level.SEVERE,"",cre);
throw cre;
} catch (NullPointerException ne) {
String i18nMsg = localStrings.getString("ccp_adm.failed_to_register_mcf", poolInfo);
ConnectorRuntimeException cre = new ConnectorRuntimeException(i18nMsg);
cre.initCause(ne);
_logger.log(Level.SEVERE, "mcf_add_toregistry_failed", poolInfo);
if (_logger.isLoggable(Level.FINE)) {
_logger.log(Level.FINE, "", cre);
}
// _logger.log(Level.SEVERE,"",cre);
throw cre;
}
for (ManagedConnectionFactory mcf : mcfs) {
validateMCF(mcf, raName);
}
return mcfs;
}
use of com.sun.appserv.connectors.internal.api.ConnectorRuntimeException in project Payara by payara.
the class ActiveResourceAdapterImpl method deleteDefaultConnectorConnectionPools.
/**
* Deletes the default connector connection pools.
*/
protected void deleteDefaultConnectorConnectionPools() {
for (ConnectionDefDescriptor aConnectionDefs_ : connectionDefs_) {
String connectionDefName = aConnectionDefs_.getConnectionFactoryIntf();
String resourceJndiName = connectorRuntime_.getDefaultPoolName(moduleName_, connectionDefName);
try {
PoolInfo poolInfo = new PoolInfo(resourceJndiName);
connectorRuntime_.deleteConnectorConnectionPool(poolInfo);
} catch (ConnectorRuntimeException cre) {
_logger.log(Level.WARNING, "rar.undeployment.default_pool_delete_fail", resourceJndiName);
}
}
}
Aggregations