@ChannelHandler.Sharable public class HelloWorldHttp2Handler extends ChannelDuplexHandler
This example is making use of the "multiplexing" http2 API, where streams are mapped to child Channels. This API is very experimental and incomplete.
ChannelHandler.Sharable
Constructor and Description |
---|
HelloWorldHttp2Handler() |
Modifier and Type | Method and Description |
---|---|
void |
channelRead(ChannelHandlerContext ctx,
Object msg)
Calls
ChannelHandlerContext.fireChannelRead(Object) to forward
to the next ChannelInboundHandler in the ChannelPipeline . |
void |
exceptionCaught(ChannelHandlerContext ctx,
Throwable cause)
Calls
ChannelHandlerContext.fireExceptionCaught(Throwable) to forward
to the next ChannelHandler in the ChannelPipeline . |
void |
onDataRead(ChannelHandlerContext ctx,
Http2DataFrame data)
If receive a frame with end-of-stream set, send a pre-canned response.
|
void |
onHeadersRead(ChannelHandlerContext ctx,
Http2HeadersFrame headers)
If receive a frame with end-of-stream set, send a pre-canned response.
|
bind, close, connect, deregister, disconnect, flush, read, write
channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, userEventTriggered
ensureNotSharable, handlerAdded, handlerRemoved, isSharable
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
handlerAdded, handlerRemoved
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception
ChannelInboundHandlerAdapter
ChannelHandlerContext.fireExceptionCaught(Throwable)
to forward
to the next ChannelHandler
in the ChannelPipeline
.
Sub-classes may override this method to change behavior.exceptionCaught
in interface ChannelHandler
exceptionCaught
in interface ChannelInboundHandler
exceptionCaught
in class ChannelInboundHandlerAdapter
Exception
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception
ChannelInboundHandlerAdapter
ChannelHandlerContext.fireChannelRead(Object)
to forward
to the next ChannelInboundHandler
in the ChannelPipeline
.
Sub-classes may override this method to change behavior.channelRead
in interface ChannelInboundHandler
channelRead
in class ChannelInboundHandlerAdapter
Exception
public void onDataRead(ChannelHandlerContext ctx, Http2DataFrame data) throws Exception
Exception
public void onHeadersRead(ChannelHandlerContext ctx, Http2HeadersFrame headers) throws Exception
Exception
Copyright © 2008–2017 The Netty Project. All rights reserved.