Example #1
0
 /*
  * (non-Javadoc)
  * @see com.isencia.passerelle.actor.Actor#doInitialize()
  */
 @Override
 protected void doInitialize() throws InitializationException {
   // TODO Auto-generated method stub
   super.doInitialize();
   firstOperandHandler = new PortHandler(firstOperand);
   if (firstOperand.getWidth() > 0) {
     firstOperandHandler.start();
   }
   if (secondOperand != null) {
     secondOperandHandler = new PortHandler(secondOperand);
     if (secondOperand.getWidth() > 0) {
       secondOperandHandler.start();
     }
   }
 }
Example #2
0
  @Override
  @SuppressWarnings("unchecked")
  protected void doInitialize() throws InitializationException {
    getLogger().trace("{} - doInitialize() - entry", getFullName());
    super.doInitialize();

    blockingInputHandlers.clear();
    blockingInputFinishRequests.clear();

    iterationCount = 0;
    currentProcessRequest = new ProcessRequest();
    currentProcessRequest.setIterationCount(++iterationCount);
    currentProcessResponse = null;

    List<Port> inputPortList = this.inputPortList();
    for (Port _p : inputPortList) {
      if (_p.isInput() && !(_p instanceof ControlPort)) {
        if (_p.isBlocking()) {
          blockingInputHandlers.add(createPortHandler(_p));
          blockingInputFinishRequests.put(_p, Boolean.FALSE);
        }
        isSource = false;
      }
    }
    for (int i = 0; i < blockingInputHandlers.size(); ++i) {
      PortHandler h = blockingInputHandlers.get(i);
      if (h.getWidth() > 0) {
        blockingInputFinishRequests.put(h.getPort(), Boolean.FALSE);
        h.start();
      } else {
        blockingInputFinishRequests.put(h.getPort(), Boolean.TRUE);
      }
    }

    try {
      triggerFirstIteration();
    } catch (IllegalActionException e) {
      throw new InitializationException(
          ErrorCode.FLOW_EXECUTION_FATAL,
          "Error triggering a fire iteration for source actor " + getFullName(),
          this,
          e);
    }

    getLogger().trace("{} - doInitialize() - exit", getFullName());
  }