Search in sources :

Example 6 with MemberAttributeEvent

use of com.hazelcast.core.MemberAttributeEvent in project hazelcast by hazelcast.

the class AbstractListenersOnReconnectTest method testListenersTerminateRandomNode.

private void testListenersTerminateRandomNode() {
    setupListener();
    terminateRandomNode();
    HazelcastClientInstanceImpl clientInstanceImpl = getHazelcastClientInstanceImpl(client);
    final CountDownLatch memberAddedLatch = new CountDownLatch(1);
    clientInstanceImpl.getClientClusterService().addMembershipListener(new MembershipListener() {

        @Override
        public void memberAdded(MembershipEvent membershipEvent) {
            memberAddedLatch.countDown();
        }

        @Override
        public void memberRemoved(MembershipEvent membershipEvent) {
        }

        @Override
        public void memberAttributeChanged(MemberAttributeEvent memberAttributeEvent) {
        }
    });
    factory.newHazelcastInstance();
    assertOpenEventually(memberAddedLatch);
    validateRegistrationsAndListenerFunctionality();
}
Also used : MemberAttributeEvent(com.hazelcast.core.MemberAttributeEvent) MembershipEvent(com.hazelcast.core.MembershipEvent) HazelcastClientInstanceImpl(com.hazelcast.client.impl.HazelcastClientInstanceImpl) CountDownLatch(java.util.concurrent.CountDownLatch) MembershipListener(com.hazelcast.core.MembershipListener)

Aggregations

MemberAttributeEvent (com.hazelcast.core.MemberAttributeEvent)6 MembershipEvent (com.hazelcast.core.MembershipEvent)3 MembershipListener (com.hazelcast.core.MembershipListener)3 CountDownLatch (java.util.concurrent.CountDownLatch)3 Config (com.hazelcast.config.Config)2 ListenerConfig (com.hazelcast.config.ListenerConfig)2 HazelcastInstance (com.hazelcast.core.HazelcastInstance)2 HazelcastClientInstanceImpl (com.hazelcast.client.impl.HazelcastClientInstanceImpl)1 MemberAttributeOperationType (com.hazelcast.cluster.MemberAttributeOperationType)1 JoinConfig (com.hazelcast.config.JoinConfig)1 NetworkConfig (com.hazelcast.config.NetworkConfig)1 HazelcastInstanceNotActiveException (com.hazelcast.core.HazelcastInstanceNotActiveException)1 Member (com.hazelcast.core.Member)1 AbstractMember (com.hazelcast.instance.AbstractMember)1 HazelcastInstanceFactory.newHazelcastInstance (com.hazelcast.instance.HazelcastInstanceFactory.newHazelcastInstance)1 EventRegistration (com.hazelcast.spi.EventRegistration)1 EventService (com.hazelcast.spi.EventService)1 MemberAttributeServiceEvent (com.hazelcast.spi.MemberAttributeServiceEvent)1 MembershipAwareService (com.hazelcast.spi.MembershipAwareService)1 TestHazelcastInstanceFactory (com.hazelcast.test.TestHazelcastInstanceFactory)1