public class ZooKeeperConnection extends Object
| Constructor and Description |
|---|
ZooKeeperConnection(String quorumAddresses) |
| Modifier and Type | Method and Description |
|---|---|
void |
deregisterObserver(ZooKeeperConnectionObserver observer) |
org.apache.zookeeper.ZooKeeper |
get() |
void |
registerObserver(ZooKeeperConnectionObserver observer) |
void |
reset()
Remove any preexisting ZooKeeper connection instance.
|
void |
shutdown() |
public ZooKeeperConnection(String quorumAddresses) throws IOException
IOExceptionpublic org.apache.zookeeper.ZooKeeper get()
throws IOException
IOExceptionpublic void shutdown()
public void registerObserver(ZooKeeperConnectionObserver observer)
public void deregisterObserver(ZooKeeperConnectionObserver observer)
public void reset()
This method should be called when the connection to the ZooKeeper is expired, so a subsequent call to
get() will establish a new connection.
Copyright © 2014–2016 Lable. All rights reserved.