public class JobConfigModuleDescriptor
extends com.atlassian.plugin.descriptors.AbstractModuleDescriptor
Defines an atlassian-scheduler JobConfig within a plugin.
<component key="myJobRunner" class="my.JobRunner"/>
<job-config name="My job" key="myJobId">
<job key="myJobRunner" perClusterJob="true" clusteredOnly="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 interval. This example repeats every hour
(3600000 milliseconds) and only 5 times:
<schedule repeat-interval="3600000" repeat-count="5" />
To repeat indefinitely, set repeat-count to -1, or omit it.
repeat-count="0" means the job runs only once.
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 - true indicates this job will only run once in a cluster rather than on every node.clusteredOnly - optional, true indicates this job won't be scheduled in non-clustered environment.
schedule:
cron-expression or repeat-interval must present.
repeat-count is optional in case of repeat-interval.
jitterSecs - optional, allows us to introduce some random jitter,
this is only for On Demand environment use, to prevent many 1000s of servers
from attempting to do similar things all at once, by providing a jitter
value less than the size of the schedule frequency we spread the load
caused by a process over time.
managed is 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.sal.api.timezone.TimeZoneManager timeZoneManager,
ClusterManager clusterManager,
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,
@Qualifier(value="managedScheduledJobTriggerFactory")
ManagedScheduleJobRegistrationService jobRegistrationService,
com.atlassian.sal.api.timezone.TimeZoneManager timeZoneManager,
ClusterManager clusterManager,
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.