Package org.kiwiproject.curator
Class CuratorBundle<C extends io.dropwizard.Configuration & CuratorConfigured>
- java.lang.Object
-
- org.kiwiproject.curator.CuratorBundle<C>
-
- Type Parameters:
C- configuration class type
- All Implemented Interfaces:
io.dropwizard.ConfiguredBundle<C>
public class CuratorBundle<C extends io.dropwizard.Configuration & CuratorConfigured> extends Object implements io.dropwizard.ConfiguredBundle<C>
A Dropwizard bundle that creates aCuratorFrameworkinstance, wrapped in a DropwizardManagedinstance.Starts the
CuratorFrameworkimmediately, i.e. does not wait for Dropwizard to do it. Also, adds a health check (CuratorHealthCheck).
-
-
Constructor Summary
Constructors Constructor Description CuratorBundle()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.curator.framework.CuratorFrameworkgetClient()Once the bundle has been run, this will return theCuratorFramework.ManagedCuratorFrameworkgetManagedClient()Once the bundle has been run, this will return theManagedCuratorFramework.voidrun(C configuration, io.dropwizard.setup.Environment environment)
-
-
-
Method Detail
-
run
public void run(C configuration, io.dropwizard.setup.Environment environment)
- Specified by:
runin interfaceio.dropwizard.ConfiguredBundle<C extends io.dropwizard.Configuration & CuratorConfigured>
-
getManagedClient
public ManagedCuratorFramework getManagedClient()
Once the bundle has been run, this will return theManagedCuratorFramework.- Returns:
- the
ManagedCuratorFrameworkif run has been called, otherwisenull
-
getClient
public org.apache.curator.framework.CuratorFramework getClient()
Once the bundle has been run, this will return theCuratorFramework.- Returns:
- the
CuratorFrameworkif run has been called, otherwisenull
-
-