org.openeai.implementations.applications.moagen
Class MoaGenScheduledCommand

java.lang.Object
  |
  +--org.openeai.OpenEaiObject
        |
        +--org.openeai.afa.ScheduledCommandImpl
              |
              +--org.openeai.implementations.applications.moagen.MoaGenScheduledCommand
All Implemented Interfaces:
ScheduledCommand

public class MoaGenScheduledCommand
extends ScheduledCommandImpl
implements ScheduledCommand

MOA generation application. This ScheduledCommand generates an organization's base Message Object API (Java objects) and the appropriate Enterprise Objects (EO) documents for those objects. It will ensure consistency among the MOA objects as well as the EO documents. This information is derived from an organization's "Segments" file which contains all Complex object definitions for that organinzation.

This application assumes organizations follow the OpenEAI recommended deployment patterns for file storage and package naming conventions. Most options are configurable by setting the following parameters.

Assumptions

Configuration Parameters:

These are the configuration parameters required by the MOA Generation Application. They are broken into three categories of PropertyConfig Elements in the application's Deployment document. The three categories are:

Contents of the MoaGenProperties PropertyConfig object:

Property Name Required Description
segmentUrl yes The URL that resolves to the location of the Segments file. This is the name of the file that will be read to begin processing. Each Element listed in this document will have a Java object generated for it.
dtdBaseFilePath yes This is the base path (in URL format) where all the DTDs associated to message objects is stored. Currently, the only type of URL that is supported is a local file system. The application will use the information found in the subdirectories off of this base path to determine if an object is a “JMS Aware” object or just an “XML Aware” object. This information is necessary to derive the appropriate package name for the object.
useThreads (true | false) no default=false If true, files will be generated using the ThreadPool associated to the Command.

Contents of the JavaProperties PropertyConfig object:

Property Name Required Description
targetBasePath yes This is the directory to which all Java files will be written. This is the base path. Files will be created according to their package structure starting in this location.
moaJmsBasePackageName yes This is the base package name that will be used for all JMS objects. The appropriate package name will be appended to this based on other derived values during processing.
moaResourcesBasePackageName yes This is the base package name that will be used for all resource objects. These are objects that are not JMS aware but are XML aware. The appropriate package name will be appended to this based on other derived values during processing.
version yes This is the target version of the Java class that will be generated. This information will be used in conjunction with other items mentioned above to derive the fully qualified package name for the objects. Example: v1_0, v1_1 etc.

NOTE: This value must NOT include anything that would make it an invalid Java package name like periods.

licenseStatement no default="No License Statement" This is the copyright notice that should go at the beginning of each Java object created during the process (in the class definition Javadoc).
overwrite (true | false) no default=true If true, existing Java files will be overwritten.
listImplementation no default=java.util.ArrayList This is the Java Collection implementation that should be used for repeatable objects. The objects will be specified as java.util.List objects but this is the implementation that will be used when a repeatable object must be instantiated.

Contents of the EOProperties PropertyConfig object:

Property Name Required Description
targetBasePath yes This is the directory to which all EO files will be written. This is the base path. Files will be created according to an Object's category and the 'eoVersion' starting in this location.
baseUri yes This is the base uri that will be used for building IncludeList URIs when an object includes another complex child object and therefore needs to include that child object's EO document to make it's definition complete.
version yes This is the target version of the EO documents that will be generated. This information will be used in conjunction with other items mentioned above to derive the fully qualified directory location for the EO documents. Example: 1.0, 1.1 etc.

NOTE: unlike the MOA version for the Java objects, this value can include periods.

overwrite (true | false) no default=true If true, existing EO files will be overwritten.
licenseStatement no default="No License Statement" This is the copyright notice that should go at the beginning of each EO document created during the process as a comment.
controlAreaUri yes This is the URI that points to the OpenEAI ControlAreaEO.xml file. This will be included in the IncludeList for all JMS object's in their EO document.

Version:
1.0 beta - 10 October 2002
Author:
Tod Jackson (tod@openeai.org)

Field Summary
 
Fields inherited from class org.openeai.OpenEaiObject
logger
 
Constructor Summary
MoaGenScheduledCommand(CommandConfig cConfig)
           
 
Method Summary
 int execute()
          Iterates through an organization's Segments file and generates a Java file and an EnterpriseObject document for each complex element listed in the Segments file.
 
Methods inherited from class org.openeai.afa.ScheduledCommandImpl
buildError, getAppConfig, getControlArea, getInboundXmlValidation, getOutboundXmlValidation, getSyncErrorPublisher, getSyncErrorSyncPrimedDocumentUri, publishSyncError, publishSyncError, setAppConfig, setInboundXmlValidation, setOutboundXmlValidation, setSyncErrorSyncPrimedDocumentUri
 
Methods inherited from class org.openeai.OpenEaiObject
addLog4jProperty, getAppName, getDebug, getFromAddr, getLog4jProperties, getMailHost, getMailService, getProperties, getToAddr, initializeLog4j, initializeLog4j, initializeLog4j, setAppName, setDebug, setFromAddr, setMailHost, setMailService, setProperties, setToAddr
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MoaGenScheduledCommand

public MoaGenScheduledCommand(CommandConfig cConfig)
                       throws java.lang.InstantiationException
Method Detail

execute

public int execute()
            throws ScheduledCommandException
Iterates through an organization's Segments file and generates a Java file and an EnterpriseObject document for each complex element listed in the Segments file. These files will be based on the definition of the object(s) in the Segments file. This will result in the organization's Message Object API (MOA).

Uses properties specified in the scheduled application's deployment document that are associated to this ScheduledCommand.

Specified by:
execute in interface ScheduledCommand
Returns:
int generally anything other than -1 indicates success to the ScheduledApp which calls this method.
Throws:
ScheduledCommandException - if errors occur executing the business logic associated to the ScheduledCommand.


Copyright © 2002, OpenEAI Software Foundation