if (log.isDebugEnabled()) log.debug("AggPlugin:("+me+"):receiveMessage");
if (log != null && log.isDebugEnabled()) log.debug("AggPlugin:("+me+"):receiveMessage");
  private void receiveMessage(AggRelay relay) {    try {      if (log.isDebugEnabled()) log.debug("AggPlugin:("+me+"):receiveMessage");      XMLMessage xmsg = (XMLMessage)relay.getResponse();      Element root = XmlUtils.parse(xmsg.getText());      String requestName = root.getNodeName();      //      // Handle a response to one of my previous queries      //      UpdateDelta delta = new UpdateDelta(root);       String updatedQuery = delta.getQueryId();      String updatedCluster = delta.getAgentId();      if (log.isDebugEnabled())        log.debug("AggPlugin ("+me+")Received a message at " +        getAgentIdentifier() +        " --- Query update to :" + updatedQuery + " from " + updatedCluster);      // find query result adapter on blackboard      Iterator updatedQueries = getBlackboardService().query(        new QueryRAFinder(updatedQuery)).iterator();      if (updatedQueries.hasNext()) {        QueryResultAdapter qra = (QueryResultAdapter)updatedQueries.next();        // update query result set based on reported changes        qra.updateResults(delta);        // publish changes to blackboard        getBlackboardService().publishChange(qra);        // Am I done with thie relay?        if (qra.getQuery().getType().equals(QueryType.TRANSIENT))            getBlackboardService().publishRemove(relay);      }      else {        if (log.isErrorEnabled())        log.error("AggPlugin: unable to find query ID: "+updatedQuery);      }    } catch (Exception ex) {      System.err.println("Error receiving message");      ex.printStackTrace();    }  }