|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openeai.OpenEaiObject
org.openeai.config.EnterpriseConfigurationObjectImpl
org.openeai.config.ConsumerConfig
public class ConsumerConfig
A ConsumerConfig is a wrapper class that takes information stored in an OpenEAI Deployment document (ConsumerConfig Element) and stores it in a Java object. Then the configuration object is passed to the constructor of the OpenEAI consumers and they are able to configure themselves with the information found in the config object.
Both PubSub and PointToPoint consumers use the same configuration information to initialize themselves. However, some items listed in a ConsumerConfig Element are only used by PubSubConsumers and some are only used by PointToPointConsumers. Where this is the case, it is noted.
Configuration Parameters:
These are the configuration parameters specified by the ConsumerConfig Element in the Deployment document. NOTE: Like all other OpenEAI configuration objects, there is a "container" level associated to ConsumerConfig 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) Consumers being configured should use the same configuration information. Therefore, many of the Consumer configuration parameters are optional at this level but required at the "container" level. Where this is the case, it will be indicated by an "*".
Many of the parameters specified for a consumer are simply JMS parameters required by the JMS Specification.
| Name | Required | Description |
|---|---|---|
| name | yes | Name of the Consumer. This will be used in many logged messages as well as when creating durable subscriptions (in the case of PubSubConsumers). Therefore it should be unique. |
| startOnInitialization (true | false) | no (defaults to false) | Indicates whether or not this consumer should be "started" after it is initialized. For the purpose of Consumers, started means it has established it's connection to the Broker and is ready to receive messages. |
| transacted (true | false) | no (defaults to false) | Indicates whether or not messages consumed by this consumer should be treated as "transacted" or not. Transacted is defined by the JMS specification. |
| ConnectionFactoryName | no* | The name of the JMS Administered object (TopicConnectionFactory or QueueConnectionFactory) that this Consumer will use to initialize itself from a JMS perspective. To maintain broker independance, this administered object should be stored in a Directory server. |
| DestinationName | yes | The name of the JMS Administered object (Topic or Queue) that this Consumer will consume messages from. To maintain broker independance, this administered object should be stored in a Directory server. |
| InitialContextFactory | no* | The class name of the JNDI context factory that will be used to retrieve the JMS
administered objects from a Directory Server or wherever the administered
objects are stored.
Typically, this is "com.sun.jndi.ldap.LdapCtxFactory". |
| ProviderURL | no* | Location where the administered objects can be retrieved from. To maintain broker independance, this should reference a location in a Directory server. |
| SecurityPrincipal | no* | The user with which to create the InitialContext when retrieving the Administered objects. |
| SecurityCredentials | no* | The credentials associated to the user with which to create the InitialContext when retrieving the Administered objects. |
| Username | no* | Broker user with which to connect to the broker as. Generally, this is stored within the ConnectionFactory administered object so it is not needed here. However, if it isn't stored or you wish to override what's stored in the AO, you can specify that here. |
| Password | no* | Password associated to the broker user with which to connect to the broker as. Generally, this is stored within the ConnectionFactory administered object so it is not needed here. However, if it isn't stored or you wish to override what's stored in the AO, you can specify that here. |
| Commands | yes | Lists the Commands that this Consumer executes. |
| ConfigClass | no* | Name of the configuration class that wraps the config Element (this class) |
| ObjectClass | yes | Name of the Java object that will be instantiated with this Config class (currently, PointToPointConsumer or PubSubConsumer) |
| GenericResponse | no* | Contains information that the Consumer uses to initialize a generic response 'primed' document. This is only relevant to PointToPointConsumers and is only ever used if the Consumer has errors executing the Command associated to the JMS Message it consumes. In all other cases, the Commands themselves are responsible for returning the appropriate response to the calling application. |
| ThreadPoolConfig | no* | Contains information that the Consumer uses to initialize a ThreadPool object that it uses to process incomming messages. Depending on how this ThreadPool is configured (checkBeforeProcessing), the consumer may pause message consumption if the ThreadPool is busy and only continue when it has available Threads that can process jobs. |
| DbConnectionPoolConfig | no* | Contains information that PubSubConsumers use to initialize a EnterpriseConnectionPool object that they use to verify another PubSubConsumer is not already processing the message. This is called the PubSubMessageBalancer component. Since all PubSubConsumers consume each message delivered to a topic, there has to be a way to run muliple instances of a PubSubConsumer and ensure that only one consumer processes the message. This is the mechanism by which OpenEAI PubSubConsumers do this. NOTE: this is only relevant to PubSubConsumers. |
CommandConfig,
ThreadPoolConfig,
DbConnectionPoolConfig,
PubSubMessageBalancer| Field Summary |
|---|
| Fields inherited from class org.openeai.OpenEaiObject |
|---|
logger |
| Constructor Summary | |
|---|---|
ConsumerConfig()
This is the constructor used by AppConfig to instantiate the config object. |
|
ConsumerConfig(org.jdom.Element configElement)
|
|
ConsumerConfig(java.lang.String configDocUrl,
java.lang.String consumerName)
|
|
| Method Summary | |
|---|---|
void |
addCommandConfig(java.lang.String name,
CommandConfig cConfig)
Adds a CommandConfig Java object to the list (HashMap) of CommandConfigs that this consumer will execute. |
CommandConfig |
getCommandConfig(java.lang.String name)
Returns a specific CommandConfig Java object by name that will be used to initialize an actual Command object during Consumer initialization. |
java.util.HashMap |
getCommandConfigs()
Returns the entire list (HashMap) of all CommandConfig objects assciated to this consumer. |
DbConnectionPoolConfig |
getDbConnectionPoolConfig()
Returns the DbConnectionPoolConfig Java object associated to this consumer. |
ThreadPoolConfig |
getThreadPoolConfig()
Returns the ThreadPoolConfig Java object associated to this consumer. |
void |
init(org.jdom.Element configElement)
Implements the init(Element) method that all EnterpriseConfiguration objects must implement. |
void |
setDbConnectionPoolConfig(DbConnectionPoolConfig dbConfig)
Sets the DbConnectionPoolConfig Java object associated to this consumer. |
void |
setThreadPoolConfig(ThreadPoolConfig tConfig)
Sets the ThreadPoolConfig Java object associated to this consumer. |
| 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 |
|---|
public ConsumerConfig()
public ConsumerConfig(java.lang.String configDocUrl,
java.lang.String consumerName)
throws EnterpriseConfigurationObjectException
EnterpriseConfigurationObjectException
public ConsumerConfig(org.jdom.Element configElement)
throws EnterpriseConfigurationObjectException
EnterpriseConfigurationObjectException| Method Detail |
|---|
public java.util.HashMap getCommandConfigs()
public void addCommandConfig(java.lang.String name,
CommandConfig cConfig)
name - String the name of the command being configuredcConfig - CommandConfig the CommandConfig Java object that has been initialized with information found in the Command's Configuration
Element specified in the deployment document.CommandConfigpublic CommandConfig getCommandConfig(java.lang.String name)
name - String name of the command being configured.public void setThreadPoolConfig(ThreadPoolConfig tConfig)
tConfig - ThreadPoolConfig the Java object that wraps the ThreadPoolConfig Element in the deployment document.ThreadPoolConfig,
ThreadPoolImplpublic ThreadPoolConfig getThreadPoolConfig()
ThreadPoolConfig,
ThreadPoolImplpublic void setDbConnectionPoolConfig(DbConnectionPoolConfig dbConfig)
dbConfig - DbConnectionPoolConfig to be associated to the PubSubMessageBalancer for this consumer.DbConnectionPoolConfig,
EnterpriseConnectionPool,
PubSubMessageBalancerpublic DbConnectionPoolConfig getDbConnectionPoolConfig()
DbConnectionPoolConfig,
EnterpriseConnectionPool,
PubSubMessageBalancer
public void init(org.jdom.Element configElement)
throws EnterpriseConfigurationObjectException
init in interface EnterpriseConfigurationObjectinit in class EnterpriseConfigurationObjectImplconfigElement - Element the configuration element that AppConfig has pulled from the configuration document
relevant to the Command being configured. Or, the element that was found in the init() method.
EnterpriseConfigurationObjectException - if errors occur processing the configuration Element.PubSubConsumer,
PointToPointConsumer
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||