public class RequestDispatcher extends Object
| Modifier and Type | Field and Description |
|---|---|
protected ResourceBinder |
resourceBinder
See
ResourceBinder. |
| Constructor and Description |
|---|
RequestDispatcher(ResourceBinder resourceBinder)
Constructs new instance of RequestDispatcher.
|
| Modifier and Type | Method and Description |
|---|---|
void |
dispatch(GenericContainerRequest request,
GenericContainerResponse response)
Dispatch
ContainerRequest to resource which can serve request. |
protected void |
dispatch(GenericContainerRequest request,
GenericContainerResponse response,
ApplicationContext context,
ObjectFactory<AbstractResourceDescriptor> resourceFactory,
Object resource,
String requestPath)
Process resource methods, sub-resource methods and sub-resource locators to find the best one for serve request.
|
protected static String |
getPathTail(List<String> parameterValues)
Get last element from path parameters.
|
protected ObjectFactory<AbstractResourceDescriptor> |
getRootResource(List<String> parameterValues,
String requestPath)
Get root resource.
|
protected final ResourceBinder resourceBinder
ResourceBinder.public RequestDispatcher(ResourceBinder resourceBinder)
resourceBinder - See ResourceBinderpublic void dispatch(GenericContainerRequest request, GenericContainerResponse response)
ContainerRequest to resource which can serve request.request - See GenericContainerRequestresponse - See GenericContainerResponseprotected static String getPathTail(List<String> parameterValues)
parameterValues - See ApplicationContextImpl.getParameterValues()protected void dispatch(GenericContainerRequest request, GenericContainerResponse response, ApplicationContext context, ObjectFactory<AbstractResourceDescriptor> resourceFactory, Object resource, String requestPath)
request - See GenericContainerRequestresponse - See GenericContainerResponsecontext - See ApplicationContextImplresourceFactory - the root resource factory or resource factory which was created by previous sub-resource
locatorresource - instance of resource classrequestPath - request path, it is relative path to the base URI or other resource which was called before
(one of sub-resource locators)protected ObjectFactory<AbstractResourceDescriptor> getRootResource(List<String> parameterValues, String requestPath)
parameterValues - is taken from contextrequestPath - is taken from contextjavax.ws.rs.WebApplicationException - if there is no matched root resources. Exception with prepared error response
with
'Not Found' statusCopyright © 2012–2016 Codenvy, S.A.. All rights reserved.