Job Module

The Job Module provides the API allowing two ways communication with a task executed in a background thread. A job offers progress information, a live log and a Java bean based question and answer system but it can be extended. The source code is available on GitHub.

Existing jobs can be accessed via the JobManager interface as follows:

Request jobRequest = new DefaultRequest();

jobRequest.setId("taskid");

jobRequest.setInteractive(true);

jobRequest.setVerbose(true);

jobRequest.setProperty("job type parameter", "value");

// Starts a new job with the provided "jobtype" identifier and waits until its finished.
jobManager.executeJob("jobtype", request)

// Adds the new job in the queue of jobs to execute.
jobManager.addJob("jobtype", request)
  • public void setId(String id) - allows to retrieve or to save the status of this unique task.
  • public void setInteractive(boolean interactive) - indicates whether the job is allowed to ask questions, whether it should be fully automated and if it should use default answers. The default value is false.
  • public void setVerbose(boolean verbose) - indicates whether the job should log the progress information. The default value is true.

To create a new job, you need to register a component with:

 

Related Pages

Trying to decide between Cloud and On Premise? See the comparison on the XWiki Help Center.

Search this space