public void addOnReconnectListener(OnReconnect listener){
  if (listener != null) {
synchronized (reconnectListeners) {
      reconnectListeners.add(listener);
      log.debug("Added new OnReconnect listener " + listener);
    }
  }
}

public void addOnReconnectListener ( OnReconnect listener ) { if ( listener != null ) { synchronized ( reconnectListeners ) { reconnectListeners . add ( listener ) ; log . debug ( "Added new OnReconnect listener " + listener ) ; } } }
add a listener to be notified once there is a new session created after a zookeeper session expiration occurs ; in most cases , listeners will be components that have watchers that need to be re - created .
