public abstract class ZooKeeperOperation<ResultType> extends Object
ZooKeeperOperation
is the base class for wrapping various
ZooKeeper API instructions and callbacks into callable and composable operation
objects.Modifier and Type | Field and Description |
---|---|
protected org.apache.zookeeper.ZooKeeper |
connection |
protected static Class<?>[] |
CONSTRUCTOR_ARGS |
protected static org.slf4j.Logger |
LOG |
protected String |
node |
protected OperationResult<ResultType> |
result |
protected Set<Thread> |
waitingThreads |
Constructor and Description |
---|
ZooKeeperOperation(org.apache.zookeeper.ZooKeeper connection,
String node) |
ZooKeeperOperation(org.apache.zookeeper.ZooKeeper connection,
String node,
boolean producesExchange) |
Modifier and Type | Method and Description |
---|---|
boolean |
cancel(boolean mayInterruptIfRunning) |
ZooKeeperOperation<?> |
createCopy() |
OperationResult<ResultType> |
get() |
OperationResult<ResultType> |
get(long timeout,
TimeUnit unit) |
String |
getNode() |
abstract OperationResult<ResultType> |
getResult()
Gets the result of this zookeeper operation, i.e.
|
boolean |
isCancelled() |
boolean |
isDone() |
boolean |
shouldProduceExchange() |
protected static final org.slf4j.Logger LOG
protected static final Class<?>[] CONSTRUCTOR_ARGS
protected String node
protected org.apache.zookeeper.ZooKeeper connection
protected OperationResult<ResultType> result
public ZooKeeperOperation(org.apache.zookeeper.ZooKeeper connection, String node)
public ZooKeeperOperation(org.apache.zookeeper.ZooKeeper connection, String node, boolean producesExchange)
public abstract OperationResult<ResultType> getResult()
public OperationResult<ResultType> get() throws InterruptedException, ExecutionException
public OperationResult<ResultType> get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
public boolean cancel(boolean mayInterruptIfRunning)
public boolean isCancelled()
public boolean isDone()
public String getNode()
public boolean shouldProduceExchange()
public ZooKeeperOperation<?> createCopy() throws Exception
Exception
Apache Camel