@ConsumerType public interface JobConsumer
If the job consumer needs more features like providing progress information or adding
more information of the processing,
JobExecutor should be implemented instead.
A job consumer registers itself with the
PROPERTY_TOPICS service registration
property. The value of this property defines which topics a consumer is able to process.
Each string value of this property is either
For example, the value
org/apache/sling/jobs/* matches the topics
org/apache/sling/jobs/b but neither
org/apache/sling/jobs/subcategory/a. A value of
org/apache/sling/jobs/** matches the same topics but also all sub topics
If there is more than one job consumer or executor registered for a job topic, the selection is as follows:
If the consumer decides to process the job asynchronously, the processing must finish within the current lifetime of the job consumer. If the consumer (or the instance of the consumer) dies, the job processing will mark this processing as failed and reschedule.
|Modifier and Type||Interface and Description|
If the consumer decides to process the job asynchronously, this handler interface can be used to notify finished processing.
The result of the job processing.
|Modifier and Type||Field and Description|
Job property containing an asynchronous handler.
Service registration property defining the jobs this consumer is able to process.
static final String PROPERTY_JOB_ASYNC_HANDLER
JobConsumer.JobResult process(Job job)
If the job has been processed successfully,
JobConsumer.JobResult.OK should be returned.
If the job has not been processed completely, but might be rescheduled
should be returned.
If the job processing failed and should not be rescheduled,
If the processing fails with throwing an exception/throwable, the process will not be rescheduled
and treated like the method would have returned
job- The job
Copyright © 2015 The Apache Software Foundation. All rights reserved.