Search in sources :

Example 1 with ConnectorService

use of org.glassfish.connectors.config.ConnectorService in project Payara by payara.

the class AppSpecificConnectorClassLoaderUtil method useGlobalConnectorClassLoader.

public boolean useGlobalConnectorClassLoader() {
    boolean flag = false;
    ConnectorService connectorService = connectorServiceProvider.get();
    // it is possible that connector-service is not yet defined in domain.xml
    if (connectorService != null) {
        String classLoadingPolicy = connectorService.getClassLoadingPolicy();
        if (classLoadingPolicy != null && classLoadingPolicy.equals(ConnectorConstants.CLASSLOADING_POLICY_GLOBAL_ACCESS)) {
            flag = true;
        }
    }
    return flag;
}
Also used : ConnectorService(org.glassfish.connectors.config.ConnectorService)

Example 2 with ConnectorService

use of org.glassfish.connectors.config.ConnectorService in project Payara by payara.

the class AppSpecificConnectorClassLoaderUtil method getRequiredResourceAdapters.

public Collection<String> getRequiredResourceAdapters(String appName) {
    List<String> requiredRars = new ArrayList<String>();
    if (appName != null) {
        ConnectorService connectorService = connectorServiceProvider.get();
        if (connectorService != null) {
            if (appName.trim().length() > 0) {
                Property property = connectorService.getProperty(appName.trim());
                if (property != null) {
                    String requiredRarsString = property.getValue();
                    StringTokenizer tokenizer = new StringTokenizer(requiredRarsString, ",");
                    while (tokenizer.hasMoreTokens()) {
                        String token = tokenizer.nextToken().trim();
                        requiredRars.add(token);
                    }
                }
            }
        }
    }
    return requiredRars;
}
Also used : StringTokenizer(java.util.StringTokenizer) ArrayList(java.util.ArrayList) Property(org.jvnet.hk2.config.types.Property) ConnectorService(org.glassfish.connectors.config.ConnectorService)

Aggregations

ConnectorService (org.glassfish.connectors.config.ConnectorService)2 ArrayList (java.util.ArrayList)1 StringTokenizer (java.util.StringTokenizer)1 Property (org.jvnet.hk2.config.types.Property)1