net.sf.asyncobjects.util
Class All

java.lang.Object
  extended by net.sf.asyncobjects.util.RunDispatcher
      extended by net.sf.asyncobjects.util.All
All Implemented Interfaces:
ExplicitSharing

public abstract class All
extends RunDispatcher

This control construct waits for all child actions. Note that all actions are started in this turn.


Field Summary
 
Fields inherited from class net.sf.asyncobjects.util.RunDispatcher
NO_FURTHER_ACTIONS
 
Constructor Summary
All()
          A constructor
 
Method Summary
protected  Promise<?> finallyDo()
          This callback is executed after all action finished and before result is returned.
 Promise<Object[]> promise()
           
protected  Object smashed(int action, Throwable problem)
          Handle fault on one of actions.
 
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
 

Constructor Detail

All

public All()
A constructor

Method Detail

smashed

protected Object smashed(int action,
                         Throwable problem)
                  throws Throwable
Handle fault on one of actions. By default just fail.

Parameters:
action - action number
problem - a problem
Returns:
a result to be returned
Throws:
Throwable - a problem that is used to smash result promise.

finallyDo

protected Promise<?> finallyDo()
                        throws Throwable
This callback is executed after all action finished and before result is returned.

Returns:
promise or null
Throws:
Throwable - if any problems happens

promise

public Promise<Object[]> promise()
Returns:
a result promise


Copyright 2002-2007 Constantine Plotnikov. All Rights Reserved.