public boolean acceptInputPort(Port p) { if (p == null || p.getContainer() != this) { return false; } if (p instanceof ControlPort || !p.isInput()) { return false; } return PortMode.PUSH.equals(p.getMode()); }
@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()); }