private void serviceNotifyDo(ServiceItem oldItem,ServiceItem item,int action){
  ArrayList notifies;
synchronized (sItemListeners) {
    if (sItemListeners.isEmpty())     return;
    notifies=(ArrayList)sItemListeners.clone();
  }
  Iterator iter=notifies.iterator();
  while (iter.hasNext()) {
    ServiceDiscoveryListener sl=(ServiceDiscoveryListener)iter.next();
    serviceNotifyDo(oldItem,item,action,sl);
  }
}

private void serviceNotifyDo ( ServiceItem oldItem , ServiceItem item , int action ) { ArrayList notifies ; synchronized ( sItemListeners ) { if ( sItemListeners . isEmpty ( ) ) return ; notifies = ( ArrayList ) sItemListeners . clone ( ) ; } Iterator iter = notifies . iterator ( ) ; while ( iter . hasNext ( ) ) { ServiceDiscoveryListener sl = ( ServiceDiscoveryListener ) iter . next ( ) ; serviceNotifyDo ( oldItem , item , action , sl ) ; } }
common code for performing service notification to all listeners .
