Package com.hazelcast.core

Examples of com.hazelcast.core.MembershipAdapter


        final Node n1 = TestUtil.getNode(hz1);
        Node n2 = TestUtil.getNode(hz2);
        Node n3 = TestUtil.getNode(hz3);

        final CountDownLatch splitLatch = new CountDownLatch(2);
        MembershipAdapter membershipAdapter = new MembershipAdapter() {
            @Override
            public void memberRemoved(MembershipEvent event) {
                if (n1.getLocalMember().equals(event.getMember())) {
                    splitLatch.countDown();
                }
View Full Code Here


        Node n1 = TestUtil.getNode(hz1);
        Node n2 = TestUtil.getNode(hz2);
        final Node n3 = TestUtil.getNode(hz3);

        final CountDownLatch splitLatch = new CountDownLatch(2);
        MembershipAdapter membershipAdapter = new MembershipAdapter() {
            @Override
            public void memberRemoved(MembershipEvent event) {
                if (n3.getLocalMember().equals(event.getMember())) {
                    splitLatch.countDown();
                }
View Full Code Here

        assertTrue("Remaining count: " + nodeLatch.getCount(), nodeLatch.await(30, SECONDS));
        assertTrue("Remaining count: " + eventLatch.getCount(), eventLatch.await(30, SECONDS));
    }

    private static MembershipAdapter newAddMemberListener(final CountDownLatch eventLatch) {
        return new MembershipAdapter() {

            // flag to check listener is not called concurrently
            final AtomicBoolean flag = new AtomicBoolean(false);

            public void memberAdded(MembershipEvent membershipEvent) {
View Full Code Here

        final String queueName = randomString();
        final TransactionContext context = hz.newTransactionContext();
        CountDownLatch txnRollbackLatch = new CountDownLatch(1);
        final CountDownLatch memberRemovedLatch = new CountDownLatch(1);

        hz.getCluster().addMembershipListener(new MembershipAdapter() {
            @Override
            public void memberRemoved(MembershipEvent membershipEvent) {
                memberRemovedLatch.countDown();
            }
        });
View Full Code Here

        context.beginTransaction();

        final TransactionalQueue queue = context.getQueue(queueName);

        queue.offer(randomString());
        hz.getCluster().addMembershipListener(new MembershipAdapter() {
            @Override
            public void memberRemoved(MembershipEvent membershipEvent) {
                memberRemovedLatch.countDown();
            }
        });
View Full Code Here

TOP

Related Classes of com.hazelcast.core.MembershipAdapter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.