This documentation relates to an earlier version of Confluence.
View this page in the current documentation or visit the current documentation home.
Skip to end of metadata
Go to start of metadata

Job plugin modules are available in Confluence 2.2 and later.

Job plugin modules enable you to add repeatable tasks to Confluence, which are in turn scheduled by Trigger Plugins.

Job Plugin Module

The Job plugin module adds a simple reusable component within a plugin. At a minimum, the module class must implement Quartz's Job interface, but for access to Confluence's objects and database you should extend com.atlassian.quartz.jobs.AbstractJob. Jobs are scheduled with Trigger Plugins.

Note that at the moment Jobs are not autowired by Spring.

Here is an example atlassian-plugin.xml fragment containing a single Job module:

  • the name attribute represents how this component will be referred to in the Confluence interface.
  • the key attribute represents the internal, system name for your Job. This is what the Trigger will refer to.
  • the class attribute represents the class of the Job to be created. The class must have a no-argument constructor, or it will not be able to be instantiated by Confluence.

For examples of how to schedule Jobs to be run, see Trigger Plugins.

Note that in Confluence 2.3 you can also use a Spring Plugin as a job. This allows you to inject other Spring components into the Job, via the "jobDataAsMap" property of the job. An example is shown below. You cannot do this in Confluence 2.2.

Plugins containing Spring JobDetailBeans can't be dynamcally loaded at present, due to classloading issues.

Labels: