org.apache.camel.component.zookeeper.operations
Class ZooKeeperOperation<ResultType>

java.lang.Object
  extended by org.apache.camel.component.zookeeper.operations.ZooKeeperOperation<ResultType>
Direct Known Subclasses:
AnyOfOperations, CreateOperation, DeleteOperation, ExistsOperation, FutureEventDrivenOperation, GetChildrenOperation, GetDataOperation, SetDataOperation

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.


Field Summary
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 Summary
ZooKeeperOperation(org.apache.zookeeper.ZooKeeper connection, String node)
           
ZooKeeperOperation(org.apache.zookeeper.ZooKeeper connection, String node, boolean producesExchange)
           
 
Method Summary
 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()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

protected static final org.slf4j.Logger LOG

CONSTRUCTOR_ARGS

protected static final Class<?>[] CONSTRUCTOR_ARGS

node

protected String node

connection

protected org.apache.zookeeper.ZooKeeper connection

waitingThreads

protected Set<Thread> waitingThreads

result

protected OperationResult<ResultType> result
Constructor Detail

ZooKeeperOperation

public ZooKeeperOperation(org.apache.zookeeper.ZooKeeper connection,
                          String node)

ZooKeeperOperation

public ZooKeeperOperation(org.apache.zookeeper.ZooKeeper connection,
                          String node,
                          boolean producesExchange)
Method Detail

getResult

public abstract OperationResult<ResultType> getResult()
Gets the result of this zookeeper operation, i.e. some data and the associated node stats


get

public OperationResult<ResultType> get()
                                throws InterruptedException,
                                       ExecutionException
Throws:
InterruptedException
ExecutionException

get

public OperationResult<ResultType> get(long timeout,
                                       TimeUnit unit)
                                throws InterruptedException,
                                       ExecutionException,
                                       TimeoutException
Throws:
InterruptedException
ExecutionException
TimeoutException

cancel

public boolean cancel(boolean mayInterruptIfRunning)

isCancelled

public boolean isCancelled()

isDone

public boolean isDone()

getNode

public String getNode()

shouldProduceExchange

public boolean shouldProduceExchange()

createCopy

public ZooKeeperOperation<?> createCopy()
                                 throws Exception
Throws:
Exception


Apache Camel