- Type Parameters:
R - A result type
- All Implemented Interfaces:
public abstract class Seq<R>
- extends RunDispatcher
A sequence control construct. This construct ensures that next actions is
executed only if previous finished one way or another. If one of actions
fails, next are not executed. Seq is sequeduled to be executed on some later
turn because it reuses when construct. This also means that constructor
completes before construct is executed. The control construct attempts to
execute as much as possible in the single turn.
|Methods inherited from class net.sf.asyncobjects.util.RunDispatcher
run1, run10, run11, run12, run13, run14, run15, run16, run2, run3, run4, run5, run6, run7, run8, run9, runNext
|Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
- A constructor. Constructors schedule execution of this seq construct.
protected Promise<R> smashed(int action,
- Handle fault on one of actions. By default just fail.
action - action number
problem - a problem
- a result to be returned
Throwable - a problem that is used to smash result promise.
protected Promise<?> finallyDo()
- This method is executed when all actions are finished. The method does
not affect return value, however it can generate a fault that will be
reflected in execution result.
- a promise or null which means that there is no finally action
Throwable - that will be result of Seq
public Promise<R> promise()
- a promise for this sequence of actions
Copyright © 2002-2007 Constantine Plotnikov. All Rights Reserved.