use of com.hazelcast.spi.impl.servicemanager.RemoteServiceDescriptor in project hazelcast by hazelcast.
the class ServiceManagerImpl method readServiceDescriptors.
private void readServiceDescriptors() {
Node node = nodeEngine.getNode();
try {
ClassLoader classLoader = node.getConfigClassLoader();
Iterator<Class<RemoteServiceDescriptorProvider>> iter = com.hazelcast.util.ServiceLoader.classIterator(PROVIDER_ID, classLoader);
while (iter.hasNext()) {
Class<RemoteServiceDescriptorProvider> clazz = iter.next();
Constructor<RemoteServiceDescriptorProvider> constructor = clazz.getDeclaredConstructor();
RemoteServiceDescriptorProvider provider = constructor.newInstance();
RemoteServiceDescriptor[] services = provider.createRemoteServiceDescriptors();
for (RemoteServiceDescriptor serviceDescriptor : services) {
registerService(serviceDescriptor.getServiceName(), serviceDescriptor.getService(nodeEngine));
}
}
} catch (Exception e) {
throw ExceptionUtil.rethrow(e);
}
}
Aggregations