use of com.sun.appserv.connectors.internal.api.ConnectorRuntimeException in project Payara by payara.
the class ConnectorService method switchOnMatching.
/**
* Matching will be switched off in the pool, by default. This will be
* switched on if the connections with different resource principals reach the pool.
*
* @param poolInfo Name of the pool to switchOn matching.
* @param rarName Name of the resource adater.
*/
public void switchOnMatching(String rarName, PoolInfo poolInfo) {
// Later other resource adapters also become applicable.
if (rarName.equals(ConnectorConstants.JDBCDATASOURCE_RA_NAME) || rarName.equals(ConnectorConstants.JDBCCONNECTIONPOOLDATASOURCE_RA_NAME) || rarName.equals(ConnectorConstants.JDBCXA_RA_NAME)) {
PoolManager poolMgr = _runtime.getPoolManager();
boolean result = poolMgr.switchOnMatching(poolInfo);
if (!result) {
try {
_runtime.switchOnMatchingInJndi(poolInfo);
} catch (ConnectorRuntimeException cre) {
// This will never happen.
}
}
}
}
use of com.sun.appserv.connectors.internal.api.ConnectorRuntimeException in project Payara by payara.
the class ConnectorService method checkAndLoadPool.
public boolean checkAndLoadPool(PoolInfo poolInfo) {
boolean status = false;
try {
ResourcePool pool = _runtime.getConnectionPoolConfig(poolInfo);
// DeferredResourceConfig defResConfig = resutil.getDeferredPoolConfig(poolName);
DeferredResourceConfig defResConfig = getResourcesUtil().getDeferredResourceConfig(null, pool, null, null);
status = loadResourcesAndItsRar(defResConfig);
} catch (ConnectorRuntimeException cre) {
Object[] params = new Object[] { poolInfo, cre };
_logger.log(Level.WARNING, "unable.to.load.connection.pool", params);
}
return status;
}
use of com.sun.appserv.connectors.internal.api.ConnectorRuntimeException in project Payara by payara.
the class ConnectorService method loadDeferredResourceAdapter.
public void loadDeferredResourceAdapter(String rarModuleName) throws ConnectorRuntimeException {
// load the RA if its not already loaded
if (_registry.getActiveResourceAdapter(rarModuleName) == null) {
try {
// Do this only for System RA
if (ConnectorsUtil.belongsToSystemRA(rarModuleName)) {
String systemModuleLocation = ConnectorsUtil.getSystemModuleLocation(rarModuleName);
if (_runtime.isServer()) {
_runtime.getMonitoringBootstrap().registerProbes(rarModuleName, new File(systemModuleLocation), _runtime.getSystemRARClassLoader(rarModuleName));
}
_runtime.createActiveResourceAdapter(systemModuleLocation, rarModuleName, null);
}
/* not needed as long as standalone + embedded rars are loaded before recovery
else if (rarModuleName.indexOf(ConnectorConstants.EMBEDDEDRAR_NAME_DELIMITER) != -1) {
createActiveResourceAdapterForEmbeddedRar(rarModuleName);
} else{
_runtime.createActiveResourceAdapter(ConnectorsUtil.getLocation(rarModuleName), rarModuleName, null);
}*/
} catch (Exception e) {
ConnectorRuntimeException ce = new ConnectorRuntimeException(e.getMessage());
ce.initCause(e);
throw ce;
}
}
}
use of com.sun.appserv.connectors.internal.api.ConnectorRuntimeException in project Payara by payara.
the class RarHandler method getClassLoader.
/**
* {@inheritDoc}
*/
public ClassLoader getClassLoader(ClassLoader parent, DeploymentContext context) {
try {
String moduleDir = context.getSource().getURI().getPath();
String moduleName = context.getSource().getName();
List<URI> appLibs = null;
try {
appLibs = context.getAppLibs();
if (_logger.isLoggable(Level.FINEST)) {
_logger.log(Level.FINEST, "installed libraries (--applibs and EXTENSTION_LIST) for rar " + "[ " + moduleName + " ] : " + appLibs);
}
} catch (URISyntaxException e) {
throw new RuntimeException(e);
}
ClassLoader carCL;
if (isEmbedded(context)) {
String applicationName = ConnectorsUtil.getApplicationName(context);
String embeddedRarName = ConnectorsUtil.getEmbeddedRarModuleName(applicationName, moduleName);
// ear's classloader hierarchy is : module-CL -> ear-CL (contains all ejb module classpath)
// -> embedded-RAR-CL -> ear-lib-CL.
// parent provided here is ear-CL, we need to use
// ear-lib-CL as parent for embedded-RAR module-CL
carCL = loader.createRARClassLoader(moduleDir, parent.getParent().getParent(), embeddedRarName, appLibs);
} else {
carCL = loader.createRARClassLoader(moduleDir, null, moduleName, appLibs);
}
try {
doPrivileged(new SetPermissionsAction(CommponentType.rar, context, carCL));
} catch (PrivilegedActionException e) {
throw new SecurityException(e.getException());
}
return carCL;
} catch (ConnectorRuntimeException e) {
throw new RuntimeException(e);
}
}
use of com.sun.appserv.connectors.internal.api.ConnectorRuntimeException in project Payara by payara.
the class ActiveOutboundResourceAdapter method loadRAConfiguration.
/**
* Loads RA javabean. This method is protected, so that any system
* resource adapter can have specific configuration done during the
* loading.
*
* @throws ConnectorRuntimeException if there is a failure.
*/
protected void loadRAConfiguration() throws ConnectorRuntimeException {
try {
Set mergedProps;
ConnectorRegistry registry = ConnectorRegistry.getInstance();
ResourceAdapterConfig raConfig = registry.getResourceAdapterConfig(moduleName_);
List<Property> raConfigProps = new ArrayList<Property>();
mergedProps = mergeRAConfiguration(raConfig, raConfigProps);
logMergedProperties(mergedProps);
SetMethodAction setMethodAction = new SetMethodAction(this.resourceadapter_, mergedProps);
setMethodAction.run();
} catch (Exception e) {
String i18nMsg = localStrings.getString("ccp_adm.wrong_params_for_create", e.getMessage());
ConnectorRuntimeException cre = new ConnectorRuntimeException(i18nMsg);
cre.initCause(e);
throw cre;
}
}
Aggregations