Search in sources :

Example 1 with FutView

use of abs.backend.java.observing.FutView in project abstools by abstools.

the class SequenceDiagramVisualization method taskResumed.

@Override
public synchronized void taskResumed(TaskView task, GuardView guard) {
    if (!isObserved(task))
        return;
    if (guard.isFutureGuard()) {
        FutView fut = guard.getFuture();
        TaskView resolvingTask = fut.getResolvingTask();
        if (isObserved(resolvingTask)) {
            if (!waitingFutures.contains(fut) || resolvedFutures.contains(fut))
                return;
            resolvedFutures.add(fut);
            writeOut(getActorName(resolvingTask.getTarget()));
            writeOut("[" + "Task" + resolvingTask.getID() + "]");
            writeOut(":>");
            writeOut(getActorName(task.getTarget()));
            writeOut("[" + "Taskx" + resolvingTask.getID() + "]");
            writeOut(".resolved\\: ");
            writeOut(shorten(String.valueOf(fut.getValue())));
            writeOutLn();
            writeOut(getActorName(resolvingTask.getTarget()));
            writeOut("[" + "Task" + resolvingTask.getID() + "]");
            writeOut(":stop");
            writeOutLn();
            writeOut(getActorName(task.getTarget()));
            writeOut("[" + "Taskx" + resolvingTask.getID() + "]");
            writeOut(":stop");
            writeOutLn();
            writeOutLn("(" + fut.getID() + ") " + getActorName(task.getTarget()));
        }
    }
}
Also used : TaskView(abs.backend.java.observing.TaskView) FutView(abs.backend.java.observing.FutView)

Example 2 with FutView

use of abs.backend.java.observing.FutView in project abstools by abstools.

the class SequenceDiagramVisualization method taskSuspended.

@Override
public synchronized void taskSuspended(TaskView task, GuardView guard) {
    if (!isObserved(task))
        return;
    if (guard.isFutureGuard()) {
        FutView fut = guard.getFuture();
        if (isObserved(fut.getResolvingTask())) {
            waitingFutures.add(fut);
            String actorName = getActorName(task.getTarget());
            writeOutLn("*" + fut.getID() + " " + actorName);
            // writeOut(":");
            if (guard.isTrue()) {
                writeOut("yielding");
            } else {
                writeOut("waiting");
            }
            // writeOut(" on future "+fut.getID());
            writeOutLn();
            writeOutLn("*" + fut.getID());
            writeOutLn("(" + fut.getID() + ") " + actorName);
        }
    }
}
Also used : FutView(abs.backend.java.observing.FutView)

Aggregations

FutView (abs.backend.java.observing.FutView)2 TaskView (abs.backend.java.observing.TaskView)1