live.threads
Class SequentialRunner

java.lang.Object
  extended byjava.lang.Thread
      extended bylive.threads.ThreadedUserAction
          extended bylive.threads.Runner
              extended bylive.threads.SequentialRunner
All Implemented Interfaces:
Runnable

public class SequentialRunner
extends Runner

This is a runner that runs each of the threads in the container in sequence. This is used for tasks that are sequential, so that if a task fails all subsequent tasks should be cancelled. If you want a container that will try to run all tasks even if one fails but only lets one task be active at any given time, use ParallelRunner with an parallelism of 1. See (TODO) ParallelRunner's docs for specifics.

Author:
Evan Driscoll

Nested Class Summary
 
Nested classes inherited from class live.threads.ThreadedUserAction
 
Field Summary
 
Fields inherited from class live.threads.Runner
initInfo, taskList
 
Fields inherited from class live.threads.ThreadedUserAction
CANCELED, COMPLETE, done, ERROR, IN_PROGRESS, INDETERMINATE, PENDING, tasks
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
SequentialRunner(ThreadInitInfo initInfo, String description)
          Creates a new sequential runner class
 
Method Summary
protected  void runImpl()
          Starts the threads one at a time, cancels the rest of the threads if one fails
 
Methods inherited from class live.threads.Runner
description, init, init, rawResult, schedule, setCanceled
 
Methods inherited from class live.threads.ThreadedUserAction
getCache, getException, getID, getStatus, getTimeFinished, getTimeStarted, init, init, isFinished, result, run, setComplete, setError, setError, setIndeterminate, setIndeterminate, setInProgress, startJoinForever, startJoinTimeout, startNoJoin, toString
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SequentialRunner

public SequentialRunner(ThreadInitInfo initInfo,
                        String description)
Creates a new sequential runner class

Parameters:
initInfo - Information needed to start the thread
description - Description of the thread
Method Detail

runImpl

protected void runImpl()
                throws Exception
Starts the threads one at a time, cancels the rest of the threads if one fails

Specified by:
runImpl in class ThreadedUserAction
Throws:
Exception
See Also:
ThreadedUserAction.run()


Copyright © 2005