PingRequest pr = sensorFactory.newPingRequest(agentId, qe.agent, qe.timeout); pingsInProcess.put(pr.getUID(), qe.listener); logger.debug("sendPing: " + pr); blackboard.publishAdd(pr);
MessageAddress agentsToPing[] = (MessageAddress[]) qe.agentsToPing. toArray(new MessageAddress[0]); for (int i = 0; i < agentsToPing.length; i++) { PingRequest pr = sensorFactory.newPingRequest(agentId, agentsToPing[i], qe.timeout); pingsInProcess.put(pr.getUID(), qe);  if (agentsToPing[i].equals(agentId)) { pingComplete(pr.getUID(), agentsToPing[i], PingResult.SUCCESS, 0l); } else { blackboard.publishAdd(pr); } }
  private void sendPings() {    List l = new ArrayList();    while ((MAX_CONCURRENT_PINGS == -1 ||           pingsInProcess.size() < MAX_CONCURRENT_PINGS) &&           !pingQueue.isEmpty()) {      QueueEntry qe = (QueueEntry) pingQueue.remove(0);      PingRequest pr = sensorFactory.newPingRequest(agentId,          qe.agent,          qe.timeout);      pingsInProcess.put(pr.getUID(), qe.listener);      logger.debug("sendPing: " + pr);      blackboard.publishAdd(pr);    }  }