Search in sources :

Example 1 with UserCodeDeploymentClassLoader

use of com.hazelcast.internal.usercodedeployment.UserCodeDeploymentClassLoader in project hazelcast by hazelcast.

the class Node method getConfigClassloader.

private ClassLoader getConfigClassloader(Config config) {
    UserCodeDeploymentConfig userCodeDeploymentConfig = config.getUserCodeDeploymentConfig();
    ClassLoader classLoader;
    if (userCodeDeploymentConfig.isEnabled()) {
        ClassLoader parent = config.getClassLoader();
        final ClassLoader theParent = parent == null ? Node.class.getClassLoader() : parent;
        classLoader = doPrivileged(new PrivilegedAction<UserCodeDeploymentClassLoader>() {

            @Override
            public UserCodeDeploymentClassLoader run() {
                return new UserCodeDeploymentClassLoader(theParent);
            }
        });
    } else {
        classLoader = config.getClassLoader();
    }
    return classLoader;
}
Also used : PrivilegedAction(java.security.PrivilegedAction) UserCodeDeploymentClassLoader(com.hazelcast.internal.usercodedeployment.UserCodeDeploymentClassLoader) SimpleDiscoveryNode(com.hazelcast.spi.discovery.SimpleDiscoveryNode) UserCodeDeploymentClassLoader(com.hazelcast.internal.usercodedeployment.UserCodeDeploymentClassLoader) UserCodeDeploymentConfig(com.hazelcast.config.UserCodeDeploymentConfig)

Aggregations

UserCodeDeploymentConfig (com.hazelcast.config.UserCodeDeploymentConfig)1 UserCodeDeploymentClassLoader (com.hazelcast.internal.usercodedeployment.UserCodeDeploymentClassLoader)1 SimpleDiscoveryNode (com.hazelcast.spi.discovery.SimpleDiscoveryNode)1 PrivilegedAction (java.security.PrivilegedAction)1