org.exolab.jmscts.core
Class ThreadedActions

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--org.exolab.jmscts.core.ThreadedAction
              |
              +--org.exolab.jmscts.core.ThreadedActions
All Implemented Interfaces:
java.lang.Runnable

public class ThreadedActions
extends ThreadedAction

Helper class to run and wait for completion of a set of ThreadedAction instances.

Version:
$Revision: 1.3 $ $Date: 2004/01/31 13:44:24 $
Author:
Tim Anderson

Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
ThreadedActions()
          Construct a new ThreadedActions
 
Method Summary
 void addAction(ThreadedAction action)
          Add an action to be started and monitored by this
 java.lang.Exception getException()
          Returns any exception thrown by runProtected().
 void runProtected()
          Run the actions in separate threads
 
Methods inherited from class org.exolab.jmscts.core.ThreadedAction
getElapsedTime, run, setException, waitForCompletion, waitForCompletion
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ThreadedActions

public ThreadedActions()
Construct a new ThreadedActions
Method Detail

addAction

public void addAction(ThreadedAction action)
Add an action to be started and monitored by this
Parameters:
action - the action to add

runProtected

public void runProtected()
                  throws java.lang.Exception
Run the actions in separate threads
Overrides:
runProtected in class ThreadedAction
Throws:
java.lang.Exception - for any error

getException

public java.lang.Exception getException()
Returns any exception thrown by runProtected(). If null returns any exception thrown by a child action, otherwise null, if no exception was thrown
Overrides:
getException in class ThreadedAction
Returns:
any exception thrown, or null, if none was thrown


Copyright © 2001-2004 JMS CTS Team. All Rights Reserved.