Examples of ListenerConfig


Examples of com.hazelcast.config.ListenerConfig

    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.ListenerConfig

          // member of the cluster.
          h1.getMap("h").put(ensureKeyInHost(h1, m1), "m1");
          h1.getMap("h").put(ensureKeyInHost(h1, m2), "m2");
         
          final CountDownLatch latch = new CountDownLatch(2);
          c1.addListenerConfig(new ListenerConfig(new LifecycleListener() {
              public void stateChanged(final LifecycleEvent event) {
                System.out.println(event.getState());
                  if (event.getState() == LifecycleState.MERGED) {
                      System.out.println("h1 restarted");
                      latch.countDown();
                  }
              }
          }));
 
          c1.addListenerConfig(new ListenerConfig(new LifecycleListener() {
              public void stateChanged(final LifecycleEvent event) {
                System.out.println(event.getState());
                  if (event.getState() == LifecycleState.MERGED) {
                      System.out.println("h2 restarted");
                      latch.countDown();
View Full Code Here

Examples of com.hazelcast.config.ListenerConfig

          c4.getNetworkConfig().getJoin().getTcpIpConfig().setMembers(clusterTwoMembers);
 
          c4.setProperty(GroupProperties.PROP_WAIT_SECONDS_BEFORE_JOIN, "0");
 
          final CountDownLatch latch = new CountDownLatch(2);
          c3.addListenerConfig(new ListenerConfig(new LifecycleListener() {
              public void stateChanged(final LifecycleEvent event) {
                  if (event.getState() == LifecycleState.MERGED) {
                      System.out.println("h3 restarted");
                      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.ListenerConfig

 
          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.