public void addPeerDiscovery(PeerDiscovery peerDiscovery){
  lock.lock();
  try {
    if (getMaxConnections() == 0)     setMaxConnections(DEFAULT_CONNECTIONS);
    peerDiscoverers.add(peerDiscovery);
  }
  finally {
    lock.unlock();
  }
}

public void addPeerDiscovery ( PeerDiscovery peerDiscovery ) { lock . lock ( ) ; try { if ( getMaxConnections ( ) == 0 ) setMaxConnections ( DEFAULT_CONNECTIONS ) ; peerDiscoverers . add ( peerDiscovery ) ; } finally { lock . unlock ( ) ; } }
add addresses from a discovery source to the list of potential peers to connect to . if max connections has not been configured , or set to zero , then it ' s set to the default at this point .
