org.I0Itec.zkclient
Interface IZkStateListener


public interface IZkStateListener


Method Summary
 void handleNewSession()
          Called after the zookeeper session has expired and a new session has been created.
 void handleSessionEstablishmentError(java.lang.Throwable error)
          Called when a session cannot be re-established.
 void handleStateChanged(org.apache.zookeeper.Watcher.Event.KeeperState state)
          Called when the zookeeper connection state has changed.
 

Method Detail

handleStateChanged

void handleStateChanged(org.apache.zookeeper.Watcher.Event.KeeperState state)
                        throws java.lang.Exception
Called when the zookeeper connection state has changed.

Parameters:
state - The new state.
Throws:
java.lang.Exception - On any error.

handleNewSession

void handleNewSession()
                      throws java.lang.Exception
Called after the zookeeper session has expired and a new session has been created. You would have to re-create any ephemeral nodes here.

Throws:
java.lang.Exception - On any error.

handleSessionEstablishmentError

void handleSessionEstablishmentError(java.lang.Throwable error)
                                     throws java.lang.Exception
Called when a session cannot be re-established. This should be used to implement connection failure handling e.g. retry to connect or pass the error up

Parameters:
error - The error that prevents a session from being established
Throws:
java.lang.Exception - On any error.