public interface IJobsScheduler extends ISubsystem
The interval jobsScheduler.interval in the configuration is specified as number of minutes. If not set, the default is 1 minute. Note that the cron specification for each job CAN NOT be finer than the granularity of the Scheduler daemon interval. For example, if the daemon interval is set to 5 minute, a job cron for every minute at 7am on each Tuesday (e.g. * 7 * * 2) will result in the execution of the job thread only once every 5 minutes during that hour. The inteval value is recommended at 1 minute, setting it otherwise has the potential of forever missing the beat. Use with caution.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ID
The ID of this component
|
static java.lang.String |
PROP_CLASS
constant that represents the configuration parameter
"class" for this component in CMS.cfg.
|
static java.lang.String |
PROP_ENABLED
constant that represents the configuration parameter
"enabled" for this component in CMS.cfg.
|
static java.lang.String |
PROP_IMPL
constant that represents the configuration parameter
"impl" for this component in CMS.cfg.
|
static java.lang.String |
PROP_INTERVAL
constant that represents the configuration parameter
"interval" for this component in CMS.cfg.
|
static java.lang.String |
PROP_JOB
constant that represents the configuration parameter
"job" for this component in CMS.cfg.
|
static java.lang.String |
PROP_PLUGIN
constant that represents the configuration parameter
"pluginName" for this component in CMS.cfg.
|
Modifier and Type | Method and Description |
---|---|
IJobCron |
createJobCron(java.lang.String cs)
Creates a job cron.
|
java.lang.String[] |
getConfigParams(java.lang.String implName)
Retrieves the configuration parameters of the given
implementation.
|
java.util.Hashtable |
getInstances()
Retrieves all the job instances.
|
java.util.Hashtable |
getPlugins()
Retrieves all the job implementations.
|
void |
log(int level,
java.lang.String msg)
Writes a message to the system log.
|
void |
setInterval(int minutes)
Sets daemon's wakeup interval.
|
void |
startDaemon()
Starts up the JobsScheduler daemon.
|
getConfigStore, getId, init, setId, shutdown, startup
static final java.lang.String ID
static final java.lang.String PROP_ENABLED
static final java.lang.String PROP_INTERVAL
static final java.lang.String PROP_CLASS
static final java.lang.String PROP_JOB
static final java.lang.String PROP_IMPL
static final java.lang.String PROP_PLUGIN
java.util.Hashtable getPlugins()
java.util.Hashtable getInstances()
java.lang.String[] getConfigParams(java.lang.String implName) throws EJobsException
implName
- the pulubin implementation nameEJobsException
- when job plugin implementation can
not be found, instantiation is impossible, permission problem
with the class.void log(int level, java.lang.String msg)
level
- an integer representing the log message level.
Depending on the configuration set by the administrator, this
value is a determining factor for whether this message will be
actually logged or not. The lower the level, the higher the
priority, and the higher chance it will be logged.msg
- the message to be written. Ideally should call
CMS.getLogMessage() to get the localizable message
from the log properties file.void setInterval(int minutes)
minutes
- time in minutes that is to be the frequency of
JobsScheduler wakeup call.void startDaemon()
IJobCron createJobCron(java.lang.String cs) throws EBaseException
cs
- the string that represents the cron. See IJobCron
for detail of the format.EBaseException
- when the cron string, cs, can not be
parsed correctly