public class HttpServletTask extends AbstractSingleTask<HttpServletTask,HttpServletTask.DependencyKeys,None> implements OfficeAwareWorkFactory<HttpServletTask>, HttpServletServicer
Modifier and Type | Class and Description |
---|---|
static class |
HttpServletTask.DependencyKeys
Keys for the dependencies.
|
Modifier and Type | Field and Description |
---|---|
static String |
PROPERTY_PREFIX_INIT_PARAMETER
Prefix of property for an initialisation parameter.
|
static String |
PROPERTY_SERVLET_MAPPINGS
Name of property to obtain mappings to the
HttpServlet . |
static String |
TASK_NAME
Name of the servicing
Task for the Servlet . |
Constructor and Description |
---|
HttpServletTask(String servletName,
javax.servlet.http.HttpServlet servlet,
Map<String,String> initParameters,
String... servletMappings)
Initiate.
|
Modifier and Type | Method and Description |
---|---|
Object |
doTask(TaskContext<HttpServletTask,HttpServletTask.DependencyKeys,None> context)
Does the task.
|
String[] |
getServletMappings()
Obtains the mappings that are handled by this
HttpServletServicer . |
String |
getServletName()
Obtains the name of this
HttpServletServicer . |
void |
include(OfficeServletContext context,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Includes the content from this
HttpServlet . |
void |
setOffice(Office office)
Provides the
WorkFactory its containing Office . |
static void |
sourceWork(WorkTypeBuilder<HttpServletTask> workTypeBuilder,
WorkSourceContext context,
String servletName,
javax.servlet.http.HttpServlet servlet,
String... servletMappings)
Sources the
Work for a HttpServletTask . |
createTask, createWork, getRecycleManagedObjectParameter, registerAsRecycleTask, registerTask, registerTask, registerTask, registerWork
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createWork
public static final String PROPERTY_PREFIX_INIT_PARAMETER
public static final String PROPERTY_SERVLET_MAPPINGS
HttpServlet
. Mappings
are comma (,) separated.public static final String TASK_NAME
Task
for the Servlet
.public HttpServletTask(String servletName, javax.servlet.http.HttpServlet servlet, Map<String,String> initParameters, String... servletMappings)
servletName
- Name of the HttpServlet
.servlet
- HttpServlet
to service the HttpRequest
.initParameters
- Initialisation parameters.servletMappings
- Mappings to the HttpServlet
.public static void sourceWork(WorkTypeBuilder<HttpServletTask> workTypeBuilder, WorkSourceContext context, String servletName, javax.servlet.http.HttpServlet servlet, String... servletMappings)
Work
for a HttpServletTask
.workTypeBuilder
- WorkTypeBuilder
.context
- WorkSourceContext
.servletName
- Servlet name.servlet
- HttpServlet
.servletMappings
- Mappings to the HttpServlet
.public void setOffice(Office office) throws Exception
OfficeAwareWorkFactory
WorkFactory
its containing Office
.setOffice
in interface OfficeAwareWorkFactory<HttpServletTask>
office
- Office
containing this WorkFactory
.Exception
- If fails to use the Office
.public Object doTask(TaskContext<HttpServletTask,HttpServletTask.DependencyKeys,None> context) throws javax.servlet.ServletException, IOException
Task
doTask
in interface Task<HttpServletTask,HttpServletTask.DependencyKeys,None>
context
- TaskContext
for the Task
.Task
. This allows stringing
Task
instances together into a JobSequence
.javax.servlet.ServletException
IOException
public String getServletName()
HttpServletServicer
Obtains the name of this HttpServletServicer
.
This will be used to find this HttpServletServicer
by name.
getServletName
in interface HttpServletServicer
HttpServletServicer
name.public String[] getServletMappings()
HttpServletServicer
Obtains the mappings that are handled by this HttpServletServicer
.
The mappings are of the form:
/some/path.extension
: for exact mapping (extension is
optional)/wild/card/*
: for path wild card mapping*.extension
: for extension mapping
This follows the Servlet
specification in regards to mappings.
getServletMappings
in interface HttpServletServicer
HttpServletServicer
.ServicerMapper
public void include(OfficeServletContext context, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException
HttpServletServicer
HttpServlet
.include
in interface HttpServletServicer
context
- OfficeServletContext
.request
- HttpServletRequest
.response
- HttpServletResponse
.javax.servlet.ServletException
- As per RequestDispatcher
.IOException
- As per RequestDispatcher
.Copyright © 2005–2016. All rights reserved.