use of com.hazelcast.spi.discovery.NodeFilter in project hazelcast by hazelcast.
the class DefaultDiscoveryService method getNodeFilter.
private NodeFilter getNodeFilter(DiscoveryServiceSettings settings) {
DiscoveryConfig discoveryConfig = settings.getDiscoveryConfig();
ClassLoader configClassLoader = settings.getConfigClassLoader();
if (discoveryConfig.getNodeFilter() != null) {
return discoveryConfig.getNodeFilter();
}
if (discoveryConfig.getNodeFilterClass() != null) {
try {
ClassLoader cl = configClassLoader;
if (cl == null) {
cl = DefaultDiscoveryService.class.getClassLoader();
}
String className = discoveryConfig.getNodeFilterClass();
return (NodeFilter) cl.loadClass(className).newInstance();
} catch (Exception e) {
throw new RuntimeException("Failed to configure discovery node filter", e);
}
}
return null;
}
Aggregations