com.ibm.jusb.util
Class RunnableManager.SynchronizedRunnableManager

java.lang.Object
  extended by com.ibm.jusb.util.RunnableManager
      extended by com.ibm.jusb.util.RunnableManager.SynchronizedRunnableManager
Enclosing class:
RunnableManager

public class RunnableManager.SynchronizedRunnableManager
extends RunnableManager

An externally synchronized RunnableManager.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.ibm.jusb.util.RunnableManager
RunnableManager.SynchronizedRunnableManager
 
Field Summary
 
Fields inherited from class com.ibm.jusb.util.RunnableManager
SIZE_UNLIMITED
 
Constructor Summary
RunnableManager.SynchronizedRunnableManager()
           
 
Method Summary
 void add(java.lang.Runnable newRunnable)
          Add a Runnable.
 void start()
          Start.
 void stop()
          Stop.
 
Methods inherited from class com.ibm.jusb.util.RunnableManager
getMaxSize, getName, getSize, isRunning, setMaxSize, setName
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RunnableManager.SynchronizedRunnableManager

public RunnableManager.SynchronizedRunnableManager()
Method Detail

add

public void add(java.lang.Runnable newRunnable)
Description copied from class: RunnableManager
Add a Runnable.

Overrides:
add in class RunnableManager
Parameters:
newRunnable - the Runnable to add.

start

public void start()
Description copied from class: RunnableManager
Start.

This must be started before any Runnables will be run. If currently running this will throw a IllegalThreadStateException.

Overrides:
start in class RunnableManager

stop

public void stop()
Description copied from class: RunnableManager
Stop.

This stops the currently running Thread. If not yet started this effectively abandons any Runnables previously added without executing them. If already started any Runnables added but not run will still be run; the Thread will exit after all have been run.

After calling stop the RunnableManager's state is effectively identical to when it was initially created (but stopped), i.e. Runnables may be added and the RunnableManager must be started.

Overrides:
stop in class RunnableManager