public class ConnectionStateManager extends Object implements Closeable
| Constructor and Description |
|---|
ConnectionStateManager(CuratorFramework client,
ThreadFactory threadFactory) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addStateChange(ConnectionState newConnectionState)
Post a state change.
|
void |
close() |
ListenerContainer<ConnectionStateListener> |
getListenable()
Return the listenable
|
boolean |
setToSuspended()
Change to
ConnectionState.SUSPENDED only if not already suspended and not lost |
void |
start()
Start the manager
|
public ConnectionStateManager(CuratorFramework client, ThreadFactory threadFactory)
client - the clientthreadFactory - thread factory to use or null for a defaultpublic void start()
public void close()
close in interface Closeableclose in interface AutoCloseablepublic ListenerContainer<ConnectionStateListener> getListenable()
public boolean setToSuspended()
ConnectionState.SUSPENDED only if not already suspended and not lostpublic boolean addStateChange(ConnectionState newConnectionState)
newConnectionState - new stateCopyright © 2011–2014 The Apache Software Foundation. All rights reserved.