public class CuratorFrameworkFactoryBean extends Object implements FactoryBean<org.apache.curator.framework.CuratorFramework>, SmartLifecycle
CuratorFramework and implementing SmartLifecycle.DEFAULT_PHASE| Constructor and Description |
|---|
CuratorFrameworkFactoryBean(String connectionString)
Construct an instance using the supplied connection string and using a default
retry policy
new ExponentialBackoffRetry(1000, 3). |
CuratorFrameworkFactoryBean(String connectionString,
org.apache.curator.RetryPolicy retryPolicy)
Construct an instance using the supplied connection string and retry policy.
|
| Modifier and Type | Method and Description |
|---|---|
org.apache.curator.framework.CuratorFramework |
getObject() |
Class<?> |
getObjectType() |
int |
getPhase() |
boolean |
isAutoStartup() |
boolean |
isRunning() |
boolean |
isSingleton() |
void |
setAutoStartup(boolean autoStartup) |
void |
setPhase(int phase) |
void |
start() |
void |
stop() |
void |
stop(Runnable runnable) |
public CuratorFrameworkFactoryBean(String connectionString)
new ExponentialBackoffRetry(1000, 3).connectionString - list of servers to connect topublic CuratorFrameworkFactoryBean(String connectionString, org.apache.curator.RetryPolicy retryPolicy)
connectionString - list of servers to connect toretryPolicy - the retry policypublic int getPhase()
getPhase in interface PhasedgetPhase in interface SmartLifecyclepublic void setPhase(int phase)
phase - the phaseSmartLifecyclepublic boolean isAutoStartup()
isAutoStartup in interface SmartLifecyclepublic void setAutoStartup(boolean autoStartup)
autoStartup - true to automatically startSmartLifecyclepublic void stop(Runnable runnable)
stop in interface SmartLifecyclepublic org.apache.curator.framework.CuratorFramework getObject()
getObject in interface FactoryBean<org.apache.curator.framework.CuratorFramework>public Class<?> getObjectType()
getObjectType in interface FactoryBean<org.apache.curator.framework.CuratorFramework>public boolean isSingleton()
isSingleton in interface FactoryBean<org.apache.curator.framework.CuratorFramework>