@Component @Named(value="job") @Singleton public class JobScriptService extends Object implements org.xwiki.script.service.ScriptService
Modifier and Type | Field and Description |
---|---|
static String |
JOB_ERROR_KEY
The key under which the last encountered error is stored in the current execution context.
|
Constructor and Description |
---|
JobScriptService() |
Modifier and Type | Method and Description |
---|---|
org.xwiki.job.Job |
getCurrentJob(Collection<String> path)
Get a reference to the currently job executed in the specified job group.
|
org.xwiki.job.event.status.JobStatus |
getCurrentJobStatus(Collection<String> path)
Get the status of the currently executing job in the specified group job, if any.
|
org.xwiki.job.event.status.JobStatus |
getJobStatus(List<String> jobId) |
Exception |
getLastError()
Get the error generated while performing the previously called action.
|
protected <T> T |
safe(T unsafe) |
public static final String JOB_ERROR_KEY
public org.xwiki.job.event.status.JobStatus getJobStatus(List<String> jobId)
jobId
- the job idnull
if the status cannot be foundpublic org.xwiki.job.Job getCurrentJob(Collection<String> path)
path
- specifies the job group where to look for a running jobnull
if no job is being executedpublic org.xwiki.job.event.status.JobStatus getCurrentJobStatus(Collection<String> path)
path
- specifies the job group where to look for a running jobnull
if no job is being executedprotected <T> T safe(T unsafe)
T
- the type of the objectunsafe
- the unsafe objectpublic Exception getLastError()
null
if no exception was thrownCopyright © 2004–2019 XWiki. All rights reserved.