Package com.xpn.xwiki.plugin.scheduler
Class GroovyJob
- java.lang.Object
-
- com.xpn.xwiki.plugin.scheduler.AbstractJob
-
- com.xpn.xwiki.plugin.scheduler.GroovyJob
-
- All Implemented Interfaces:
org.quartz.Job
public class GroovyJob extends AbstractJob
The task that will get executed by the Scheduler when the Job is triggered. This task in turn calls a Groovy script to perform the execution.Important:: Note that the script will execute in the XWiki Context that was set at the time the Job was scheduled for execution. For example calling
context.getDoc()
will return the current document that was set at that time and not the current document that is set when the Groovy script executes...- Version:
- $Id: e915379dbf1786180270511538d54d57f5d372b0 $
-
-
Constructor Summary
Constructors Constructor Description GroovyJob()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
executeJob(org.quartz.JobExecutionContext jobContext)
Executes the Groovy script passed in thescript
property of theSchedulerPlugin.XWIKI_JOB_CLASS
object extracted from the XWiki context passed in the Quartz's Job execution context.-
Methods inherited from class com.xpn.xwiki.plugin.scheduler.AbstractJob
execute, getXWikiContext
-
-
-
-
Method Detail
-
executeJob
protected void executeJob(org.quartz.JobExecutionContext jobContext) throws org.quartz.JobExecutionException
Executes the Groovy script passed in thescript
property of theSchedulerPlugin.XWIKI_JOB_CLASS
object extracted from the XWiki context passed in the Quartz's Job execution context. The XWiki Task object is looked for in the current document that was set in the context at the time the Job was scheduled.- Specified by:
executeJob
in classAbstractJob
- Parameters:
jobContext
- the Quartz execution context containing the XWiki context from which the script to execute is retrieved- Throws:
org.quartz.JobExecutionException
- if the script fails to execute or if the user didn't have programming rights when the Job was scheduled- See Also:
Job.execute(org.quartz.JobExecutionContext)
-
-