use of com.sun.enterprise.connectors.DeferredResourceConfig in project Payara by payara.
the class ResourcesUtil method getDeferredResourceConfig.
/* public DeferredResourceConfig getDeferredResourceConfig(ResourceInfo resourceInfo) {
DeferredResourceConfig resConfig = getDeferredConnectorResourceConfigs(resourceInfo);
if(resConfig != null) {
return resConfig;
}
resConfig = getDeferredJdbcResourceConfigs(resourceInfo);
if(resConfig != null) {
return resConfig;
}
resConfig = getDeferredAdminObjectConfigs(resourceInfo);
return resConfig;
}
*/
/* public DeferredResourceConfig getDeferredPoolConfig(PoolInfo poolInfo) {
DeferredResourceConfig resConfig = getDeferredConnectorPoolConfigs(poolInfo);
if(resConfig != null) {
return resConfig;
}
if(poolInfo == null){
return null;
}
resConfig = getDeferredJdbcPoolConfigs(poolInfo);
return resConfig;
}
*/
public DeferredResourceConfig getDeferredResourceConfig(Object resource, Object pool, String resType, String raName) throws ConnectorRuntimeException {
String resourceAdapterName;
DeferredResourceConfig resConfig = null;
// TODO V3 (not to hold specific resource types)
if (resource instanceof ConnectorResource || pool instanceof ConnectorConnectionPool) {
ConnectorConnectionPool connPool = (ConnectorConnectionPool) pool;
ConnectorResource connResource = (ConnectorResource) resource;
resourceAdapterName = connPool.getResourceAdapterName();
// TODO V3 need to get AOR & RA-Config later
resConfig = new DeferredResourceConfig(resourceAdapterName, null, connPool, connResource, null);
Resource[] resourcesToload = new Resource[] { connPool, connResource };
resConfig.setResourcesToLoad(resourcesToload);
} else {
Collection<ConnectorRuntimeExtension> extensions = Globals.getDefaultHabitat().getAllServices(ConnectorRuntimeExtension.class);
for (ConnectorRuntimeExtension extension : extensions) {
return extension.getDeferredResourceConfig(resource, pool, resType, raName);
}
}
return resConfig;
}
use of com.sun.enterprise.connectors.DeferredResourceConfig 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.enterprise.connectors.DeferredResourceConfig in project Payara by payara.
the class JdbcRuntimeExtension method getDeferredResourceConfig.
@Override
public DeferredResourceConfig getDeferredResourceConfig(Object resource, Object pool, String resType, String raName) throws ConnectorRuntimeException {
String resourceAdapterName;
DeferredResourceConfig resConfig = null;
// TODO V3 (not to hold specific resource types)
if (resource instanceof JdbcResource || pool instanceof JdbcConnectionPool) {
JdbcConnectionPool jdbcPool = (JdbcConnectionPool) pool;
JdbcResource jdbcResource = (JdbcResource) resource;
resourceAdapterName = getRANameofJdbcConnectionPool((JdbcConnectionPool) pool);
resConfig = new DeferredResourceConfig(resourceAdapterName, null, jdbcPool, jdbcResource, null);
Resource[] resourcesToload = new Resource[] { jdbcPool, jdbcResource };
resConfig.setResourcesToLoad(resourcesToload);
} else {
throw new ConnectorRuntimeException("unsupported resource type : " + resource);
}
return resConfig;
}
Aggregations