Changes for page Job Module

Last modified by Mathieu Pace on 2023/10/10 11:46

<
From version < 32.4 >
edited by Vincent Massol
on 2017/07/14 18:00
To version < 33.1 >
edited by Thomas Mortagne
on 2018/01/22 14:44
>
Change comment: There is no comment for this version

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -xwiki:XWiki.VincentMassol
1 +xwiki:XWiki.ThomasMortagne
ExtensionCode.ExtensionClass[0]
Description
... ... @@ -1,6 +1,7 @@
1 1  The goal of this module is to make easier to allow two ways communication with a task executed in a background thread.
2 2  
3 3  Minimal job provide:
4 +
4 4  * progress information
5 5  * live log
6 6  * Java bean based question/answer system
... ... @@ -24,6 +24,10 @@
24 24  jobRequest.setInteractive(true);
25 25  // [since 5.4] Indicate if the job should log informations about what is going on (to display it during the process for example, true by default)
26 26  jobRequest.setVerbose(true);
28 +// [since 10.0] Force the serialization (or not) of the job status, null (the default) to fallback on {@link JobStatus#isSerialized()} (which is usually true)
29 +jobRequest.setStatusSerialized(true);
30 +// [since 10.0] Force the isolation (or not) of the job log from standard output, null (the default) to fallback on {@link JobStatus#isIsolated()} (which is usually true)
31 +jobRequest.setStatusLogIsolated(true);
27 27  // Put some custom configuration
28 28  jobRequest.setProperty("some custom jobtype related parameter", "value");
29 29  
... ... @@ -42,6 +42,7 @@
42 42  
43 43  Since 7.4 a public ##org.xwiki.job.AbstractJob## is provided to help implementing a Job. An ##org.xwiki.job.internal.AbstractJob## class already existed since 5.0 but it was internal.
44 44  ##org.xwiki.job.AbstractJob## is dealing with a lot of plumbing, among other things:
50 +
45 45  * it automatically store anything logged (the standard slf4j way) in the status
46 46  * it automatically listen to events generated trough ##org.xwiki.job.event.status.JobProgressManager## component and update the progress in the job status
47 47  * it deals with question/answer complexity (waiting for an answer, etc.)
... ... @@ -217,7 +217,7 @@
217 217  }
218 218  {{/code}}
219 219  
220 -= Job status
226 += Job status =
221 221  
222 222  Each job expose a live status which will also be automatically serialized when the job is finished (if the job has an id).
223 223  
... ... @@ -247,10 +247,10 @@
247 247  ** ##source##: the job that has finished
248 248  ** ##data##: a ##Throwable## if the job execution failed or ##null## otherwise
249 249  
250 -
251 251  = Script Service =
252 252  
253 253  Starting with XWiki 7.2M1 there is a script service available to retrieve:
259 +
254 254  * the status of a specified job
255 255  * the current job from a specified group and its status
256 256  

Get Connected