org.apache.commons.pipeline.driver
Class ThreadPoolStageDriverFactory

java.lang.Object
  extended by org.apache.commons.pipeline.driver.ThreadPoolStageDriverFactory
All Implemented Interfaces:
StageDriverFactory

public class ThreadPoolStageDriverFactory
extends Object
implements StageDriverFactory

This factory is used to create ThreadPoolStageDriver instances configured to run specific stages.


Constructor Summary
ThreadPoolStageDriverFactory()
          Creates a new instance of ThreadPoolStageDriverFactory
 
Method Summary
 StageDriver createStageDriver(Stage stage, StageContext context)
          Creates the new ThreadPoolStageDriver based upon the configuration of this factory instance
 FaultTolerance getFaultTolerance()
          Getter for property faultTolerance.
 int getNumThreads()
          Returns the number of threads that will be allocated to the thread pool of a driver created by this factory.
 BlockingQueueFactory<?> getQueueFactory()
          Getter for property queueFactory.
 long getTimeout()
          Timeout for wait to ensure deadlock cannot occur on thread termination.
 void setFaultTolerance(FaultTolerance faultTolerance)
          Setter for property faultTolerance.
 void setFaultToleranceLevel(String level)
          Convenience setter for property faultTolerance for use by Digester.
 void setNumThreads(int numThreads)
          Sets the number of threads that will be allocated to the thread pool of a driver created by this factory.
 void setQueueFactory(BlockingQueueFactory<?> queueFactory)
          Setter for property queueFactory.
 void setTimeout(long timeout)
          Setter for property timeout.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThreadPoolStageDriverFactory

public ThreadPoolStageDriverFactory()
Creates a new instance of ThreadPoolStageDriverFactory

Method Detail

createStageDriver

public StageDriver createStageDriver(Stage stage,
                                     StageContext context)
Creates the new ThreadPoolStageDriver based upon the configuration of this factory instance

Specified by:
createStageDriver in interface StageDriverFactory
Parameters:
stage - The stage to be run by the newly created driver
context - The context in which the stage will be run
Returns:
the newly created driver

getQueueFactory

public BlockingQueueFactory<?> getQueueFactory()
Getter for property queueFactory.

Returns:
Value of property queueFactory.

setQueueFactory

public void setQueueFactory(BlockingQueueFactory<?> queueFactory)
Setter for property queueFactory.

Parameters:
queueFactory - New value of property queueFactory.

getTimeout

public long getTimeout()
Timeout for wait to ensure deadlock cannot occur on thread termination. Default is 500

Returns:
Value of property timeout.

setTimeout

public void setTimeout(long timeout)
Setter for property timeout.

Parameters:
timeout - New value of property timeout.

getFaultTolerance

public FaultTolerance getFaultTolerance()
Getter for property faultTolerance. See FaultTolerance for valid values and enumation meanings.

Returns:
Value of property faultTolerance.

setFaultTolerance

public void setFaultTolerance(FaultTolerance faultTolerance)
Setter for property faultTolerance.

Parameters:
faultTolerance - New value of property faultTolerance.

setFaultToleranceLevel

public void setFaultToleranceLevel(String level)
Convenience setter for property faultTolerance for use by Digester.

Parameters:
level - New value of property level ("ALL","CHECKED", or "NONE").

getNumThreads

public int getNumThreads()
Returns the number of threads that will be allocated to the thread pool of a driver created by this factory.


setNumThreads

public void setNumThreads(int numThreads)
Sets the number of threads that will be allocated to the thread pool of a driver created by this factory.



Copyright © 2004-2009 The Apache Software Foundation. All Rights Reserved.