Examples of addListenerConfig()


Examples of com.hazelcast.config.Config.addListenerConfig()

     */
    @Test
    public void testDeadTaker() throws Exception {
        Config config = new Config();
        final CountDownLatch shutdownLatch = new CountDownLatch(1);
        config.addListenerConfig(new ListenerConfig().setImplementation(new MembershipListener() {
            public void memberAdded(MembershipEvent membershipEvent) {
            }

            public void memberRemoved(MembershipEvent membershipEvent) {
                shutdownLatch.countDown();
View Full Code Here

Examples of com.hazelcast.config.Config.addListenerConfig()

    c4.getNetworkConfig().getJoin().getTcpIpConfig().setMembers(clusterTwoMembers);

    c4.setProperty(GroupProperties.PROP_WAIT_SECONDS_BEFORE_JOIN, "0");

    final CountDownLatch latch = new CountDownLatch(1);
    c4.addListenerConfig(new ListenerConfig(new LifecycleListener() {
      public void stateChanged(final LifecycleEvent event) {
        if(event.getState() == LifecycleState.MERGED) {
          System.out.println("h4 restarted");
          latch.countDown();
        }
View Full Code Here

Examples of com.hazelcast.config.Config.addListenerConfig()

                      latch.countDown();
                  }
              }
          }));
 
          c4.addListenerConfig(new ListenerConfig(new LifecycleListener() {
              public void stateChanged(final LifecycleEvent event) {
                  if (event.getState() == LifecycleState.MERGED) {
                      System.out.println("h4 restarted");
                      latch.countDown();
                  }
View Full Code Here

Examples of com.hazelcast.config.Config.addListenerConfig()

 
          final HazelcastInstance h1 = Hazelcast.newHazelcastInstance(c1);
          final HazelcastInstance h2 = Hazelcast.newHazelcastInstance(c2);
 
          final CountDownLatch latch = new CountDownLatch(1);
          c3.addListenerConfig(new ListenerConfig(new LifecycleListener() {
              public void stateChanged(final LifecycleEvent event) {
                  if (event.getState() == LifecycleState.MERGED) {
                      h1.getLifecycleService().shutdown();
                  } else if (event.getState() == LifecycleState.MERGED) {
                      System.out.println("h3 restarted");
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.