Interface ResourceMethodDispatcher
public interface ResourceMethodDispatcher
A resource method dispatcher responsible for consuming a JAX-RS
request
by invoking the configured resource method on a given
resource instance and returning the method invocation result in a form of a
JAX-RS response.- Author:
- Marek Potociar, Jakub Podlesak
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceProvider interface for creating aresource method dispatcherinstances. -
Method Summary
Modifier and TypeMethodDescriptiondispatch(Object resource, ContainerRequest request) Reflectively dispatch a request to the underlyinginvocable resource methodvia the configuredinvocation handlerusing the provided resource class instance.
-
Method Details
-
dispatch
Reflectively dispatch a request to the underlyinginvocable resource methodvia the configuredinvocation handlerusing the provided resource class instance. In summary, the main job of the dispatcher is to convert a request into an array of the Java method input parameters and subsequently convert the returned response of an arbitrary Java type to a JAX-RSresponseinstance. When the method is invoked, the dispatcher will extract theJava methodinformation from the invocable resource method and use the information to retrieve the required input parameters from either the request instance or any other available run-time information. Once the set of input parameter values is computed, the underlying invocation handler instance is invoked to process (invoke) the Java resource method with the computed input parameter values. The returned response is subsequently converted into a JAX-RSResponsetype and returned from the dispatcher. It is assumed that the supplied resource implements the invocable method. Dispatcher implementation should not need to do any additional checks in that respect.- Parameters:
resource- the resource class instance.request- request to be dispatched.- Returns:
responsefor the dispatched request.- Throws:
ProcessingException- (possiblymappable) container exception that will be handled by the Jersey server container.
-