public synchronized boolean addReceiver(SpanReceiver receiver){
  SpanReceiver[] receivers=curReceivers;
  for (int i=0; i < receivers.length; i++) {
    if (receivers[i] == receiver) {
      LOG.trace(toString() + ": can't add receiver " + receiver.toString()+ " since it is already in this pool.");
      return false;
    }
  }
  SpanReceiver[] newReceivers=Arrays.copyOf(receivers,receivers.length + 1);
  newReceivers[receivers.length]=receiver;
  registerShutdownHookIfNeeded();
  curReceivers=newReceivers;
  LOG.trace(toString() + ": added receiver " + receiver.toString());
  return true;
}

public synchronized boolean addReceiver ( SpanReceiver receiver ) { SpanReceiver [ ] receivers = curReceivers ; for ( int i = 0 ; i < receivers . length ; i ++ ) { if ( receivers [ i ] == receiver ) { LOG . trace ( toString ( ) + ": can't add receiver " + receiver . toString ( ) + " since it is already in this pool." ) ; return false ; } } SpanReceiver [ ] newReceivers = Arrays . copyOf ( receivers , receivers . length + 1 ) ; newReceivers [ receivers . length ] = receiver ; registerShutdownHookIfNeeded ( ) ; curReceivers = newReceivers ; LOG . trace ( toString ( ) + ": added receiver " + receiver . toString ( ) ) ; return true ; }
add a new span receiver .
