public DeferredResourceConfig getDeferredResourceConfig(Object resource, Object pool, String resType, String raName)
throws ConnectorRuntimeException {
String resourceAdapterName ;
DeferredResourceConfig resConfig = null;
//TODO V3 there should not be res-type related check, refactor deferred-ra-config
//TODO V3 (not to hold specific resource types)
if (ConnectorConstants.RES_TYPE_JDBC.equalsIgnoreCase(resType) ||
ConnectorConstants.RES_TYPE_JCP.equalsIgnoreCase(resType)) {
JdbcConnectionPool jdbcPool = (JdbcConnectionPool) pool;
JdbcResource jdbcResource = (JdbcResource) resource;
resourceAdapterName = getRANameofJdbcConnectionPool((JdbcConnectionPool) pool);
resConfig = new DeferredResourceConfig(resourceAdapterName, null, null, null, jdbcPool, jdbcResource, null);
Resource[] resourcesToload = new Resource[]{jdbcPool, jdbcResource};
resConfig.setResourcesToLoad(resourcesToload);
} else if (ConnectorConstants.RES_TYPE_CR.equalsIgnoreCase(resType) ||
ConnectorConstants.RES_TYPE_CCP.equalsIgnoreCase(resType)) {
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, null, null);
Resource[] resourcesToload = new Resource[]{connPool, connResource};
resConfig.setResourcesToLoad(resourcesToload);
} else {
throw new ConnectorRuntimeException("unsupported resource type : " + resType);
}
return resConfig;