netty5/transport/src/main/java/io/netty/channel/ChannelHandlerAdapter.java

73 lines
2.3 KiB
Java
Raw Normal View History

package io.netty.channel;
import java.net.SocketAddress;
public abstract class ChannelHandlerAdapter<I, O> extends AbstractChannelHandler
implements ChannelInboundHandler<I>, ChannelOutboundHandler<O> {
@Override
public void channelRegistered(ChannelInboundHandlerContext<I> ctx) throws Exception {
ctx.fireChannelRegistered();
}
@Override
public void channelUnregistered(ChannelInboundHandlerContext<I> ctx) throws Exception {
ctx.fireChannelUnregistered();
}
@Override
public void channelActive(ChannelInboundHandlerContext<I> ctx) throws Exception {
ctx.fireChannelActive();
}
@Override
public void channelInactive(ChannelInboundHandlerContext<I> ctx) throws Exception {
ctx.fireChannelInactive();
}
@Override
public void exceptionCaught(ChannelInboundHandlerContext<I> ctx, Throwable cause) throws Exception {
ctx.fireExceptionCaught(cause);
}
@Override
public void userEventTriggered(ChannelInboundHandlerContext<I> ctx, Object evt) throws Exception {
ctx.fireUserEventTriggered(evt);
}
@Override
public void inboundBufferUpdated(ChannelInboundHandlerContext<I> ctx) throws Exception {
ChannelInboundHandlerAdapter.inboundBufferUpdated0(ctx);
}
@Override
public void bind(ChannelOutboundHandlerContext<O> ctx, SocketAddress localAddress, ChannelFuture future) throws Exception {
ctx.bind(localAddress, future);
}
@Override
public void connect(ChannelOutboundHandlerContext<O> ctx, SocketAddress remoteAddress, SocketAddress localAddress, ChannelFuture future) throws Exception {
ctx.connect(remoteAddress, localAddress, future);
}
@Override
public void disconnect(ChannelOutboundHandlerContext<O> ctx, ChannelFuture future) throws Exception {
ctx.disconnect(future);
}
@Override
public void close(ChannelOutboundHandlerContext<O> ctx, ChannelFuture future) throws Exception {
ctx.close(future);
}
@Override
public void deregister(ChannelOutboundHandlerContext<O> ctx, ChannelFuture future) throws Exception {
ctx.deregister(future);
}
@Override
public void flush(ChannelOutboundHandlerContext<O> ctx, ChannelFuture future) throws Exception {
ChannelOutboundHandlerAdapter.flush0(ctx, future);
}
}