示例#1
0
 /**
  * If the uri passed ad parameter is equal to source uri of the term, the exchange e is sended to
  * terms internal endpoint
  */
 @Override
 public void setMessage(String uri, Exchange e) {
   // TODO Auto-generated method stub
   if (source_port.getUri().equals(uri)) {
     for (int i = 0; i < source_port.getId().size(); i++)
       producer.send(internal + "" + source_port.getId().get(i), e);
   }
 }
示例#2
0
 /**
  * Set external message as input of components terms. Message sending is preceded by simple
  * scanning: if the sub-term considered can receive message from indicated uri, message is simply,
  * forwarded; if the term is not linked with indicated uri, this quot term not forward nothing.
  */
 @Override
 public void setMessage(String uri, Exchange e) {
   // TODO Auto-generated method stub
   for (Iterator<Port> it = getSources().iterator(); it.hasNext(); ) {
     Port port = it.next();
     for (Iterator<Port> itd1 = d1.getSources().iterator(); itd1.hasNext(); ) {
       Port port_d1 = itd1.next();
       // scan all port of
       if (port.getUri().equals(port_d1.getUri())) {
         d1.setMessage(uri, e);
       }
     }
     for (Iterator<Port> itd2 = d2.getSources().iterator(); itd2.hasNext(); ) {
       Port port_d2 = itd2.next();
       if (port.getUri().equals(port_d2.getUri())) {
         d2.setMessage(uri, e);
       }
     }
   }
 }