public class HttpHandler extends MessageHandler<HttpConfig,Object>
MessageHandler which processes HttpRequests.
There will be 1 instance of this class per Http request.| Modifier and Type | Field and Description |
|---|---|
protected MediaTypeDecoder |
decoder |
protected HttpConfig |
httpConfig |
protected ParamInjector |
injector |
protected Queue<MediaTypeDecoder> |
mediaTypeDecoders |
protected HttpMethod |
method
The current HTTP method which matches the current
request. |
protected static Class<HttpMethod> |
methodClass |
protected HttpProtocolConfiguration |
protocolConfig |
protected boolean |
replied |
protected HttpRequest |
request
The current HTTP request
|
protected HttpResponse |
res |
config, log, methods| Constructor and Description |
|---|
HttpHandler(HttpProtocolConfiguration config) |
| Modifier and Type | Method and Description |
|---|---|
void |
channelRead0(io.netty.channel.ChannelHandlerContext ctx,
Object msg) |
protected io.netty.channel.ChannelFuture |
doWrite(io.netty.channel.ChannelHandlerContext ctx) |
void |
exceptionCaught(io.netty.channel.ChannelHandlerContext ctx,
Throwable cause) |
<M extends InvokableMethod> |
findMethod(String path,
io.netty.channel.ChannelHandlerContext ctx,
Object msg,
Class<M> methodClass) |
protected void |
invoke(io.netty.channel.ChannelHandlerContext ctx) |
protected io.netty.channel.ChannelFuture |
writeResponse(io.netty.channel.ChannelHandlerContext ctx,
Object response,
Queue<ResponseTransformer> t) |
logDetailedFailMessage, logDetailedFailMessage, setMethodsacceptInboundMessage, channelReadchannelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, userEventTriggeredhandlerAdded, handlerRemoved, isSharableprotected static final Class<HttpMethod> methodClass
protected final Queue<MediaTypeDecoder> mediaTypeDecoders
protected final HttpConfig httpConfig
protected HttpRequest request
protected HttpResponse res
protected HttpMethod method
request.
If no method matches this will be nullprotected ParamInjector injector
protected HttpProtocolConfiguration protocolConfig
protected boolean replied
protected MediaTypeDecoder decoder
public HttpHandler(HttpProtocolConfiguration config)
public void channelRead0(io.netty.channel.ChannelHandlerContext ctx,
Object msg)
throws Exception
public <M extends InvokableMethod> M findMethod(String path, io.netty.channel.ChannelHandlerContext ctx, Object msg, Class<M> methodClass)
findMethod in class MessageHandler<HttpConfig,Object>protected void invoke(io.netty.channel.ChannelHandlerContext ctx)
protected io.netty.channel.ChannelFuture writeResponse(io.netty.channel.ChannelHandlerContext ctx,
Object response,
Queue<ResponseTransformer> t)
protected io.netty.channel.ChannelFuture doWrite(io.netty.channel.ChannelHandlerContext ctx)
public void exceptionCaught(io.netty.channel.ChannelHandlerContext ctx,
Throwable cause)
exceptionCaught in interface io.netty.channel.ChannelHandlerexceptionCaught in interface io.netty.channel.ChannelInboundHandlerexceptionCaught in class io.netty.channel.ChannelInboundHandlerAdapterCopyright © 2012-2015. All Rights Reserved.