Search in sources :

Example 1 with ServiceManager

use of com.hazelcast.spi.impl.servicemanager.ServiceManager in project hazelcast by hazelcast.

the class DefaultNodeExtension method onClusterStateChange.

@Override
public void onClusterStateChange(ClusterState newState, boolean isTransient) {
    ServiceManager serviceManager = node.getNodeEngine().getServiceManager();
    List<ClusterStateListener> listeners = serviceManager.getServices(ClusterStateListener.class);
    for (ClusterStateListener listener : listeners) {
        listener.onClusterStateChange(newState);
    }
}
Also used : ServiceManager(com.hazelcast.spi.impl.servicemanager.ServiceManager) ClusterStateListener(com.hazelcast.internal.cluster.ClusterStateListener)

Example 2 with ServiceManager

use of com.hazelcast.spi.impl.servicemanager.ServiceManager in project hazelcast by hazelcast.

the class DefaultNodeExtension method onClusterVersionChange.

@Override
public void onClusterVersionChange(Version newVersion) {
    systemLogger.info("Cluster version set to " + newVersion);
    ServiceManager serviceManager = node.getNodeEngine().getServiceManager();
    List<ClusterVersionListener> listeners = serviceManager.getServices(ClusterVersionListener.class);
    for (ClusterVersionListener listener : listeners) {
        listener.onClusterVersionChange(newVersion);
    }
    // also trigger cluster version change on explicitly registered listeners
    for (ClusterVersionListener listener : clusterVersionListeners) {
        listener.onClusterVersionChange(newVersion);
    }
}
Also used : ServiceManager(com.hazelcast.spi.impl.servicemanager.ServiceManager) ClusterVersionListener(com.hazelcast.internal.cluster.ClusterVersionListener)

Aggregations

ServiceManager (com.hazelcast.spi.impl.servicemanager.ServiceManager)2 ClusterStateListener (com.hazelcast.internal.cluster.ClusterStateListener)1 ClusterVersionListener (com.hazelcast.internal.cluster.ClusterVersionListener)1