com.alibaba.dubbo.remoting.transport.netty4
Class NettyClientHandler

java.lang.Object
  extended by io.netty.channel.ChannelHandlerAdapter
      extended by io.netty.channel.ChannelInboundHandlerAdapter
          extended by io.netty.channel.ChannelDuplexHandler
              extended by com.alibaba.dubbo.remoting.transport.netty4.NettyClientHandler
All Implemented Interfaces:
io.netty.channel.ChannelHandler, io.netty.channel.ChannelInboundHandler, io.netty.channel.ChannelOutboundHandler

@ChannelHandler.Sharable
public class NettyClientHandler
extends io.netty.channel.ChannelDuplexHandler

NettyClientHandler

Author:
william.liangf, qinliujie

Nested Class Summary
 
Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
io.netty.channel.ChannelHandler.Sharable
 
Constructor Summary
NettyClientHandler(URL url, ChannelHandler handler)
           
 
Method Summary
 void channelActive(io.netty.channel.ChannelHandlerContext ctx)
           
 void channelInactive(io.netty.channel.ChannelHandlerContext ctx)
           
 void channelRead(io.netty.channel.ChannelHandlerContext ctx, Object msg)
           
 void disconnect(io.netty.channel.ChannelHandlerContext ctx, io.netty.channel.ChannelPromise future)
           
 void exceptionCaught(io.netty.channel.ChannelHandlerContext ctx, Throwable cause)
           
 void write(io.netty.channel.ChannelHandlerContext ctx, Object msg, io.netty.channel.ChannelPromise promise)
           
 
Methods inherited from class io.netty.channel.ChannelDuplexHandler
bind, close, connect, deregister, flush, read
 
Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, userEventTriggered
 
Methods inherited from class io.netty.channel.ChannelHandlerAdapter
handlerAdded, handlerRemoved, isSharable
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface io.netty.channel.ChannelHandler
handlerAdded, handlerRemoved
 

Constructor Detail

NettyClientHandler

public NettyClientHandler(URL url,
                          ChannelHandler handler)
Method Detail

channelActive

public void channelActive(io.netty.channel.ChannelHandlerContext ctx)
                   throws Exception
Specified by:
channelActive in interface io.netty.channel.ChannelInboundHandler
Overrides:
channelActive in class io.netty.channel.ChannelInboundHandlerAdapter
Throws:
Exception

channelInactive

public void channelInactive(io.netty.channel.ChannelHandlerContext ctx)
                     throws Exception
Specified by:
channelInactive in interface io.netty.channel.ChannelInboundHandler
Overrides:
channelInactive in class io.netty.channel.ChannelInboundHandlerAdapter
Throws:
Exception

disconnect

public void disconnect(io.netty.channel.ChannelHandlerContext ctx,
                       io.netty.channel.ChannelPromise future)
                throws Exception
Specified by:
disconnect in interface io.netty.channel.ChannelOutboundHandler
Overrides:
disconnect in class io.netty.channel.ChannelDuplexHandler
Throws:
Exception

channelRead

public void channelRead(io.netty.channel.ChannelHandlerContext ctx,
                        Object msg)
                 throws Exception
Specified by:
channelRead in interface io.netty.channel.ChannelInboundHandler
Overrides:
channelRead in class io.netty.channel.ChannelInboundHandlerAdapter
Throws:
Exception

write

public void write(io.netty.channel.ChannelHandlerContext ctx,
                  Object msg,
                  io.netty.channel.ChannelPromise promise)
           throws Exception
Specified by:
write in interface io.netty.channel.ChannelOutboundHandler
Overrides:
write in class io.netty.channel.ChannelDuplexHandler
Throws:
Exception

exceptionCaught

public void exceptionCaught(io.netty.channel.ChannelHandlerContext ctx,
                            Throwable cause)
                     throws Exception
Specified by:
exceptionCaught in interface io.netty.channel.ChannelHandler
Specified by:
exceptionCaught in interface io.netty.channel.ChannelInboundHandler
Overrides:
exceptionCaught in class io.netty.channel.ChannelInboundHandlerAdapter
Throws:
Exception


Copyright © 2012–2017 Alibaba. All rights reserved.