@Service(value={org.osgi.service.event.EventHandler.class,JobConsumer.class}) @Properties(value={@Property(name="event.topics",value="org/apache/sling/event/job"),@Property(name="job.topics",value="/")}) public class EventAdminBridge extends Object implements org.osgi.service.event.EventHandler, JobConsumer
JobConsumer.AsyncHandler, JobConsumer.JobResult
PROPERTY_JOB_ASYNC_HANDLER, PROPERTY_TOPICS
Constructor and Description |
---|
EventAdminBridge() |
Modifier and Type | Method and Description |
---|---|
protected void |
activate()
Activate this component and start background thread
|
protected void |
deactivate()
Deactivate this component.
|
void |
handleEvent(org.osgi.service.event.Event event) |
JobConsumer.JobResult |
process(Job job)
Execute the job.
|
@Activate protected void activate()
@Deactivate protected void deactivate()
public void handleEvent(org.osgi.service.event.Event event)
handleEvent
in interface org.osgi.service.event.EventHandler
EventHandler.handleEvent(org.osgi.service.event.Event)
public JobConsumer.JobResult process(Job job)
JobConsumer
JobResult.OK
should be returned.
If the job has not been processed completely, but might be rescheduled JobResult.FAILED
should be returned.
If the job processing failed and should not be rescheduled, JobResult.CANCEL
should
be returned.
If the consumer decides to process the job asynchronously it should return JobResult.ASYNC
and notify the job manager by using the JobConsumer.AsyncHandler
interface.
If the processing fails with throwing an exception/throwable, the process will not be rescheduled
and treated like the method would have returned JobResult.CANCEL
.process
in interface JobConsumer
job
- The jobCopyright © 2007–2014 The Apache Software Foundation. All rights reserved.