org.openeai.config
Class ThreadPoolConfig
java.lang.Object
|
+--org.openeai.OpenEaiObject
|
+--org.openeai.config.EnterpriseConfigurationObjectImpl
|
+--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 "*".
| 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. |
- Version:
- 3.0 beta2 - 28 January 2003
- Author:
- Tod Jackson (tod@openeai.org), Steve Wheat (steve@openeai.org)
- See Also:
ThreadPoolImpl
|
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, setAppName, setConfigDoc, setName, setType, setValidation |
| Methods inherited from class org.openeai.OpenEaiObject |
addLog4jProperty, getDebug, getFromAddr, getLog4jProperties, 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 |
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
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
- Throws:
EnterpriseConfigurationObjectException - if errors occur processing the configuration Element.
Copyright © 2002, OpenEAI Software Foundation