Class AfterConnectionEstablished


  • public class AfterConnectionEstablished
    extends java.lang.Object
    Utility class to allow execution of logic once a ZooKeeper connection becomes available.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.concurrent.Future<?> execute​(org.apache.curator.framework.CuratorFramework client, java.lang.Runnable runAfterConnection)
      Spawns a new new background thread that will block until a connection is available and then execute the 'runAfterConnection' logic
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • execute

        public static java.util.concurrent.Future<?> execute​(org.apache.curator.framework.CuratorFramework client,
                                                             java.lang.Runnable runAfterConnection)
                                                      throws java.lang.Exception
        Spawns a new new background thread that will block until a connection is available and then execute the 'runAfterConnection' logic
        Parameters:
        client - The curator client
        runAfterConnection - The logic to run
        Returns:
        future of the task so it can be canceled, etc. if needed
        Throws:
        java.lang.Exception