Sea 0.4.0

gov.lbl.dsd.sea
Class StageManager

java.lang.Object
  extended bygov.lbl.dsd.sea.StageManager

public class StageManager
extends Object

Creates and manages a set of stages; Contains several default factories for commonly used threading policies. By far the most commonly used are QUEUED, POOLED and DIRECT.

Version:
$Revision: 1.17 $, $Date: 2004/09/16 16:57:15 $

Field Summary
static ExecutorFactory DIRECT
          Creates and returns DirectExecutor instances.
static ExecutorFactory POOLED
          Creates and returns PooledExecutor instances.
static ExecutorFactory QUEUED
          Creates and returns QueuedExecutor instances.
static ExecutorFactory THREADED
          Creates and returns ThreadedExecutor instances.
 
Constructor Summary
StageManager()
          Creates an instance with the default threading policy.
StageManager(ExecutorFactory executorFactory)
          Creates an instance with the given threading policy.
 
Method Summary
 Stage addStage(Stage stage)
          Adds the given stage to the set of managed stages.
 Stage createStage(EventHandler handler)
          Creates and returns a managed stage with the given event handler.
 Stage createStage(String stageName, EventHandler handler)
          Creates and returns a managed stage with the given name and event handler.
 Stage createStage(String stageName, EventHandler handler, ExceptionHandler exceptionHandler)
          Creates and returns a managed stage with the given name, event handler and exceptionHandler.
 Stage getStage(String stageName)
          Returns the managed stage with the given name, or null if no such stage is currently managed.
 void startAll()
          Starts all managed stages.
 void stopAll()
          Stops all managed stages.
 String toString()
          Returns a string representation of the receiver.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DIRECT

public static final ExecutorFactory DIRECT
Creates and returns DirectExecutor instances.


QUEUED

public static final ExecutorFactory QUEUED
Creates and returns QueuedExecutor instances.


THREADED

public static final ExecutorFactory THREADED
Creates and returns ThreadedExecutor instances.


POOLED

public static final ExecutorFactory POOLED
Creates and returns PooledExecutor instances.

Constructor Detail

StageManager

public StageManager()
Creates an instance with the default threading policy.


StageManager

public StageManager(ExecutorFactory executorFactory)
Creates an instance with the given threading policy.

Method Detail

addStage

public Stage addStage(Stage stage)
Adds the given stage to the set of managed stages.

Returns:
the same stage (for convenience)

createStage

public Stage createStage(EventHandler handler)
Creates and returns a managed stage with the given event handler.


createStage

public Stage createStage(String stageName,
                         EventHandler handler)
Creates and returns a managed stage with the given name and event handler.


createStage

public Stage createStage(String stageName,
                         EventHandler handler,
                         ExceptionHandler exceptionHandler)
Creates and returns a managed stage with the given name, event handler and exceptionHandler.


startAll

public void startAll()
Starts all managed stages.


stopAll

public void stopAll()
Stops all managed stages.


getStage

public Stage getStage(String stageName)
Returns the managed stage with the given name, or null if no such stage is currently managed.


toString

public String toString()
Returns a string representation of the receiver.


Sea 0.4.0