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 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 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 loadResourcesAndItsRar.
/* public boolean checkAndLoadResource(Object resource, Object pool, String resourceType, String resourceName,
String raName)
throws ConnectorRuntimeException {
String resname = ConnectorAdminServiceUtils.getOriginalResourceName(resourceName);
if(_logger.isLoggable(Level.FINE)) {
_logger.fine("ConnectorService :: checkAndLoadResource resolved to load " + resname);
}
DeferredResourceConfig defResConfig = getResourcesUtil().getDeferredResourceConfig(resource, pool, resourceType, raName);
//DeferredResourceConfig defResConfig = resUtil.getDeferredResourceConfig(resname);
return loadResourcesAndItsRar(defResConfig);
}
*/
public boolean loadResourcesAndItsRar(DeferredResourceConfig defResConfig) {
if (defResConfig != null) {
try {
loadDeferredResources(defResConfig.getResourceAdapterConfig());
final String rarName = defResConfig.getRarName();
loadDeferredResourceAdapter(rarName);
final Resource[] resToLoad = defResConfig.getResourcesToLoad();
AccessController.doPrivileged(new PrivilegedAction() {
public Object run() {
try {
loadDeferredResources(resToLoad);
} catch (Exception ex) {
Object[] params = new Object[] { rarName, ex };
_logger.log(Level.SEVERE, "failed.to.load.deferred.resources", params);
}
return null;
}
});
} catch (Exception ex) {
Object[] params = new Object[] { defResConfig.getRarName(), ex };
_logger.log(Level.SEVERE, "failed.to.load.deferred.ra", params);
return false;
}
return true;
}
return false;
}
use of com.sun.appserv.connectors.internal.api.ConnectorRuntimeException in project Payara by payara.
the class ConnectorService method getConnectorDescriptor.
/**
* Obtains the connector Descriptor pertaining to rar.
* If ConnectorDescriptor is present in registry, it is obtained from
* registry and returned. Else it is explicitly read from directory
* where rar is exploded.
*
* @param rarName Name of the rar
* @return ConnectorDescriptor pertaining to rar.
* @throws ConnectorRuntimeException when unable to get descriptor
*/
public ConnectorDescriptor getConnectorDescriptor(String rarName) throws ConnectorRuntimeException {
if (rarName == null) {
return null;
}
ConnectorDescriptor desc = null;
desc = _registry.getDescriptor(rarName);
if (desc != null) {
return desc;
}
String moduleDir;
// using the applicationarchivist
if (rarName.indexOf(ConnectorConstants.EMBEDDEDRAR_NAME_DELIMITER) != -1) {
try {
desc = loadConnectorDescriptorForEmbeddedRAR(rarName);
if (desc != null)
return desc;
} catch (ConnectorRuntimeException e) {
throw e;
}
}
if (ConnectorsUtil.belongsToSystemRA(rarName)) {
moduleDir = ConnectorsUtil.getSystemModuleLocation(rarName);
} else {
moduleDir = ConnectorsUtil.getLocation(rarName);
}
if (moduleDir != null) {
desc = ConnectorDDTransformUtils.getConnectorDescriptor(moduleDir, rarName);
} else {
_logger.log(Level.SEVERE, "rardeployment.no_module_deployed", rarName);
}
return desc;
}
Aggregations