public interface RequestHandler<T>
Classes implementing this interface and populated as service using the SPI service-manifest are pickup by the serving plugin architectur and automatically registered as RequestHandler for HTTP Requests.
| Modifier and Type | Method and Description |
|---|---|
boolean |
acceptInboundMessage(java.lang.Object msg)
Returns true if this handler can handle the incoming HTTP request.
|
T |
handleRequest(io.netty.channel.ChannelHandlerContext ctx,
io.netty.handler.codec.http.FullHttpRequest req,
io.netty.handler.codec.http.QueryStringDecoder decoder,
java.lang.String[] segments)
The main method which handles request.
|
boolean acceptInboundMessage(java.lang.Object msg)
The interface following the chain of responsibility pattern.
msg - the incoming HTTP messageT handleRequest(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.FullHttpRequest req, io.netty.handler.codec.http.QueryStringDecoder decoder, java.lang.String[] segments)
This method is called by the framework if acceptInboundMessage indicates that this
handler can handle the request.
ctx - the handler context.req - the full HttpRequest object.decoder - a query string decoder helps to parse the url query string.segments - array of splitted segments of the path.