Package io.netty.channel
Class ChannelOutboundHandlerAdapter
- java.lang.Object
-
- io.netty.channel.ChannelHandlerAdapter
-
- io.netty.channel.ChannelOutboundHandlerAdapter
-
- All Implemented Interfaces:
ChannelHandler,ChannelOutboundHandler
- Direct Known Subclasses:
DynamicAddressConnectHandler,MessageToByteEncoder,MessageToMessageEncoder,ResolveAddressHandler,WriteTimeoutHandler
public class ChannelOutboundHandlerAdapter extends ChannelHandlerAdapter implements ChannelOutboundHandler
Skeleton implementation of aChannelOutboundHandler. This implementation just forwards each method call via theChannelHandlerContext.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
ChannelHandler.Sharable
-
-
Constructor Summary
Constructors Constructor Description ChannelOutboundHandlerAdapter()
-
Method Summary
-
Methods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, exceptionCaught, handlerAdded, handlerRemoved, isSharable
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.netty.channel.ChannelHandler
exceptionCaught, handlerAdded, handlerRemoved
-
-
-
-
Method Detail
-
bind
public void bind(ChannelHandlerContext ctx, java.net.SocketAddress localAddress, ChannelPromise promise) throws java.lang.Exception
CallsChannelOutboundInvoker.bind(SocketAddress, ChannelPromise)to forward to the nextChannelOutboundHandlerin theChannelPipeline. Sub-classes may override this method to change behavior.- Specified by:
bindin interfaceChannelOutboundHandler- Parameters:
ctx- theChannelHandlerContextfor which the bind operation is madelocalAddress- theSocketAddressto which it should boundpromise- theChannelPromiseto notify once the operation completes- Throws:
java.lang.Exception- thrown if an error occurs
-
connect
public void connect(ChannelHandlerContext ctx, java.net.SocketAddress remoteAddress, java.net.SocketAddress localAddress, ChannelPromise promise) throws java.lang.Exception
CallsChannelOutboundInvoker.connect(SocketAddress, SocketAddress, ChannelPromise)to forward to the nextChannelOutboundHandlerin theChannelPipeline. Sub-classes may override this method to change behavior.- Specified by:
connectin interfaceChannelOutboundHandler- Parameters:
ctx- theChannelHandlerContextfor which the connect operation is maderemoteAddress- theSocketAddressto which it should connectlocalAddress- theSocketAddresswhich is used as source on connectpromise- theChannelPromiseto notify once the operation completes- Throws:
java.lang.Exception- thrown if an error occurs
-
disconnect
public void disconnect(ChannelHandlerContext ctx, ChannelPromise promise) throws java.lang.Exception
CallsChannelOutboundInvoker.disconnect(ChannelPromise)to forward to the nextChannelOutboundHandlerin theChannelPipeline. Sub-classes may override this method to change behavior.- Specified by:
disconnectin interfaceChannelOutboundHandler- Parameters:
ctx- theChannelHandlerContextfor which the disconnect operation is madepromise- theChannelPromiseto notify once the operation completes- Throws:
java.lang.Exception- thrown if an error occurs
-
close
public void close(ChannelHandlerContext ctx, ChannelPromise promise) throws java.lang.Exception
CallsChannelOutboundInvoker.close(ChannelPromise)to forward to the nextChannelOutboundHandlerin theChannelPipeline. Sub-classes may override this method to change behavior.- Specified by:
closein interfaceChannelOutboundHandler- Parameters:
ctx- theChannelHandlerContextfor which the close operation is madepromise- theChannelPromiseto notify once the operation completes- Throws:
java.lang.Exception- thrown if an error occurs
-
deregister
public void deregister(ChannelHandlerContext ctx, ChannelPromise promise) throws java.lang.Exception
CallsChannelOutboundInvoker.deregister(ChannelPromise)to forward to the nextChannelOutboundHandlerin theChannelPipeline. Sub-classes may override this method to change behavior.- Specified by:
deregisterin interfaceChannelOutboundHandler- Parameters:
ctx- theChannelHandlerContextfor which the close operation is madepromise- theChannelPromiseto notify once the operation completes- Throws:
java.lang.Exception- thrown if an error occurs
-
read
public void read(ChannelHandlerContext ctx) throws java.lang.Exception
CallsChannelHandlerContext.read()to forward to the nextChannelOutboundHandlerin theChannelPipeline. Sub-classes may override this method to change behavior.- Specified by:
readin interfaceChannelOutboundHandler- Throws:
java.lang.Exception
-
write
public void write(ChannelHandlerContext ctx, java.lang.Object msg, ChannelPromise promise) throws java.lang.Exception
CallsChannelOutboundInvoker.write(Object, ChannelPromise)to forward to the nextChannelOutboundHandlerin theChannelPipeline. Sub-classes may override this method to change behavior.- Specified by:
writein interfaceChannelOutboundHandler- Parameters:
ctx- theChannelHandlerContextfor which the write operation is mademsg- the message to writepromise- theChannelPromiseto notify once the operation completes- Throws:
java.lang.Exception- thrown if an error occurs
-
flush
public void flush(ChannelHandlerContext ctx) throws java.lang.Exception
CallsChannelHandlerContext.flush()to forward to the nextChannelOutboundHandlerin theChannelPipeline. Sub-classes may override this method to change behavior.- Specified by:
flushin interfaceChannelOutboundHandler- Parameters:
ctx- theChannelHandlerContextfor which the flush operation is made- Throws:
java.lang.Exception- thrown if an error occurs
-
-