@Service(value={javax.servlet.Servlet.class,JobConsumer.class}) @Properties(value={@Property(name="felix.webconsole.label",value="slingevent"),@Property(name="felix.webconsole.title",value="Jobs"),@Property(name="felix.webconsole.category",value="Sling"),@Property(name="job.topics",value="sling/webconsole/test")}) public class WebConsolePlugin extends javax.servlet.http.HttpServlet implements JobConsumer
JobConsumer.AsyncHandler, JobConsumer.JobResult
PROPERTY_JOB_ASYNC_HANDLER, PROPERTY_TOPICS
Constructor and Description |
---|
WebConsolePlugin() |
Modifier and Type | Method and Description |
---|---|
protected void |
doGet(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res) |
protected void |
doPost(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp) |
JobConsumer.JobResult |
process(Job job)
Execute the job.
|
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
protected void doPost(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws javax.servlet.ServletException, IOException
doPost
in class javax.servlet.http.HttpServlet
javax.servlet.ServletException
IOException
protected void doGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) throws javax.servlet.ServletException, IOException
doGet
in class javax.servlet.http.HttpServlet
javax.servlet.ServletException
IOException
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.