Ejemplo n.º 1
0
 /**
  * Perform a conditional rendezvous on any <i>input</i> channel, and then take the resulting token
  * and send it via rendezvous on the <i>output</i>.
  *
  * @exception IllegalActionException If an error occurs during executing the process.
  * @exception TerminateProcessException If the process termination is requested by the director.
  */
 public void fire() throws IllegalActionException {
   super.fire();
   Director director = getDirector();
   if (!(director instanceof RendezvousDirector)) {
     throw new IllegalActionException(this, "Barrier can only be used with RendezvousDirector.");
   }
   if (_debugging) {
     _debug("Ready to rendezvous with an input.");
   }
   /*Token received = RendezvousReceiver.getFromAny(
   input.getReceivers(), (RendezvousDirector)director);
   if (_debugging) {
   _debug("Received input: " + received);
   _debug("Sending to the output.");
   }
   output.send(0, received);*/
   RendezvousReceiver.getFromAnyPutToAll(
       input.getReceivers(), output.getRemoteReceivers(), (RendezvousDirector) director);
 }