Search in sources :

Example 1 with ConnectorRuntimeExtension

use of com.sun.enterprise.connectors.ConnectorRuntimeExtension 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;
}
Also used : DeferredResourceConfig(com.sun.enterprise.connectors.DeferredResourceConfig) ConnectorRuntimeExtension(com.sun.enterprise.connectors.ConnectorRuntimeExtension)

Aggregations

ConnectorRuntimeExtension (com.sun.enterprise.connectors.ConnectorRuntimeExtension)1 DeferredResourceConfig (com.sun.enterprise.connectors.DeferredResourceConfig)1