...
A handler may call the doChain() method several times if needed, so handlers are required to consider the possibility they will be invoked more than once for the same request.
All handler related interfaces reside in the comorg.hpapache.symphonywink.server.handlers package.
...
- User Handler - are the handlers that are provided by an application to customize a chains behavior and to add unique functionality to it. User handlers are not part of the core functionality of Apache Wink.
Info | ||
---|---|---|
| ||
For more information In order to customize a handler chain refer to section 2 "Apache Wink Building Blocks", Customization of the Handlers Chain |
Message Context
The MessageContext allows the following:
Allows The MessageContext allows handlers to access and manipulate the current request informationAllows handlers to maintain a state by setting attributes on the message context, as the handlers themselves are singletons and therefore statelessAllows handlers to pass information to other handlers on the chain
...
The Request Handler Chain is responsible for processing a request according to the JAX-RS specification by accepting the request, searching for the resource method to invoke, de-serializing the request entity and finally for invoking the resource method. It is responsible for invoking sub-resource locators by moving up and down the chain as needed. A Request handler is a class that implements the comorg.hpapache.wink.server.handlers.RequestHandler interface.
...
User request handlers are inserted before the InvokeMethodHandler handler.
Info | ||
---|---|---|
| ||
Refer to chapter 2 TBD, section 2.3.1 TBD for more details on User Handlers Customization.In order to customize a handler chain refer to section 2 "Apache Wink Building Blocks", Customization of the Handlers Chain |
Response Handler Chain
The Response Handler Chain is responsible for handling the object returned from invoking a resource method or sub-resource method according to the JAX-RS specification. It is responsible for determining the response status code, selecting the response media type and for serializing the response entity.
A Response handler is a class that implements the comorg.hpapache.wink.server.handlers.ResponseHandler interface.
...
User response handlers are inserted before the FlushResultHandler handler. Apache Wink initializes the user response handler chain with the CheckLocationHeaderHandler handler that verifies that the "Location" response header is present on a response when there is a status code that requires it, for example, status code: 201.
Info | ||
---|---|---|
| ||
Refer to chapter 2 TBD , section 2.3.1 TBD for more details on User Handlers Customization.In order to customize a handler chain refer to section 2 "Apache Wink Building Blocks", Customization of the Handlers Chain |
Error Handler Chain
The Error Handler Chain is responsible for handling all of the exceptions that are thrown during the invocation of the Request and Response handler chains, according to the JAX-RS specification for handling exceptions. It is responsible for determining the response status code, selecting the response media type and for serializing the response entity.
An Error handler is a class that implements the comorg.hpapache.symphonywink.server.handlers.ResponseHandler interface.
...
User error handlers are inserted before the FlushResultHandler handler.
Info | ||
---|---|---|
| ||
Refer to chapter 2, section 2.3.1 TBD for more details on User Handlers Customization.In order to customize a handler chain refer to section 2 "Apache Wink Building Blocks", Customization of the Handlers Chain |
Request Processing
The following details how the Apache Wink runtime performs request processing:
...