@Service(value=JobExecutor.class) @Property(name="job.topics", value="org/apache/sling/event/impl/jobs/tasks/HistoryCleanUpTask") public class HistoryCleanUpTask extends Object implements JobExecutor
PROPERTY_TOPICS
Constructor and Description |
---|
HistoryCleanUpTask() |
public JobExecutionResult process(Job job, JobExecutionContext context)
JobExecutor
JobExecutionContext.result().succeeded()
.
If the job has not been processed completely, but might be rescheduled "failed" should be returned.
This result can be generated by calling JobExecutionContext.result().failed()
.
If the job processing failed and should not be rescheduled, "cancelled" should be returned.
This result can be generated by calling JobExecutionContext.result().cancelled()
.
If the executor decides to process the job asynchronously it should return null
and notify the job manager by using the JobExecutionContext.asyncProcessingFinished(JobExecutionResult)
method of the processing result.
If the processing fails with throwing an exception/throwable, the process will not be rescheduled
and treated like the method would have returned a "cancelled" result.
Additional information can be added to the result by using the builder pattern available
from JobExecutionContext.result()
.process
in interface JobExecutor
job
- The jobcontext
- The execution context.null
for asynchronous processing.Copyright © 2007–2014 The Apache Software Foundation. All rights reserved.