public void addWatcher ( String name , Watcher watcher ) { if ( LOGGER . isTraceEnabled ( ) ) { LOGGER . trace ( "Add a watcher, name={}" , name ) ; } synchronized ( watchers ) { if ( watchers . containsKey ( name ) ) { watchers . get ( name ) . add ( watcher ) ; } else { Set < Watcher > set = new HashSet < Watcher > ( ) ; set . add ( watcher ) ; watchers . put ( name , set ) ; } } }
Add a Watcher for the Service .