org.openeai.config
Class ScheduledAppConfig


java.lang.Object

  |

  +--org.openeai.OpenEaiObject

        |

        +--org.openeai.config.EnterpriseConfigurationObjectImpl

              |

              +--org.openeai.config.ScheduledAppConfig

All Implemented Interfaces:
EnterpriseConfigurationObject

public class ScheduledAppConfig
extends EnterpriseConfigurationObjectImpl
implements EnterpriseConfigurationObject

A ScheduledAppConfig is a wrapper class that takes information stored in an OpenEAI Deployment document (ScheduleAppConfig Element) and stores it in a Java object. Then the configuration object is passed to the constructor of the OpenEAI ScheduledApps 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 ScheduledAppConfig Element in the Deployment document. NOTE: Like all other OpenEAI configuration objects, there is a "container" level associated to ScheduledAppConfig 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) ScheduledAppConfig objects being configured should use the same configuration information. Therefore, many of the ScheduledApp 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 ScheduledApp being configured. This should be unique.
type (daemon | application | triggered) no* This parameter indicates what type of Scheduled application is being started. Currently, there are three types:
  • daemon - indicates that the scheduled application should sleep for the specified interval, wake up, and if any Schedules should be executed, execute the ScheduledCommands associated to them. Then it should go back to sleep for the specified interval. It should continue this process indefinitely or until it's manually shut down. This allows an organization to use the flexible OpenEAI scheduling foundation to execute various business logic on different days and at different times (ScheduleRuntime) all within the same running process.
  • application - indicates that the scheduled application should sleep for the specified interval, wake up and execute the ScheduledCommands for all Schedules associated to this Scheduled App. Then it should exit when the Schedules have been executed. This would be a "typical" batch type application that starts, performs it's business logic and then exits. The reason this is a critical type of application is that it allows an organization to build many different applications that perform different business logic (ScheduledCommands) and run them all with the same start script. Instead of having to deploy a specific start script of some sort for each application developed.
  • triggered - behaves just like an "application" but instead of automatically exiting upon completion, it will wait until it recieves a shutdown hook from the operating system.
scheduleCheckInterval no* Time in milliseconds that the ScheduledApp should sleep between checking Schedules. If the Scheduled App is of type 'daemon' this is the amount of time between checking Schedules. If the app is of type 'application' or 'triggered' this is the initial amount of time the Scheduled App will sleep prior to executing the Schedules for the application.
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, org.openeai.afa.ScheduledApp)
ThreadPoolConfig no* Contains information that the ScheduledApp uses to initialize a ThreadPool object that it uses to execute ScheduledCommands associated to Schedules when they are met.
Schedules yes Contains configuration information related to all the Schedules that this ScheduledApp will at some time execute. A ScheduledApp may execute ScheduledCommands associated to many different Schedules in the same running process. See ScheduleConfig and the Schedule object for more information about this item.

Version:
3.0 beta2 - 28 January 2003
Author:
Tod Jackson (tod@openeai.org), Steve Wheat (steve@openeai.org)
See Also:
ScheduleConfig, CommandConfig, ScheduledApp, Schedule, ScheduledCommand, ScheduleRuntime

Field Summary
 
Fields inherited from class org.openeai.OpenEaiObject
logger
 
Constructor Summary
ScheduledAppConfig()
          This is the constructor used by AppConfig to instantiate the config object.
ScheduledAppConfig(org.jdom.Element configElement)
           
 
Method Summary
 void addScheduleConfig(java.lang.String name, ScheduleConfig cConfig)
          Adds a Schedule configuration object to the HashMap of ScheduleConfigs contained within this ScheduledApp.
 ScheduleConfig getScheduleConfig(java.lang.String name)
          Returns a ScheduleConfig object for the name specified.
 java.util.HashMap getScheduleConfigs()
          Returns a HashMap containing all Schedule configuration objects that will be used to intialize the Schedules associated to this ScheduledApp.
 ThreadPoolConfig getThreadPoolConfig()
          Returns the ThreadPool configuration object that will be used to initialize the ThreadPool associated to the ScheduledApp.
 void init(org.jdom.Element configElement)
          Implements the init(Element) method that all EnterpriseConfiguration objects must implement.
 void setThreadPoolConfig(ThreadPoolConfig tConfig)
          Sets the ThreadPool configuration object that will be used to initialize the ThreadPool associated to the ScheduledApp.
 
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
 
Methods inherited from interface org.openeai.config.EnterpriseConfigurationObject
getAppName, getProperties, setAppName
 

Constructor Detail

ScheduledAppConfig


public ScheduledAppConfig()
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.


ScheduledAppConfig


public ScheduledAppConfig(org.jdom.Element configElement)
                   throws EnterpriseConfigurationObjectException
Method Detail

getScheduleConfigs


public java.util.HashMap getScheduleConfigs()
Returns a HashMap containing all Schedule configuration objects that will be used to intialize the Schedules associated to this ScheduledApp.

Returns:
HashMap

addScheduleConfig


public void addScheduleConfig(java.lang.String name,
                              ScheduleConfig cConfig)
Adds a Schedule configuration object to the HashMap of ScheduleConfigs contained within this ScheduledApp.

See Also:
Schedule, ScheduleConfig

getScheduleConfig


public ScheduleConfig getScheduleConfig(java.lang.String name)
Returns a ScheduleConfig object for the name specified.

Returns:
ScheduleConfig

setThreadPoolConfig


public void setThreadPoolConfig(ThreadPoolConfig tConfig)
Sets the ThreadPool configuration object that will be used to initialize the ThreadPool associated to the ScheduledApp.

See Also:
ScheduledApp, ThreadPool

getThreadPoolConfig


public ThreadPoolConfig getThreadPoolConfig()
Returns the ThreadPool configuration object that will be used to initialize the ThreadPool associated to the ScheduledApp.

Returns:
ThreadPoolConfig
See Also:
ScheduledApp, ThreadPool

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 ScheduledApp being initialized. Then it sets various instance variables and properties on itself which will be used by the ScheduledApp when AppConfig instantiates it passing this configuration object. The ScheduledApp 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