Package javaflow.network.impl

Source Code of javaflow.network.impl.TestDropAndSendComponent

package javaflow.network.impl;

import javaflow.components.api.Component;
import javaflow.components.api.InputPort;
import javaflow.components.api.OutputPort;
import javaflow.components.api.Packet;

public class TestDropAndSendComponent implements Component {

    InputPort in;
    OutputPort out;

    @Override
    public void execute() {
        try {
            Packet packet = in.receive();
            packet.drop();
            out.createPacket("testing").send();
            out.send(packet);
            // Expect exception to be thrown from sending dropped packet
            out.createPacket("failed").send();
        } catch (Throwable e) {
        }
    }
}
TOP

Related Classes of javaflow.network.impl.TestDropAndSendComponent

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.