Examples of InputPort


Examples of caltrop.interpreter.InputPort

    }

    private void _commitInputChannels() {
        for (Iterator iterator = _inputPorts.values().iterator(); iterator
                .hasNext();) {
            InputPort inputPort = (InputPort) iterator.next();

            for (int i = 0; i < inputPort.width(); i++) {
                DFInputChannel c = (DFInputChannel) inputPort.getChannel(i);
                c.commit();
            }
        }
    }
View Full Code Here

Examples of caltrop.interpreter.InputPort

    }

    private void _rollbackInputChannels() {
        for (Iterator iterator = _inputPorts.values().iterator(); iterator
                .hasNext();) {
            InputPort inputPort = (InputPort) iterator.next();

            for (int i = 0; i < inputPort.width(); i++) {
                DFInputChannel c = (DFInputChannel) inputPort.getChannel(i);
                c.rollback();
            }
        }
    }
View Full Code Here

Examples of eu.scape_project.planning.services.taverna.generator.model.InputPort

     *
     * @param depth
     *            the port depth
     */
    public void addSourcePort(int depth) {
        InputPort inputPort = new InputPort(SOURCE_PORT_NAME, depth,
            "&lt;&gt;    &lt;http://purl.org/DP/components#accepts&gt;\n"
                + "              &lt;http://purl.org/DP/components#SourceObject&gt; .");
        workflow.addInputPort(inputPort);
    }
View Full Code Here

Examples of eu.scape_project.planning.services.taverna.generator.model.InputPort

        // Input ports
        List<Port> inputPorts = workflowDescription.getInputPorts();
        for (Port p : inputPorts) {
            if (ComponentConstants.VALUE_SOURCE_OBJECT.equals(p.getValue())) {
                migration.addInputPort(new InputPort(p.getName(), 0));
                workflow.addDatalink(new Datalink(workflow, SOURCE_PORT_NAME, migration, p.getName()));
            } else if (ComponentConstants.VALUE_PARAMETER.equals(p.getValue())) {
                migration.addInputPort(new InputPort(p.getName(), 0));
                TextConstant c = new TextConstant(p.getName(), parameters.get(p.getName()));
                workflow.addProcessor(c);
                workflow.addDatalink(new Datalink(c, "value", migration, p.getName()));
            }
        }
View Full Code Here

Examples of eu.scape_project.planning.services.taverna.generator.model.InputPort

        // Input ports
        List<Port> inputPorts = workflowDescription.getInputPorts();
        for (Port p : inputPorts) {
            if (ComponentConstants.VALUE_LEFT_OBJECT.equals(p.getValue())) {
                if (leftSource == InputSource.SOURCE_OBJECT) {
                    qa.addInputPort(new InputPort(p.getName(), 0));
                    workflow.addDatalink(new Datalink(workflow, SOURCE_PORT_NAME, qa, p.getName()));
                } else if (leftSource == InputSource.TARGET_OBJECT) {
                    qa.addInputPort(new InputPort(p.getName(), 0));
                    workflow.addDatalink(new Datalink(migration, migrationTargetPortName, qa, p.getName()));
                }
            } else if (ComponentConstants.VALUE_RIGHT_OBJECT.equals(p.getValue())) {
                if (rightSource == InputSource.SOURCE_OBJECT) {
                    qa.addInputPort(new InputPort(p.getName(), 0));
                    workflow.addDatalink(new Datalink(workflow, SOURCE_PORT_NAME, qa, p.getName()));
                } else if (rightSource == InputSource.TARGET_OBJECT) {
                    qa.addInputPort(new InputPort(p.getName(), 0));
                    workflow.addDatalink(new Datalink(migration, migrationTargetPortName, qa, p.getName()));
                }
            } else if (ComponentConstants.VALUE_PARAMETER.equals(p.getValue())) {
                qa.addInputPort(new InputPort(p.getName(), 0));
                TextConstant c = new TextConstant(p.getName(), parameters.get(p.getName()));
                workflow.addProcessor(c);
                workflow.addDatalink(new Datalink(c, "value", qa, p.getName()));
            }
        }
View Full Code Here

Examples of eu.scape_project.planning.services.taverna.generator.model.InputPort

        // Input ports
        List<Port> inputPorts = workflowDescription.getInputPorts();
        for (Port p : inputPorts) {
            if (ComponentConstants.VALUE_SOURCE_OBJECT.equals(p.getValue())) {
                if (inputSource == InputSource.SOURCE_OBJECT && workflowDescription.handlesMimetype(sourceMimetype)) {
                    cc.addInputPort(new InputPort(p.getName(), 0));
                    workflow.addDatalink(new Datalink(workflow, SOURCE_PORT_NAME, cc, p.getName()));
                } else if (inputSource == InputSource.TARGET_OBJECT
                    && workflowDescription.handlesMimetype(targetMimetype)) {
                    cc.addInputPort(new InputPort(p.getName(), 0));
                    workflow.addDatalink(new Datalink(migration, migrationTargetPortName, cc, p.getName()));
                }
            } else if (ComponentConstants.VALUE_PARAMETER.equals(p.getValue())) {
                cc.addInputPort(new InputPort(p.getName(), 0));
                TextConstant c = new TextConstant(p.getName(), parameters.get(p.getName()));
                workflow.addProcessor(c);
                workflow.addDatalink(new Datalink(c, "value", cc, p.getName()));
            }
        }
View Full Code Here

Examples of javaflow.components.api.InputPort

    }

    @Override
    public InputPort<T> next() {
        InputPort port;
        int count = 0;
        while ((port = ports.port(nextIndex())).isClosed() && count < ports.size()) {
            count++;
        };
        if (port.isClosed()) {
            return ports.port(0);
        }
        return port;

    }
View Full Code Here

Examples of javaflow.components.api.InputPort

public class InputPortRoundRobinIteratorTest {

    @Test
    public void iteratorRunsPortsInRoundRobinStyle() {
        InputPorts ports = mock(InputPorts.class);
        InputPort port1 = mock(InputPort.class);
        InputPort port2 = mock(InputPort.class);
        when(ports.size()).thenReturn(2);
        when(ports.port(0)).thenReturn(port1);
        when(ports.port(1)).thenReturn(port2);
        when(port1.isClosed()).thenReturn(false);
        when(port2.isClosed()).thenReturn(false);

        Iterator<InputPort> outs = new InputPortRoundRobinIterator(ports);
        Assert.assertTrue(outs.hasNext());
        outs.next().receive();
        Assert.assertTrue(outs.hasNext());
View Full Code Here

Examples of javaflow.components.api.InputPort

    }

    @Test
    public void iteratorSkipsClosedPorts() {
        InputPorts ports = mock(InputPorts.class);
        InputPort port1 = mock(InputPort.class, "port #1");
        InputPort port2 = mock(InputPort.class, "port #2");
        InputPort port3 = mock(InputPort.class, "port #3");
        when(ports.size()).thenReturn(3);
        when(ports.port(0)).thenReturn(port1);
        when(ports.port(1)).thenReturn(port2);
        when(ports.port(2)).thenReturn(port3);

        when(port1.isClosed()).thenReturn(false);
        when(port2.isClosed()).thenReturn(true);
        when(port3.isClosed()).thenReturn(false);



        Iterator<InputPort> outs = new InputPortRoundRobinIterator(ports);
        Assert.assertTrue(outs.hasNext());
View Full Code Here

Examples of javaflow.components.api.InputPort

    }

    @Test
    public void hasNoNextIfAllPortsAreClosed() {
        InputPorts ports = mock(InputPorts.class);
        InputPort port1 = mock(InputPort.class, "port #1");
        InputPort port2 = mock(InputPort.class, "port #2");
        when(ports.size()).thenReturn(2);
        when(ports.port(0)).thenReturn(port1);
        when(ports.port(1)).thenReturn(port2);

        when(port1.isClosed()).thenReturn(true);
        when(port2.isClosed()).thenReturn(true);

        Iterator<InputPort> outs = new InputPortRoundRobinIterator(ports);
        Assert.assertFalse(outs.hasNext());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.