Class ManagedCuratorFramework

  • All Implemented Interfaces:
    io.dropwizard.lifecycle.Managed

    public class ManagedCuratorFramework
    extends Object
    implements io.dropwizard.lifecycle.Managed
    A Dropwizard Managed that wraps a CuratorFramework instance, starting and stopping it automatically with the application.
    • Constructor Detail

      • ManagedCuratorFramework

        public ManagedCuratorFramework​(org.apache.curator.framework.CuratorFramework client)
        Create new instance that will manage the given client.
        Parameters:
        client - the CuratorFramework to manage
    • Method Detail

      • getUnderlyingClient

        public org.apache.curator.framework.CuratorFramework getUnderlyingClient()
        Returns:
        the managed CuratorFramework client
      • start

        public void start()
        Starts the managed CuratorFramework client if it is not started.
        Specified by:
        start in interface io.dropwizard.lifecycle.Managed
      • stop

        public void stop()
        Stops the managed CuratorFramework client if it is started.
        Specified by:
        stop in interface io.dropwizard.lifecycle.Managed