jconch.pipeline.impl
Class SpawningThreadingModel

java.lang.Object
  extended by jconch.pipeline.impl.SpawningThreadingModel
All Implemented Interfaces:
ThreadingModel

public class SpawningThreadingModel
extends java.lang.Object
implements ThreadingModel

Spawns a new thread for each call to execute.

Author:
Robert Fischer

Constructor Summary
SpawningThreadingModel()
          Constructor that uses a default wait time between spawns.
SpawningThreadingModel(long waitBetweenSpawns)
          Constructor.
 
Method Summary
 void execute(PipeStage toRun)
          Spawns a thread that calls PipeStage.execute().
 long getSpawnPeriod()
           
 void setSpawnPeriod(long period)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpawningThreadingModel

public SpawningThreadingModel()
Constructor that uses a default wait time between spawns.


SpawningThreadingModel

public SpawningThreadingModel(long waitBetweenSpawns)
Constructor.

Parameters:
waitBetweenSpawns - The time to wait between spawns.
Throws:
java.lang.IllegalArgumentException - If the argument <= 0
Method Detail

execute

public void execute(PipeStage toRun)
Spawns a thread that calls PipeStage.execute().

Specified by:
execute in interface ThreadingModel
Parameters:
toRun - The stage to run.
Throws:
org.apache.commons.lang.NullArgumentException - If the argument is null

getSpawnPeriod

public long getSpawnPeriod()

setSpawnPeriod

public void setSpawnPeriod(long period)