@ Override @ Synchronized public void addListener ( ClusterListener listener ) { Preconditions . checkNotNull ( listener , "listener" ) ; if ( ! cache . isPresent ( ) ) { initializeCache ( ) ; } cache . get ( ) . getListenable ( ) . addListener ( pathChildrenCacheListener ( listener ) ) ; }
Add Listener to the cluster .