public class JobConfigModuleDescriptor
extends com.atlassian.plugin.descriptors.AbstractModuleDescriptor
JobConfig within a plugin.
<component key="myJobRunner" class="my.JobRunner"/>
<job-config name="My job" key="myJobId">
<job key="myJobRunner" perClusterJob="true"/>
<schedule cron-expression="0 * * * * ?" jitterSecs="10"/>
<managed editable="true" keepingHistory="true" canRunAdhoc="true" canDisable="true"/>
</job-config>
Job runner classes must implement JobRunner.
schedule can be a cron expression (like in the above example) or an interval.
This example runs every hour (3600000 milliseconds):
<schedule repeat-interval="3600000"/>
job-config:
name — represents how this job config will be referred to in the Confluence interface.key — represents the internal, system name for the job.job:
key - points to the JobRunner component.perClusterJob - optional, true indicates this job will only run once in a cluster rather than on
every node (default).schedule: Either cron-expression or repeat-interval must present.
jitterSecs is optional, to introduce some random jitter for Unicorn environment, to prevent many 1000s of
servers from attempting to do similar things all at once.
managed: Optional, if omitted the job will not appear in the
Scheduled Jobs administration page.
If any of these attributes are omitted, their values are assumed to be false:
editable — if true, the job's schedule can be edited,
forced to false if schedule type is interval.keepingHistory — if true, the job's history persists and
survives server restarts; if false, the job's history is only
stored in memory and will be lost upon the next server restart.
canRunAdhoc — if true, the job can be executed manually
on the Scheduled Jobs administration screen.
canDisable — if true, the job can be enabled/disabled on
the Scheduled Jobs administration screen.
Migration from <job> TriggerModuleDescriptor and <trigger> (JobModuleDescriptor):
<job>.
Use <component> as above instead.
<job-config> is made to look similar to that of
<trigger>, to make the migration from it easier.
key of <job-config> is used to
lookup i18n job name (scheduledjob.desc.<key>),
to display at the Confluence admin UI.
Before, it's the key of <job>.
| Constructor and Description |
|---|
JobConfigModuleDescriptor(com.atlassian.plugin.module.ModuleFactory moduleFactory,
ManagedScheduleJobRegistrationService jobRegistrationService,
com.atlassian.scheduler.SchedulerService schedulerService) |
| Modifier and Type | Method and Description |
|---|---|
void |
disabled() |
void |
enabled() |
Object |
getModule() |
void |
init(com.atlassian.plugin.Plugin plugin,
org.dom4j.Element element) |
assertModuleClassImplements, checkPermissions, destroy, destroy, equals, getCompleteKey, getDescription, getDescriptionKey, getI18nNameKey, getKey, getMinJavaVersion, getModuleClass, getModuleClassName, getName, getParams, getPlugin, getPluginKey, getRequiredPermissions, getResourceDescriptor, getResourceDescriptors, getResourceDescriptors, getResourceLocation, getScopeKey, hashCode, isBroken, isEnabled, isEnabledByDefault, isSingleton, isSingletonByDefault, isSystemModule, loadClass, loadClass, provideValidationRules, satisfiesMinJavaVersion, setBroken, setPlugin, toStringpublic JobConfigModuleDescriptor(com.atlassian.plugin.module.ModuleFactory moduleFactory,
ManagedScheduleJobRegistrationService jobRegistrationService,
com.atlassian.scheduler.SchedulerService schedulerService)
public void init(com.atlassian.plugin.Plugin plugin,
org.dom4j.Element element)
throws com.atlassian.plugin.PluginParseException
init in interface com.atlassian.plugin.ModuleDescriptorinit in class com.atlassian.plugin.descriptors.AbstractModuleDescriptorcom.atlassian.plugin.PluginParseExceptionpublic Object getModule()
getModule in interface com.atlassian.plugin.ModuleDescriptorgetModule in class com.atlassian.plugin.descriptors.AbstractModuleDescriptorpublic void enabled()
enabled in interface com.atlassian.plugin.StateAwareenabled in class com.atlassian.plugin.descriptors.AbstractModuleDescriptorpublic void disabled()
disabled in interface com.atlassian.plugin.StateAwaredisabled in class com.atlassian.plugin.descriptors.AbstractModuleDescriptorCopyright © 2003–2016 Atlassian. All rights reserved.