public class CuratorFrameworkFactoryBean extends Object implements FactoryBean<org.apache.curator.framework.CuratorFramework>, SmartLifecycle
CuratorFramework
and implementing SmartLifecycle
.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 void setPhase(int phase)
phase
- the phaseSmartLifecycle
public boolean isAutoStartup()
isAutoStartup
in interface SmartLifecycle
public void setAutoStartup(boolean autoStartup)
autoStartup
- true to automatically startSmartLifecycle
public void stop(Runnable runnable)
stop
in interface SmartLifecycle
public org.apache.curator.framework.CuratorFramework getObject() throws Exception
getObject
in interface FactoryBean<org.apache.curator.framework.CuratorFramework>
Exception
public Class<?> getObjectType()
getObjectType
in interface FactoryBean<org.apache.curator.framework.CuratorFramework>
public boolean isSingleton()
isSingleton
in interface FactoryBean<org.apache.curator.framework.CuratorFramework>