Example usage for org.apache.commons.javaflow Continuation value

List of usage examples for org.apache.commons.javaflow Continuation value

Introduction

In this page you can find the example usage for org.apache.commons.javaflow Continuation value.

Prototype

public Object value() 

Source Link

Document

Accessor for value yielded by continuation

Usage

From source file:org.shelloid.netverif.NetVerifEngine.java

public void start() {
    Iterator<Agent> it = agents.iterator();
    while (it.hasNext()) {
        Agent agent = it.next();//from  w  ww.j  av a  2  s .c  o  m
        Continuation c = Continuation.startSuspendedWith(agent.getRoutine());
        Event e = new Event(agent, c, new EventMeta(EventMeta.REASON.AGENT_START, null, null));
        events.addLast(e);
    }
    while (!events.isEmpty()) {
        Event e = events.removeFirst();
        this.setCurrentHost(e.getAgent().getHost());
        Continuation c = Continuation.continueWith(e.getContinuation());
        if (c != null) {
            EventMeta m = (EventMeta) c.value();
            processEvent(new Event(e.getAgent(), c, m));
        }
    }
}