use of org.apereo.cas.configuration.model.support.hazelcast.BaseHazelcastProperties in project cas by apereo.
the class CasServicesStreamingHazelcastConfiguration method casRegisteredServiceHazelcastInstance.
@Bean
public HazelcastInstance casRegisteredServiceHazelcastInstance() {
final String name = CasRegisteredServiceHazelcastStreamPublisher.class.getSimpleName();
LOGGER.debug("Creating Hazelcast instance [{}] to publish service definitions", name);
final HazelcastConfigurationFactory factory = new HazelcastConfigurationFactory();
final StreamServicesHazelcastProperties stream = casProperties.getServiceRegistry().getStream().getHazelcast();
final BaseHazelcastProperties hz = stream.getConfig();
final long duration = Beans.newDuration(stream.getDuration()).toMillis();
final MapConfig mapConfig = factory.buildMapConfig(hz, name, TimeUnit.MILLISECONDS.toSeconds(duration));
final Config cfg = factory.build(hz, mapConfig);
LOGGER.debug("Created hazelcast instance [{}] with publisher id [{}] to publish service definitions", name, casRegisteredServiceStreamPublisherIdentifier);
return Hazelcast.newHazelcastInstance(cfg);
}
Aggregations