public final class VertxHandler<C extends ConnectionBase>
extends io.netty.channel.ChannelDuplexHandler
| Modifier and Type | Method and Description |
|---|---|
VertxHandler<C> |
addHandler(Handler<C> handler)
Set an handler to be called when the connection is set on this handler.
|
void |
channelInactive(io.netty.channel.ChannelHandlerContext chctx) |
void |
channelRead(io.netty.channel.ChannelHandlerContext chctx,
Object msg) |
void |
channelReadComplete(io.netty.channel.ChannelHandlerContext ctx) |
void |
channelWritabilityChanged(io.netty.channel.ChannelHandlerContext ctx) |
void |
close(io.netty.channel.ChannelHandlerContext ctx,
io.netty.channel.ChannelPromise promise) |
static <C extends ConnectionBase> |
create(Function<io.netty.channel.ChannelHandlerContext,C> connectionFactory) |
void |
exceptionCaught(io.netty.channel.ChannelHandlerContext chctx,
Throwable t) |
C |
getConnection() |
void |
handlerAdded(io.netty.channel.ChannelHandlerContext ctx) |
void |
handlerRemoved(io.netty.channel.ChannelHandlerContext ctx) |
VertxHandler<C> |
removeHandler(Handler<C> handler)
Set an handler to be called when the connection is unset from this handler.
|
static io.netty.buffer.ByteBuf |
safeBuffer(io.netty.buffer.ByteBuf buf)
Copy and release the
buf when necessary. |
void |
userEventTriggered(io.netty.channel.ChannelHandlerContext ctx,
Object evt) |
bind, connect, deregister, disconnect, flush, read, writepublic static <C extends ConnectionBase> VertxHandler<C> create(Function<io.netty.channel.ChannelHandlerContext,C> connectionFactory)
public static io.netty.buffer.ByteBuf safeBuffer(io.netty.buffer.ByteBuf buf)
buf when necessary.
This methods assuming the buffer is created by PartialPooledByteBufAllocator and
caller has full ownership of the buffer.
The returned buffer will not need to be released and can be wrapped by a Buffer.
buf - the bufferpublic void handlerAdded(io.netty.channel.ChannelHandlerContext ctx)
handlerAdded in interface io.netty.channel.ChannelHandlerhandlerAdded in class io.netty.channel.ChannelHandlerAdapterpublic void handlerRemoved(io.netty.channel.ChannelHandlerContext ctx)
throws Exception
handlerRemoved in interface io.netty.channel.ChannelHandlerhandlerRemoved in class io.netty.channel.ChannelHandlerAdapterExceptionpublic VertxHandler<C> addHandler(Handler<C> handler)
handler - the handler to be notifiedpublic VertxHandler<C> removeHandler(Handler<C> handler)
handler - the handler to be notifiedpublic C getConnection()
public void channelWritabilityChanged(io.netty.channel.ChannelHandlerContext ctx)
channelWritabilityChanged in interface io.netty.channel.ChannelInboundHandlerchannelWritabilityChanged in class io.netty.channel.ChannelInboundHandlerAdapterpublic void exceptionCaught(io.netty.channel.ChannelHandlerContext chctx,
Throwable t)
exceptionCaught in interface io.netty.channel.ChannelHandlerexceptionCaught in interface io.netty.channel.ChannelInboundHandlerexceptionCaught in class io.netty.channel.ChannelInboundHandlerAdapterpublic void channelInactive(io.netty.channel.ChannelHandlerContext chctx)
channelInactive in interface io.netty.channel.ChannelInboundHandlerchannelInactive in class io.netty.channel.ChannelInboundHandlerAdapterpublic void channelReadComplete(io.netty.channel.ChannelHandlerContext ctx)
channelReadComplete in interface io.netty.channel.ChannelInboundHandlerchannelReadComplete in class io.netty.channel.ChannelInboundHandlerAdapterpublic void channelRead(io.netty.channel.ChannelHandlerContext chctx,
Object msg)
channelRead in interface io.netty.channel.ChannelInboundHandlerchannelRead in class io.netty.channel.ChannelInboundHandlerAdapterpublic void close(io.netty.channel.ChannelHandlerContext ctx,
io.netty.channel.ChannelPromise promise)
throws Exception
close in interface io.netty.channel.ChannelOutboundHandlerclose in class io.netty.channel.ChannelDuplexHandlerExceptionpublic void userEventTriggered(io.netty.channel.ChannelHandlerContext ctx,
Object evt)
throws Exception
userEventTriggered in interface io.netty.channel.ChannelInboundHandleruserEventTriggered in class io.netty.channel.ChannelInboundHandlerAdapterExceptionCopyright © 2021. All rights reserved.