Package com.hazelcast.core

Examples of com.hazelcast.core.HazelcastInstance.shutdown()


        removed.setExpectedMessageCount(1);

        HazelcastInstance h1 = Hazelcast.newHazelcastInstance(null);

        // TODO --> check how an instance can be killed...
        h1.shutdown();

        assertMockEndpointsSatisfied(5000, TimeUnit.MILLISECONDS);

        // check headers
        Exchange ex = removed.getExchanges().get(0);
View Full Code Here


        removed.setExpectedMessageCount(1);

        HazelcastInstance h1 = Hazelcast.newHazelcastInstance(null);

        // TODO --> check how an instance can be killed...
        h1.shutdown();

        assertMockEndpointsSatisfied(5000, TimeUnit.MILLISECONDS);

        // check headers
        Exchange ex = removed.getExchanges().get(0);
View Full Code Here

                countDownLatch.countDown();
            }
        };
        thread.start();

        instance2.shutdown();
        semaphore.release();

        HazelcastInstance instance3 = factory.newHazelcastInstance();
        ISemaphore semaphore1 = instance3.getSemaphore("test");
        semaphore1.release();
View Full Code Here

        String partitionKey = generateKeyOwnedBy(remote);
        int partitionId = localNode.nodeEngine.getPartitionService().getPartitionId(partitionKey);
        Future f = service.createInvocationBuilder(null, op, partitionId).setCallTimeout(30000).invoke();
        sleepSeconds(1);

        remote.shutdown();

        //the get should work without a problem because the operation should be re-targeted at the newest owner
        //for that given partition
        f.get();
    }
View Full Code Here

        Operation op = new TargetOperation();
        Address address = new Address(remote.getCluster().getLocalMember().getSocketAddress());
        Future f = service.createInvocationBuilder(null, op, address).invoke();
        sleepSeconds(1);

        remote.shutdown();

        try {
            f.get();
            fail();
        } catch (MemberLeftException expected) {
View Full Code Here

        public void run() {
            while (!stop) {
                try {
                    Thread.sleep(10000);
                    HazelcastInstance hz = queue.take();
                    hz.shutdown();
                    queue.add(createHazelcastInstance());
                } catch (InterruptedException e) {
                }
            }
        }
View Full Code Here

        };
        awaitThread.start();

        // give the awaitthread some time to get in the waiting state
        sleepSeconds(5);
        instance.shutdown();
        awaitThread.assertFailsEventually(HazelcastInstanceNotActiveException.class);
    }
    // ================= simple usage =================================================

    @Test
View Full Code Here

                // and subtract the number from expectedValue.
                final int thrownExceptionCount = exceptionCount.get();
                final long expectedValue = (long) 100 + (i + 1) * parallel - thrownExceptionCount;
                IAtomicLong newAtomicLong = instance.getAtomicLong(name);
                assertEquals(expectedValue, newAtomicLong.get());
                instance.shutdown();
                instance = instances[0];
            }
        } finally {
            ex.shutdownNow();
        }
View Full Code Here

        assertMembershipAddedEvent(listener.events.get(0), hz2.getCluster().getLocalMember(),
                hz1.getCluster().getLocalMember(), hz2.getCluster().getLocalMember());

        //terminate the second instance
        Member member2 = hz2.getCluster().getLocalMember();
        hz2.shutdown();

        assertEventuallySizeAtLeast(listener.events, 2);
        assertMembershipRemovedEvent(listener.events.get(1), member2, hz1.getCluster().getLocalMember());
    }
View Full Code Here

        assertEventuallySizeAtLeast(listener.events, 2);
        assertMembershipAddedEvent(listener.events.get(1), hz2.getCluster().getLocalMember(),
                hz1.getCluster().getLocalMember(), hz2.getCluster().getLocalMember());

        Member member2 = hz2.getCluster().getLocalMember();
        hz2.shutdown();

        assertEventuallySizeAtLeast(listener.events, 3);
        assertMembershipRemovedEvent(listener.events.get(2), member2, hz1.getCluster().getLocalMember());
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.