|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--org.openeai.OpenEaiObject
|
+--org.openeai.config.EnterpriseConfigurationObjectImpl
|
+--org.openeai.config.CommandConfig
A CommandConfig is a wrapper class that takes information stored in an OpenEAI Deployment document (Command Element) and stores it in a Java object. Then the configuration object is passed to the constructor of command implementations (both ScheduledCommands and ConsumerCommands) 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 Command Element in the Deployment document. NOTE: Like all other OpenEAI configuration objects, there is a "container" level associated to Command 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) Command objects being configured should use the same configuration information. Therefore, many of the Command 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 |
|---|---|---|
| CommandName | yes | Name of the Command. The consumer will look at the COMMAND_NAME JMS Property associated to each message it consumes and execute the command with that name. |
| CommandClass | yes | Fully qualified class name of the Command implementation for the consumer to instantiate. The consumer will then execute this instance each time it consumes a message that has a COMMAND_NAME JMS Property with this CommandName. |
| Configuration | no | The configuration Element that specifies what components this Command will have at its disposal. This is the Command's AppConfig object. |
| MessagingComponents | no | Other messaging components that this command might need to interact with. Typically, this is only needed for infrastructure type gateways, like Routers and Proxies that will forward messages to other components in an enterprise. This will end up being an AppConfig object for each one of those components so this Command may have Producers, Properties, MessageObjects etc. set up according to that components needs. It is mostly just a convienient way to accomplish this goal re-using existing foundation to configure and organize those objects. |
| type | yes | The type of command being initialized (Request, Sync or Scheduled) |
| isDefault (true | false) | no (defaults to false) | Signifies that the command being initialized is the "default" command to be executed if the message consumed by the consumer does not have the COMMAND_NAME JMS Property set on it. |
| isAbsolute (true | false) | no (defaults to false) | If true, indicates that the command being initialized is the ONLY command that will ever be executed by the consumer no matter what the COMMAND_NAME JMS Property set to. It is only appropriate to set this to true if the Consumer only executes one command. |
| inboundXmlValidation (true | false) | no* | Indicates whether or not this Command should perform XML validation on the messages passed to it. This is automatically checked and performed when the command uses the initializeInput method to build the Document out of the JMS Message passed to it by the Consumer. |
| outboundXmlValidation (true | false) | no* | Indicates whether or not this Command should perform XML validation on the messages it returns or forwards after it's finished performing the business logic associated to the command. This is NOT currently automatically performed by any foundation code. It is up to the Command itself to check this flag and validate the document itself. This may eventually be put in the buildReplyDocument method as a convenience. |
| writeToFile (true | false) | no* | Indicates whether or not this Command should serialize the contents of the Message passed to it when it builds the XML Document from the message. |
| messageDumpDirectory | no | Indicates the directory where the message should be serialized to (if writeToFile is true). If no directory is specified, it will default to the current directory of the running application (the gateway). |
| Field Summary |
| Fields inherited from class org.openeai.OpenEaiObject |
logger |
| Constructor Summary | |
CommandConfig()
This is the constructor used by ConsumerConfig to instantiate the config object. |
|
CommandConfig(org.jdom.Element configElement)
|
|
CommandConfig(java.lang.String configDocUrl,
java.lang.String commandName)
|
|
| Method Summary | |
void |
addMsgComponent(java.lang.String name,
org.jdom.Element eComponent)
Adds a configuration Element to a HashMap for another Message Component that this command may need to know about. |
AppConfig |
getAppConfig()
Returns the AppConfig object associated to this command as specified in the Command's Configuration Element in the config document. |
java.lang.String |
getClassName()
Returns the ClassName associated to this command as specified in the Command's Configuration Element in the config document. |
org.jdom.Element |
getDefaultParms()
Returns the default paramaters associated to this command as specified in the "Commands" Configuration Element (the container) in the application's config document. |
boolean |
getInboundXmlValidation()
Returns a boolean value that indicates whether or not this command should validate the Xml Document it creates from the JMS message that it receives. |
java.lang.String |
getMessageDumpDirectory()
Returns the message dump directory that this command should use to persist incomming messages if the "writeToFile" flag is true. |
org.jdom.Element |
getMsgComponent(java.lang.String name)
Returns a configuration Element associated to a particular end-point by name. |
java.util.HashMap |
getMsgComponents()
Returns the entire HashMap of configuration Elements for all messaging components that this command might need to know about. |
java.lang.String |
getName()
Returns the name of this command as specified in the configuration document. |
boolean |
getOutboundXmlValidation()
Returns a boolean value that indicates whether or not this command should validate any Xml Documents it publishes or returns to a client. |
java.lang.String |
getType()
Returns type associated to this command. |
void |
init(org.jdom.Element eCommand)
Implements the init(Element) method that all EnterpriseConfiguration objects must implement. |
boolean |
isAbsolute()
Returns a boolean value that indicates if this command is the "absolute" command the consumer instantiating this command should execute no matter what "COMMAND_NAME" is specified in the JMS Message it consumes. |
boolean |
isDefault()
Returns a boolean value that indicates if this command is the "default" command the consumer instantiating this command should execute if no "COMMAND_NAME" is specified in the JMS Message it consumes. |
void |
setAbsolute(boolean def)
Sets the boolean value that indicates if this command is the "absolute" command the consumer instantiating this command should execute no matter what "COMMAND_NAME" is specified in the JMS Message it consumes. |
void |
setAppConfig(AppConfig appConfig)
Sets the AppConfig object associated to this command as specified in the Command's Configuration Element in the config document. |
void |
setClassName(java.lang.String className)
Sets the ClassName associated to this command as specified in the Command's Configuration Element in the config document. |
void |
setDefault(boolean def)
Sets the boolean value that indicates if this command is the "default" command the consumer instantiating this command should execute if no "COMMAND_NAME" is specified in the JMS Message it consumes. |
void |
setDefaultParms(org.jdom.Element eDefaultParms)
Sets the default paramaters associated to this command as specified in the "Commands" Configuration Element (the container) in the application's config document. |
void |
setInboundXmlValidation(boolean validate)
Sets the boolean indicator which will be used to determine whether or not this command should validate the Xml Document it creates from the JMS message that it receives. |
void |
setMessageDumpDirectory(java.lang.String dumpDir)
Sets the message dump directory that this command should use to persist incomming messages if the "writeToFile" flag is true. |
void |
setName(java.lang.String name)
Sets the name of this command as specified in the configuration document. |
void |
setOutboundXmlValidation(boolean validate)
Sets an indicator that specifies if this command should validate any Xml Documents it publishes or returns to a client. |
void |
setType(java.lang.String type)
Sets the type associated to this command. |
void |
setWriteToFile(boolean writeToFile)
Sets a boolean value that indicates if this command should write the incomming messages it recieves to the file system. |
boolean |
writeToFile()
Returns a boolean value that indicates if this command should write the incomming messages it recieves to the file system. |
| Methods inherited from class org.openeai.config.EnterpriseConfigurationObjectImpl |
addProperty, getAppName, getConfigDoc, getConfigElementByAttributeValue, getElementByAttributeValue, getValidation, setAppName, setConfigDoc, 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 |
| Methods inherited from interface org.openeai.config.EnterpriseConfigurationObject |
getAppName, getProperties, setAppName |
| Constructor Detail |
public CommandConfig()
public CommandConfig(java.lang.String configDocUrl,
java.lang.String commandName)
throws EnterpriseConfigurationObjectException
public CommandConfig(org.jdom.Element configElement)
throws EnterpriseConfigurationObjectException
| Method Detail |
public void setDefaultParms(org.jdom.Element eDefaultParms)
These default parameters are built from the "container" level configuration component in the config document (Commands). This is to allow "default" configuration information to be specified for all Commands that exist within this container. If needed a particular Command can override these default parameters. Otherwise the default parameters are used. This way, duplicate configuration information does not have to be specified for each Command.
public org.jdom.Element getDefaultParms()
These default parameters are built from the "container" level configuration component in the config document (Commands). This is to allow "default" configuration information to be specified for all Commands that exist within this container. If needed a particular Command can override these default parameters. Otherwise the default parameters are used. This way, duplicate configuration information does not have to be specified for each Command.
public void setMessageDumpDirectory(java.lang.String dumpDir)
public java.lang.String getMessageDumpDirectory()
public void setInboundXmlValidation(boolean validate)
public boolean getInboundXmlValidation()
public void setWriteToFile(boolean writeToFile)
public boolean writeToFile()
public void setOutboundXmlValidation(boolean validate)
public boolean getOutboundXmlValidation()
public void addMsgComponent(java.lang.String name,
org.jdom.Element eComponent)
public org.jdom.Element getMsgComponent(java.lang.String name)
public java.util.HashMap getMsgComponents()
public AppConfig getAppConfig()
public void setAppConfig(AppConfig appConfig)
public boolean isDefault()
public void setDefault(boolean def)
public boolean isAbsolute()
public void setAbsolute(boolean def)
public void setType(java.lang.String type)
setType in class EnterpriseConfigurationObjectImplpublic java.lang.String getType()
getType in class EnterpriseConfigurationObjectImplpublic void setName(java.lang.String name)
setName in class EnterpriseConfigurationObjectImplpublic java.lang.String getName()
getName in class EnterpriseConfigurationObjectImplpublic void setClassName(java.lang.String className)
public java.lang.String getClassName()
public void init(org.jdom.Element eCommand)
throws EnterpriseConfigurationObjectException
init in interface EnterpriseConfigurationObjectEnterpriseConfigurationObjectException - if errors occur processing the configuration Element.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||