Creating custom REST request handlers
You can create custom REST request handlers to communicate with the REST post-processing system. A template is provided that you can adapt for your own purposes.
Procedure
-
Create a new request handler that implements the RequestHandler call with
RequestHandlerAnnotation defined.
WherehandleRequest(MessageContext, HandlersChain) method @RequestHandlerAnnotation( sequence="200" public class CustomRequestHandler implements RequestHandler { @Override public void handleRequest(MessageContext messageContext, HandlersChain handlersChain) { // Add your own logic here handlersChain.doChain(messageContext); // Add your own logic here } }
- sequence
- Defines the registered order in which the request handler will be executed. Permitted values range from 0 to 2147483647. The default value is 100. If two sequences are the same in a customized request handler, only the one loaded last will take effect.
- Restart the server and test your REST request handler.