public class HttpServletTask extends net.officefloor.frame.util.AbstractSingleTask<HttpServletTask,HttpServletTask.DependencyKeys,net.officefloor.frame.api.build.None> implements net.officefloor.frame.api.build.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,
HttpServlet servlet,
Map<String,String> initParameters,
String... servletMappings)
Initiate.
|
| Modifier and Type | Method and Description |
|---|---|
Object |
doTask(net.officefloor.frame.api.execute.TaskContext<HttpServletTask,HttpServletTask.DependencyKeys,net.officefloor.frame.api.build.None> context) |
String[] |
getServletMappings()
Obtains the mappings that are handled by this
HttpServletServicer. |
String |
getServletName()
Obtains the name of this
HttpServletServicer. |
void |
include(OfficeServletContext context,
HttpServletRequest request,
HttpServletResponse response)
Includes the content from this
HttpServlet. |
void |
setOffice(net.officefloor.frame.api.manage.Office office) |
static void |
sourceWork(WorkTypeBuilder<HttpServletTask> workTypeBuilder,
WorkSourceContext context,
String servletName,
HttpServlet servlet,
String... servletMappings)
Sources the
Work for a HttpServletTask. |
createTask, createWork, getRecycleManagedObjectParameter, registerAsRecycleTask, registerTask, registerTask, registerTask, registerWorkpublic 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, 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, 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(net.officefloor.frame.api.manage.Office office)
throws Exception
setOffice in interface net.officefloor.frame.api.build.OfficeAwareWorkFactory<HttpServletTask>Exceptionpublic Object doTask(net.officefloor.frame.api.execute.TaskContext<HttpServletTask,HttpServletTask.DependencyKeys,net.officefloor.frame.api.build.None> context) throws ServletException, IOException
doTask in interface net.officefloor.frame.api.execute.Task<HttpServletTask,HttpServletTask.DependencyKeys,net.officefloor.frame.api.build.None>ServletExceptionIOExceptionpublic String getServletName()
HttpServletServicer
Obtains the name of this HttpServletServicer.
This will be used to find this HttpServletServicer by name.
getServletName in interface HttpServletServicerHttpServletServicer 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 HttpServletServicerHttpServletServicer.ServicerMapperpublic void include(OfficeServletContext context, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
HttpServletServicerHttpServlet.include in interface HttpServletServicercontext - OfficeServletContext.request - HttpServletRequest.response - HttpServletResponse.ServletException - As per RequestDispatcher.IOException - As per RequestDispatcher.Copyright © 2005–2015. All rights reserved.