|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.osesb.configuration.XMLConfiguration
org.osesb.scheduledjobs.ScheduledJobConfiguration
public class ScheduledJobConfiguration
Configuration class for ScheduledJob(s) that a scheduled job configuration content model in a XML configuration file and sets configurationProperties.
ScheduledJobConfiguration is used by ScheduledJobManager to start ScheduledJob(s). A ScheduledJobManager loads and starts ScheduledJobs that are configured by ScheduledJobConfiguration(s). ScheduledJobConfiguration extends XMLConfiguration to include the following properties:<displayStartupMessageFlag>, which determines if a startup
message is logged when ScheduledJobManager starts a ScheduledJob<heartbeatInterval>, if set, a heartbeat message is logged
every heartbeatInterval seconds. The heartbeat message is a health check
for the ScheduledJob and the heartbeatInterval is independent of the job
repeat interval or cron specification.<schedule-configuration>, which includes the repeat interval
for periodic jobs OR a cron expression for Quartz-based cron jobs. Periodic
jobs start executing when the first interval after the job start time expires
and then repeat indefinitely. Cron jobs are executed according to the
configured cron expression. The schedule configuration is used by
ScheduledJobManager to configure and start a ScheduledJob.<job-configuration>, which contains the application-specific
properties that are required to execute the job. The <job-config-class>
element determines the class that is loaded for the job configuration.
The job configuration class defaults to XMLConfiguration.
| Field Summary | |
|---|---|
static java.lang.String |
JOB_CONFIGURATION_CONTENTMODEL
The default content model tag name for schedule properties. |
protected XMLConfiguration |
jobConfiguration
The <job-configuration> element contains the application-specific properties that are
required to execute the job. |
static java.lang.String |
SCHEDULE_CONFIGURATION_CONTENTMODEL
The default content model tag name for schedule properties. |
protected XMLConfiguration |
scheduleConfiguration
The <schedule-configuration> element includes the repeat interval for periodic jobs
OR a cron expression for cron jobs. |
static java.lang.String |
SCHEDULEDJOB_CONFIGURATION_CONTENTMODEL
The default ScheduledJobConfiguration content model tag name. |
| Fields inherited from class org.osesb.configuration.XMLConfiguration |
|---|
configFilePath, configurationProperties, constructedFromConfigFile, contentModelElement, ftpClientConfiguration, jaxrpcClientConfiguration, jdbcConfiguration, jmsClientConfiguration, log, rootConfigurationAttributes, smtpClientConfiguration, systemProperties, thisClassName |
| Constructor Summary | |
|---|---|
ScheduledJobConfiguration(org.w3c.dom.Element contentModelElement)
Creates a new instance of ScheduledJobConfiguration given the content model Element. |
|
ScheduledJobConfiguration(java.lang.String configFile)
Creates a new instance of ScheduledJobConfiguration given a XML configuration file. |
|
ScheduledJobConfiguration(java.lang.String configFile,
java.lang.String xpathExpression)
Creates a new instance of ScheduledJobConfiguration given a XML configuration file and a XPath expression that evaluates to the element that marks the beginning of the configuration. |
|
| Method Summary | |
|---|---|
java.lang.String |
getCronExpression()
Returns the configured cron expression for the scheduled job. |
boolean |
getDisplayStartupMessageFlag()
Returns the displayStartupMessageFlag for the ScheduledJobConfiguration. |
int |
getHeartbeatIntervalSeconds()
Returns optional the heartbeatInterval, which defines the number of seconds between "health" messages that a ScheduledJob will write a health message to the info log. |
XMLConfiguration |
getJobConfiguration()
Returns the job configuration, which is given by the <job-configuration>
element, which contains the application-specific properties that are required
to execute the job. |
int |
getRepeatIntervalAsSeconds()
Get the configured repeat interval for the ScheduledJob in seconds irrespective of the configuration property was set. |
int |
getRepeatIntervalHours()
The scheduled job will fire every repeatIntervalHours hours. |
int |
getRepeatIntervalMinutes()
The scheduled job will fire every repeatIntervalMinutes minutes. |
int |
getRepeatIntervalSeconds()
The scheduled job will fire every repeatIntervalSeconds seconds. |
XMLConfiguration |
getScheduleConfiguration()
Returns the schedule configuration, which is given by the <schedule-configuration>
element. |
java.lang.String |
getScheduledJobName()
Returns the name of the ScheduledJob, which is given by the name attribute of the root element of the content model. |
protected void |
loadJobConfiguration()
Loads the jobConfiguration enclosed within this configuration. |
protected void |
loadScheduleConfiguration()
Loads the scheduleConfiguration enclosed within this configuration. |
static void |
main(java.lang.String[] args)
main() For testing. |
void |
setConfigFilePath(java.lang.String configFile)
Set the configuration file name. |
void |
setDebugFlag(boolean debugFlag)
Set the debugFlag. |
void |
setJobConfiguration(XMLConfiguration jobConfiguration)
Sets the job configuration, which is given by the <job-configuration>
element, which contains the application-specific properties that are required
to execute the job. |
void |
setRepeatIntervalHours(int repeatIntervalHours)
The scheduled job will fire every repeatIntervalHours hours. |
void |
setRepeatIntervalMinutes(int repeatIntervalMinutes)
The scheduled job will fire every repeatIntervalMinutes minutes. |
void |
setRepeatIntervalSeconds(int repeatIntervalSeconds)
The scheduled job will fire every N seconds. |
void |
setScheduleConfiguration(XMLConfiguration scheduleConfiguration)
Sets the schedule configuration, which is given by the <schedule-configuration>
element. |
java.lang.String |
toString()
Returns the String representation of this ScheduledJobConfiguration. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String SCHEDULEDJOB_CONFIGURATION_CONTENTMODEL
public static final java.lang.String SCHEDULE_CONFIGURATION_CONTENTMODEL
public static final java.lang.String JOB_CONFIGURATION_CONTENTMODEL
protected XMLConfiguration scheduleConfiguration
<schedule-configuration> element includes the repeat interval for periodic jobs
OR a cron expression for cron jobs. Periodic jobs start executing when the first interval after the job start time expires
and then repeat indefinitely. Cron jobs are executed according to the configured cron expression.
<job-configuration>, which contains the application-specific properties that are
required to execute the job.
protected XMLConfiguration jobConfiguration
<job-configuration> element contains the application-specific properties that are
required to execute the job.
| Constructor Detail |
|---|
public ScheduledJobConfiguration(java.lang.String configFile)
throws java.lang.Exception
configFile - The path to the XML configuration file, which
is specified as a resource path or as a file system
path that is relative to the path specified
by the ConfigurationConstants.CONFIG_PATH_SYSTEMPROPERTY
System Property.
java.lang.Exception - if there is a problem reading or parsing the
configuration file.
public ScheduledJobConfiguration(java.lang.String configFile,
java.lang.String xpathExpression)
throws java.lang.Exception
configFile - The path to the XML configuration file, which
is specified as a resource path or as a file system
path that is relative to the path specified
by the ConfigurationConstants.CONFIG_PATH_SYSTEMPROPERTY
System Property.xpathExpression - A XPath expression that evaluates to the
element that marks the beginning of the
configuration.
java.lang.Exception - if there is a problem reading or parsing the
configuration file.
public ScheduledJobConfiguration(org.w3c.dom.Element contentModelElement)
throws java.lang.Exception
contentModelElement - The top level Element for the
for the configuration.
java.lang.Exception - if there is a fatal error transversing the
configuration content model enclosed by contentModelElement.| Method Detail |
|---|
protected final void loadScheduleConfiguration()
throws java.lang.Exception
java.lang.Exception - if there is a fatal error transversing the DOM
that contains the configuration content models.
protected final void loadJobConfiguration()
throws java.lang.Exception
java.lang.Exception - if there is a fatal error transversing the DOM
that contains the configuration content models.public java.lang.String getScheduledJobName()
public boolean getDisplayStartupMessageFlag()
public int getHeartbeatIntervalSeconds()
public XMLConfiguration getScheduleConfiguration()
<schedule-configuration>
element. The schedule configuration includes the repeat interval for periodic jobs
OR a cron expression for cron jobs. Periodic jobs start executing when the first
interval after the job start time expires and then repeat indefinitely. Cron jobs
are executed according to the configured cron expression.
public void setScheduleConfiguration(XMLConfiguration scheduleConfiguration)
<schedule-configuration>
element. The schedule configuration includes the repeat interval for periodic jobs
OR a cron expression for cron jobs. Periodic jobs start executing when the first
interval after the job start time expires and then repeat indefinitely. Cron jobs
are executed according to the configured cron expression.
scheduleConfiguration - as an XMLConfiguration.public XMLConfiguration getJobConfiguration()
<job-configuration>
element, which contains the application-specific properties that are required
to execute the job.
public void setJobConfiguration(XMLConfiguration jobConfiguration)
<job-configuration>
element, which contains the application-specific properties that are required
to execute the job.
jobConfiguration - as an XMLConfiguration.public java.lang.String getCronExpression()
public int getRepeatIntervalSeconds()
public void setRepeatIntervalSeconds(int repeatIntervalSeconds)
repeatIntervalSeconds - The number of seconds to pause between firing the ScheduledJob.public int getRepeatIntervalMinutes()
public void setRepeatIntervalMinutes(int repeatIntervalMinutes)
repeatIntervalMinutes - The number of minutes to pause between firing the ScheduledJob.public int getRepeatIntervalHours()
public int getRepeatIntervalAsSeconds()
public void setRepeatIntervalHours(int repeatIntervalHours)
repeatIntervalHours - The number of minutes to pause between firing the ScheduledJob.public void setConfigFilePath(java.lang.String configFile)
setConfigFilePath in class XMLConfigurationconfigFile - the configuration file name.public void setDebugFlag(boolean debugFlag)
setDebugFlag in class XMLConfigurationdebugFlag - The debugFlag.public java.lang.String toString()
toString in class XMLConfigurationpublic static void main(java.lang.String[] args)
args - commandline arguments
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||