org.openeai.config
Class ThreadPoolConfig

java.lang.Object
  extended by org.openeai.OpenEaiObject
      extended by org.openeai.config.EnterpriseConfigurationObjectImpl
          extended by org.openeai.config.ThreadPoolConfig
All Implemented Interfaces:
EnterpriseConfigurationObject

public class ThreadPoolConfig
extends EnterpriseConfigurationObjectImpl
implements EnterpriseConfigurationObject

A ThreadPoolConfig is a wrapper class that takes information stored in an OpenEAI Deployment document (ThreadPoolConfig Element) and stores it in a Java object. Then the configuration object is passed to the constructor of the OpenEAI ThreadPool objects and they are able to configure themselves with the information found in the config object.

Configuration Parameters:

These are the configuration parameters specified by the ThreadPoolConfig Element in the Deployment document. NOTE: Like all other OpenEAI configuration objects, there is a "container" level associated to ThreadPoolConfig objects. Many Elements and attributes are required at that level and may be optionally overridden at this level. This is to avoid having to enter redundant information in the Deployment document if all (or most) ThreadPool objects being configured should use the same configuration information. Therefore, many of the ThreadPool configuration parameters are optional at this level but required at the "container" level. Where this is the case, it will be indicated by an "*".

Version:
3.0 - 28 January 2003
Author:
Tod Jackson (tod@openeai.org), Steve Wheat (steve@openeai.org)
See Also:
ThreadPoolImpl

Name Required Description
name yes Name of the ThreadPool. Should be unique.
maxThreads yes Maximum number of threads that may be in progress at the same time.
minThreads yes
maxIdleTime yes
checkBeforeProcessing (true | false) no (default is false) Indicates whether or not this ThreadPool should verify it has "available" threads before accepting an incomming job to process. If this flag is set to true, the Thread Pool will throw a ThreadPoolException if an application attempts to add a new job when there are no available threads. If this is set to false, the ThreadPool will add the job to the pool but won't process it until an available thread exists. Therefore, the "pending" job would remain in memory until the ThreadPool has an available thread to process it. This flag is most commonly used by Consumer ThreadPools. Especially, PubSubConsumers so they will not keep adding jobs to memory if for some reason all threads are in progress. This is a mechanism to minimize the risk of losing things currently in memory and to force balancing between multiple instances. It is also a mechanism that can be used in PointToPointConsumers to force balancing between multiple instances of a gateway.
Field Summary
 
Fields inherited from class org.openeai.OpenEaiObject
logger
 
Constructor Summary
ThreadPoolConfig()
          This is the constructor used by AppConfig to instantiate the config object.
ThreadPoolConfig(org.jdom.Element configElement)
           
 
Method Summary
 void init(org.jdom.Element configElement)
          Implements the init(Element) method that all EnterpriseConfiguration objects must implement.
 
Methods inherited from class org.openeai.config.EnterpriseConfigurationObjectImpl
addProperty, getAppName, getConfigDoc, getConfigElementByAttributeValue, getElementByAttributeValue, getName, getType, getValidation, refresh, setAppName, setConfigDoc, setName, setRefresh, setType, setValidation
 
Methods inherited from class org.openeai.OpenEaiObject
getDebug, getFromAddr, getMailHost, getMailService, getProperties, getToAddr, initializeLog4j, initializeLog4j, initializeLog4j, setDebug, setFromAddr, setMailHost, setMailService, setProperties, setToAddr
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.openeai.config.EnterpriseConfigurationObject
getAppName, getProperties, refresh, setAppName
 

Constructor Detail

ThreadPoolConfig

public ThreadPoolConfig()
This is the constructor used by AppConfig to instantiate the config object. Then, AppConfig calls this object's init(Element) method passing the configuration element it retrieved from the XML configuration document which this object uses to configure itself. After this object has initialized itself, it will be used to instantiate and initialize the framework object (MessageObject, Producers, Consumers, ThreadPools etc.) with the properties it's been initialized with.


ThreadPoolConfig

public ThreadPoolConfig(org.jdom.Element configElement)
                 throws EnterpriseConfigurationObjectException
Throws:
EnterpriseConfigurationObjectException
Method Detail

init

public void init(org.jdom.Element configElement)
          throws EnterpriseConfigurationObjectException
Implements the init(Element) method that all EnterpriseConfiguration objects must implement. This init method takes the Configuration element passed in and pulls out configuration information specific to the ThreadPool being initialized. Then it sets various instance variables and properties on itself which will be used by the ThreadPool when AppConfig instantiates it passing this configuration object. The ThreadPool will then use the configuration java object to initialize itself.

Specified by:
init in interface EnterpriseConfigurationObject
Overrides:
init in class EnterpriseConfigurationObjectImpl
Parameters:
configElement - Element the configuration element that AppConfig has pulled from the configuration document relevant to the ThreadPool being configured. Or, the element that was found in the init() method.
Throws:
EnterpriseConfigurationObjectException - if errors occur processing the configuration Element.


Copyright © 2002,2003 OpenEAI Software Foundation