org.apache.camel.component.zookeeper.operations
Class ChildrenChangedOperation

java.lang.Object
  extended by org.apache.camel.component.zookeeper.operations.ZooKeeperOperation<ResultType>
      extended by org.apache.camel.component.zookeeper.operations.FutureEventDrivenOperation<List<String>>
          extended by org.apache.camel.component.zookeeper.operations.ChildrenChangedOperation
All Implemented Interfaces:
WatchedEventProvider, org.apache.zookeeper.Watcher

public class ChildrenChangedOperation
extends FutureEventDrivenOperation<List<String>>

ChildrenChangedOperation is an watch driven operation. It will wait for an watched event indicating that the children associated with a given node have been modified before retrieving the changed list.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.zookeeper.Watcher
org.apache.zookeeper.Watcher.Event
 
Field Summary
 
Fields inherited from class org.apache.camel.component.zookeeper.operations.ZooKeeperOperation
connection, CONSTRUCTOR_ARGS, LOG, node, result, waitingThreads
 
Constructor Summary
ChildrenChangedOperation(org.apache.zookeeper.ZooKeeper connection, String znode)
           
ChildrenChangedOperation(org.apache.zookeeper.ZooKeeper connection, String znode, boolean getChangedListing)
           
 
Method Summary
 ZooKeeperOperation<?> createCopy()
           
 OperationResult<List<String>> getResult()
          Gets the result of this zookeeper operation, i.e.
protected  void installWatch()
          Install the watcher to receive WatchedEvents.
 
Methods inherited from class org.apache.camel.component.zookeeper.operations.FutureEventDrivenOperation
get, get, getWatchedEvent, getWatchedForTypes, process
 
Methods inherited from class org.apache.camel.component.zookeeper.operations.ZooKeeperOperation
cancel, getNode, isCancelled, isDone, shouldProduceExchange
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChildrenChangedOperation

public ChildrenChangedOperation(org.apache.zookeeper.ZooKeeper connection,
                                String znode)

ChildrenChangedOperation

public ChildrenChangedOperation(org.apache.zookeeper.ZooKeeper connection,
                                String znode,
                                boolean getChangedListing)
Method Detail

installWatch

protected void installWatch()
Description copied from class: FutureEventDrivenOperation
Install the watcher to receive WatchedEvents. It should use the appropriate asynchronous ZooKeeper call to do this so as not to block the route from starting. Once one of the watched for types of event is received a call is made to getResult, which can use the appropriate synchronous call to retrieve the actual data.

Specified by:
installWatch in class FutureEventDrivenOperation<List<String>>

getResult

public OperationResult<List<String>> getResult()
Description copied from class: ZooKeeperOperation
Gets the result of this zookeeper operation, i.e. some data and the associated node stats

Specified by:
getResult in class ZooKeeperOperation<List<String>>

createCopy

public ZooKeeperOperation<?> createCopy()
                                 throws Exception
Overrides:
createCopy in class ZooKeeperOperation<List<String>>
Throws:
Exception


Apache Camel