com.ls.util.threading
Class StaticThreadPoolBuilder

java.lang.Object
  |
  +--com.ls.util.threading.ObjectBuilder
        |
        +--com.ls.util.threading.StaticThreadPoolBuilder

public class StaticThreadPoolBuilder
extends ObjectBuilder

Object builder for creating object of type StaticThreadPool. The properties defined by this object builder are:

name = [name of the thread pool] count = [number of threads maintained by the pool]

These properties can be set by calling ObjectBuilder.setProperty(String, Object) or by calling ObjectBuilder.setProperties(java.util.Properties). A subsequent call to ObjectBuilder.newInstance() will produce a new static thread pool instance according to the previously set properties.

Version:
$Revision: 1.2 $
Author:
Last modified by $Author: MFehrenbach $

Constructor Summary
StaticThreadPoolBuilder()
           
 
Method Summary
protected  void doCheck()
          Overwritten to provide special checking operations, in this case: empty implementation.
protected  Object doNewInstance()
          Overwritten to provide the actual instantiation code of a static thread pool according to the properties "name" and "threadCount".
protected  void doReset()
          Overwritten to provide special reset operations, in this case: clearing the properties "name" and "threadCount".
 void setName(String name)
          Sets the name of the thread pool that will be created by this builder.
 void setThreadCount(String value)
          Sets the amount of thread maintained by the thread pool that will be created by this builder.
 
Methods inherited from class com.ls.util.threading.ObjectBuilder
check, clearPropertyError, hasPropertyError, hasPropertyError, newBuilderInstance, newInstance, reset, setProperties, setProperties, setProperty, setPropertyError, setPropertyError
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StaticThreadPoolBuilder

public StaticThreadPoolBuilder()
Method Detail

setName

public void setName(String name)
Sets the name of the thread pool that will be created by this builder.
Parameters:
name - The name of the thread pool.

setThreadCount

public void setThreadCount(String value)
Sets the amount of thread maintained by the thread pool that will be created by this builder.
Parameters:
value - the amount of threads as a string value

doReset

protected void doReset()
Overwritten to provide special reset operations, in this case: clearing the properties "name" and "threadCount".
Overrides:
doReset in class ObjectBuilder

doNewInstance

protected Object doNewInstance()
                        throws Throwable
Overwritten to provide the actual instantiation code of a static thread pool according to the properties "name" and "threadCount".
Overrides:
doNewInstance in class ObjectBuilder
Returns:
A new instance of a static thread pool.
Throws:
Throwable - If something goes wrong during instantiation.

doCheck

protected void doCheck()
                throws BuildException
Overwritten to provide special checking operations, in this case: empty implementation.
Overrides:
doCheck in class ObjectBuilder
Throws:
BuildException - if something went wrong