public class CuratorFrameworkFactoryBean extends Object implements FactoryBean<org.apache.curator.framework.CuratorFramework>, SmartLifecycle
CuratorFramework
and implementing SmartLifecycle
.OBJECT_TYPE_ATTRIBUTE
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() |
void |
setAutoStartup(boolean autoStartup) |
void |
setPhase(int phase) |
void |
start() |
void |
stop() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isSingleton
stop
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 Phased
getPhase
in interface SmartLifecycle
public 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 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>