protected void fireClusterChange ( long timestamp , String type , String message ) { // if we have no listeners, do nothing... if ( listeners != null && ! listeners . isEmpty ( ) ) { // create the event object to send ClusterEvent event = new ClusterEvent ( this , timestamp , type , message ) ; // make a copy of the listener list in case // anyone adds/removes listeners Vector targets ; synchronized ( this ) { targets = ( Vector ) listeners . clone ( ) ; } // walk through the listener list and // call the sunMoved method in each Enumeration e = targets . elements ( ) ; while ( e . hasMoreElements ( ) ) { ClusterEventListener l = ( ClusterEventListener ) e . nextElement ( ) ; l . changeCluster ( event ) ; } } }
Fire a ClusterChangeEvent to all registered listeners