It depends where you are exactly. org.xwiki.job.JobExecutor is a
component role so you need to either inject it if you are yourself in
a component or access the ComponentManager (but again it depends it
which situation you are exacly), see
http://extensions.xwiki.org/xwiki/bin/view/Extension/Component+Module#HUsin…
for more details about components. If you created you own jobs you
probably seen already how components are working.
On Sat, Nov 15, 2014 at 11:47 AM, Stefan Bernsdorf
<gruener.heinrich(a)web.de> wrote:
Hi,
I wanted to use the snip from page
http://extensions.xwiki.org/xwiki/bin/view/Extension/Job+Module
....
Request jobRequest = new DefaultRequest();
// Indicate an id to allow you to access the status of this
unique task, the id is required to save/retrieve the status of
the job
jobRequest.setId("taskid");
// Allow the job to ask questions during its executing (false by
default)
jobRequest.setInteractive(true);
// [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)
jobRequest.setVerbose(true);
// Put some custom configuration
jobRequest.setProperty("some custom jobtype related parameter",
"value");
// Lookup and execute Job with role hint "jobtype" and wait for
it to be finished
jobManager.executeJob("jobtype", request)
// Lookup and add Job with role hint "jobtype" to the queue
queue and return right away
Job job = jobManager.addJob("jobtype", request)
// Wait until the job is finished
job.join()
..
to be able to create my own job and job request. But how is the jobManager
injected? When I use the snip, the
the jobManager is null.
_______________________________________________
users mailing list
users(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/users
--
Thomas Mortagne