Class CuratorFrameworkFactoryBean

java.lang.Object
org.springframework.integration.zookeeper.config.CuratorFrameworkFactoryBean
All Implemented Interfaces:
org.springframework.beans.factory.FactoryBean<org.apache.curator.framework.CuratorFramework>, org.springframework.context.Lifecycle, org.springframework.context.Phased, org.springframework.context.SmartLifecycle

public class CuratorFrameworkFactoryBean
extends java.lang.Object
implements org.springframework.beans.factory.FactoryBean<org.apache.curator.framework.CuratorFramework>, org.springframework.context.SmartLifecycle
A Spring-friendly way to build a CuratorFramework and implementing SmartLifecycle.
Since:
4.2
  • Field Summary

    Fields inherited from interface org.springframework.beans.factory.FactoryBean

    OBJECT_TYPE_ATTRIBUTE

    Fields inherited from interface org.springframework.context.SmartLifecycle

    DEFAULT_PHASE
  • Constructor Summary

    Constructors 
    Constructor Description
    CuratorFrameworkFactoryBean​(java.lang.String connectionString)
    Construct an instance using the supplied connection string and using a default retry policy new ExponentialBackoffRetry(1000, 3).
    CuratorFrameworkFactoryBean​(java.lang.String connectionString, org.apache.curator.RetryPolicy retryPolicy)
    Construct an instance using the supplied connection string and retry policy.
  • Method Summary

    Modifier and Type Method Description
    org.apache.curator.framework.CuratorFramework getObject()  
    java.lang.Class<?> getObjectType()  
    int getPhase()  
    boolean isAutoStartup()  
    boolean isRunning()  
    void setAutoStartup​(boolean autoStartup)  
    void setPhase​(int phase)  
    void start()  
    void stop()  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.springframework.beans.factory.FactoryBean

    isSingleton

    Methods inherited from interface org.springframework.context.SmartLifecycle

    stop
  • Constructor Details

    • CuratorFrameworkFactoryBean

      public CuratorFrameworkFactoryBean​(java.lang.String connectionString)
      Construct an instance using the supplied connection string and using a default retry policy new ExponentialBackoffRetry(1000, 3).
      Parameters:
      connectionString - list of servers to connect to
    • CuratorFrameworkFactoryBean

      public CuratorFrameworkFactoryBean​(java.lang.String connectionString, org.apache.curator.RetryPolicy retryPolicy)
      Construct an instance using the supplied connection string and retry policy.
      Parameters:
      connectionString - list of servers to connect to
      retryPolicy - the retry policy
  • Method Details

    • getPhase

      public int getPhase()
      Specified by:
      getPhase in interface org.springframework.context.Phased
      Specified by:
      getPhase in interface org.springframework.context.SmartLifecycle
    • setPhase

      public void setPhase​(int phase)
      Parameters:
      phase - the phase
      See Also:
      SmartLifecycle
    • isRunning

      public boolean isRunning()
      Specified by:
      isRunning in interface org.springframework.context.Lifecycle
    • isAutoStartup

      public boolean isAutoStartup()
      Specified by:
      isAutoStartup in interface org.springframework.context.SmartLifecycle
    • setAutoStartup

      public void setAutoStartup​(boolean autoStartup)
      Parameters:
      autoStartup - true to automatically start
      See Also:
      SmartLifecycle
    • start

      public void start()
      Specified by:
      start in interface org.springframework.context.Lifecycle
    • stop

      public void stop()
      Specified by:
      stop in interface org.springframework.context.Lifecycle
    • getObject

      public org.apache.curator.framework.CuratorFramework getObject()
      Specified by:
      getObject in interface org.springframework.beans.factory.FactoryBean<org.apache.curator.framework.CuratorFramework>
    • getObjectType

      public java.lang.Class<?> getObjectType()
      Specified by:
      getObjectType in interface org.springframework.beans.factory.FactoryBean<org.apache.curator.framework.CuratorFramework>