org.I0Itec.zkclient
Class ContentWatcher<T>

java.lang.Object
  extended by org.I0Itec.zkclient.ContentWatcher<T>
Type Parameters:
T - The data type that is being watched.
All Implemented Interfaces:
IZkDataListener

public final class ContentWatcher<T>
extends java.lang.Object
implements IZkDataListener


Constructor Summary
ContentWatcher(ZkClient zkClient, java.lang.String fileName)
           
 
Method Summary
 T getContent()
           
 void handleDataChange(java.lang.String dataPath, java.lang.Object data)
           
 void handleDataDeleted(java.lang.String dataPath)
           
 void setContent(T data)
           
 void start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContentWatcher

public ContentWatcher(ZkClient zkClient,
                      java.lang.String fileName)
Method Detail

start

public void start()

stop

public void stop()

setContent

public void setContent(T data)

handleDataChange

public void handleDataChange(java.lang.String dataPath,
                             java.lang.Object data)
Specified by:
handleDataChange in interface IZkDataListener

handleDataDeleted

public void handleDataDeleted(java.lang.String dataPath)
Specified by:
handleDataDeleted in interface IZkDataListener

getContent

public T getContent()
             throws java.lang.InterruptedException
Throws:
java.lang.InterruptedException