Java 类com.hazelcast.core.MembershipListener 实例源码

项目:hazelcast-archive    文件:Node.java   
private void initializeListeners(Config config) {
    for (final ListenerConfig listenerCfg : config.getListenerConfigs()) {
        Object listener = listenerCfg.getImplementation();
        if (listener == null) {
            try {
                listener = Serializer.newInstance(Serializer.loadClass(listenerCfg.getClassName()));
            } catch (Exception e) {
                logger.log(Level.SEVERE, e.getMessage(), e);
            }
        }
        if (listener instanceof InstanceListener) {
            factory.addInstanceListener((InstanceListener) listener);
        } else if (listener instanceof MembershipListener) {
            clusterImpl.addMembershipListener((MembershipListener) listener);
        } else if (listener instanceof MigrationListener) {
            concurrentMapManager.partitionServiceImpl.addMigrationListener((MigrationListener) listener);
        } else if (listener != null) {
            final String error = "Unknown listener type: " + listener.getClass();
            Throwable t = new IllegalArgumentException(error);
            logger.log(Level.WARNING, error, t);
        }
    }
}
项目:health-and-care-developer-network    文件:Node.java   
private void initializeListeners(Config config) {
    for (final ListenerConfig listenerCfg : config.getListenerConfigs()) {
        Object listener = listenerCfg.getImplementation();
        if (listener == null) {
            try {
                listener = Serializer.newInstance(Serializer.loadClass(listenerCfg.getClassName()));
            } catch (Exception e) {
                logger.log(Level.SEVERE, e.getMessage(), e);
            }
        }
        if (listener instanceof InstanceListener) {
            factory.addInstanceListener((InstanceListener) listener);
        } else if (listener instanceof MembershipListener) {
            clusterImpl.addMembershipListener((MembershipListener) listener);
        } else if (listener instanceof MigrationListener) {
            concurrentMapManager.partitionServiceImpl.addMigrationListener((MigrationListener) listener);
        } else if (listener instanceof LifecycleListener) {
            factory.lifecycleService.addLifecycleListener((LifecycleListener) listener);
        } else if (listener != null) {
            final String error = "Unknown listener type: " + listener.getClass();
            Throwable t = new IllegalArgumentException(error);
            logger.log(Level.WARNING, error, t);
        }
    }
}
项目:health-and-care-developer-network    文件:MembershipListenerManager.java   
public MembershipListenerManager(HazelcastClient client) {
    this.client = client;
    final ClientConfig clientConfig = client.getClientConfig();
    if (clientConfig != null) {
        for (Object listener : clientConfig.getListeners()) {
            if (listener instanceof MembershipListener) {
                registerListener((MembershipListener) listener);
            }
        }
    }
}
项目:Camel    文件:HazelcastInstanceConsumerTest.java   
@Override
protected void trainHazelcastInstance(HazelcastInstance hazelcastInstance) {
    when(hazelcastInstance.getCluster()).thenReturn(cluster);
    argument = ArgumentCaptor.forClass(MembershipListener.class);
    when(cluster.addMembershipListener(argument.capture())).thenReturn("foo");
}
项目:Camel    文件:HazelcastInstanceConsumerTest.java   
@Override
protected void verifyHazelcastInstance(HazelcastInstance hazelcastInstance) {
    verify(hazelcastInstance).getCluster();
    verify(cluster).addMembershipListener(any(MembershipListener.class));
}
项目:DSC    文件:HazelcastListenerManager.java   
public static void addMemberListener(MembershipListener membershipListener){//添加成员事件监听
    instance.getCluster().addMembershipListener(membershipListener);
}
项目:DSC    文件:HazelcastService.java   
@Override
public void addMemberListener(MembershipListener mebershipListener) {
    HazelcastListenerManager.addMemberListener(mebershipListener);  
}
项目:hazelcast-archive    文件:ClusterImpl.java   
public void addMembershipListener(MembershipListener listener) {
    listeners.add(listener);
}
项目:hazelcast-archive    文件:ClusterImpl.java   
public void removeMembershipListener(MembershipListener listener) {
    listeners.remove(listener);
}
项目:hazelcast-archive    文件:MembershipListenerManager.java   
public void registerListener(MembershipListener listener) {
    this.memberShipListeners.add(listener);
}
项目:hazelcast-archive    文件:MembershipListenerManager.java   
public void removeListener(MembershipListener listener) {
    this.memberShipListeners.remove(listener);
}
项目:health-and-care-developer-network    文件:ClusterImpl.java   
public void addMembershipListener(MembershipListener listener) {
    listeners.add(listener);
}
项目:health-and-care-developer-network    文件:ClusterImpl.java   
public void removeMembershipListener(MembershipListener listener) {
    listeners.remove(listener);
}
项目:health-and-care-developer-network    文件:MembershipListenerManager.java   
public void registerListener(MembershipListener listener) {
    this.memberShipListeners.add(listener);
}
项目:health-and-care-developer-network    文件:MembershipListenerManager.java   
public void removeListener(MembershipListener listener) {
    this.memberShipListeners.remove(listener);
}
项目:reactive-data    文件:HazelcastInstanceProxy.java   
/**
 * Initialize with a member event listener, and broadcast message listener          
 * @param clusterListener
 * @param msgListener
 */
public void init(final MembershipListener clusterListener){

    hazelcast.getCluster().addMembershipListener(clusterListener);

}
项目:DSC    文件:IHazelcastService.java   
public void addMemberListener(MembershipListener mebershipListener);