use of com.hazelcast.spi.ConfigurableService in project hazelcast by hazelcast.
the class ServiceManagerImpl method initService.
private void initService(Map<String, Properties> serviceProps, Map<String, Object> serviceConfigObjects, ServiceInfo serviceInfo) {
final Object service = serviceInfo.getService();
if (serviceInfo.isConfigurableService()) {
try {
if (logger.isFinestEnabled()) {
logger.finest("Configuring service -> " + service);
}
final Object configObject = serviceConfigObjects.get(serviceInfo.getName());
((ConfigurableService) service).configure(configObject);
} catch (Throwable t) {
logger.severe("Error while configuring service: " + t.getMessage(), t);
}
}
if (serviceInfo.isManagedService()) {
try {
if (logger.isFinestEnabled()) {
logger.finest("Initializing service -> " + service);
}
final Properties props = serviceProps.get(serviceInfo.getName());
((ManagedService) service).init(nodeEngine, props != null ? props : new Properties());
} catch (Throwable t) {
logger.severe("Error while initializing service: " + t.getMessage(), t);
}
}
}
Aggregations