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

java.lang.Object
  extended by org.apache.camel.component.zookeeper.operations.ZooKeeperOperation<ResultType>
      extended by org.apache.camel.component.zookeeper.operations.FutureEventDrivenOperation<byte[]>
          extended by org.apache.camel.component.zookeeper.operations.DataChangedOperation
All Implemented Interfaces:
WatchedEventProvider, org.apache.zookeeper.Watcher

public class DataChangedOperation
extends FutureEventDrivenOperation<byte[]>

DataChangedOperation is an watch driven operation. It will wait for an watched event indicating that the data contained in a given node has changed before optionally retrieving the changed data.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.zookeeper.Watcher
org.apache.zookeeper.Watcher.Event
 
Field Summary
protected static Class[] CONSTRUCTOR_ARGS
           
 
Fields inherited from class org.apache.camel.component.zookeeper.operations.ZooKeeperOperation
connection, LOG, node, result, waitingThreads
 
Constructor Summary
DataChangedOperation(org.apache.zookeeper.ZooKeeper connection, String znode, boolean getChangedData)
           
DataChangedOperation(org.apache.zookeeper.ZooKeeper connection, String znode, boolean getChangedData, boolean sendEmptyMessageOnDelete)
           
 
Method Summary
 ZooKeeperOperation<?> createCopy()
           
 OperationResult<byte[]> 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
 

Field Detail

CONSTRUCTOR_ARGS

protected static final Class[] CONSTRUCTOR_ARGS
Constructor Detail

DataChangedOperation

public DataChangedOperation(org.apache.zookeeper.ZooKeeper connection,
                            String znode,
                            boolean getChangedData)

DataChangedOperation

public DataChangedOperation(org.apache.zookeeper.ZooKeeper connection,
                            String znode,
                            boolean getChangedData,
                            boolean sendEmptyMessageOnDelete)
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<byte[]>

getResult

public OperationResult<byte[]> 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<byte[]>

createCopy

public ZooKeeperOperation<?> createCopy()
                                 throws Exception
Overrides:
createCopy in class ZooKeeperOperation<byte[]>
Throws:
Exception


Apache Camel