com.alipay.remoting
Class ConnectionEventHandler

java.lang.Object
  extended by io.netty.channel.ChannelHandlerAdapter
      extended by io.netty.channel.ChannelInboundHandlerAdapter
          extended by io.netty.channel.ChannelDuplexHandler
              extended by com.alipay.remoting.ConnectionEventHandler
All Implemented Interfaces:
io.netty.channel.ChannelHandler, io.netty.channel.ChannelInboundHandler, io.netty.channel.ChannelOutboundHandler
Direct Known Subclasses:
RpcConnectionEventHandler

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

Log the channel status event.


Nested Class Summary
 class ConnectionEventHandler.ConnectionEventExecutor
          Dispatch connection event.
 
Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
io.netty.channel.ChannelHandler.Sharable
 
Constructor Summary
ConnectionEventHandler()
           
ConnectionEventHandler(GlobalSwitch globalSwitch)
           
 
Method Summary
 void channelActive(io.netty.channel.ChannelHandlerContext ctx)
           
 void channelInactive(io.netty.channel.ChannelHandlerContext ctx)
           
 void channelRegistered(io.netty.channel.ChannelHandlerContext ctx)
           
 void channelUnregistered(io.netty.channel.ChannelHandlerContext ctx)
           
 void close(io.netty.channel.ChannelHandlerContext ctx, io.netty.channel.ChannelPromise promise)
           
 void connect(io.netty.channel.ChannelHandlerContext ctx, SocketAddress remoteAddress, SocketAddress localAddress, io.netty.channel.ChannelPromise promise)
           
 void disconnect(io.netty.channel.ChannelHandlerContext ctx, io.netty.channel.ChannelPromise promise)
           
 void exceptionCaught(io.netty.channel.ChannelHandlerContext ctx, Throwable cause)
           
 ConnectionEventListener getConnectionEventListener()
          Getter method for property listener.
 ConnectionManager getConnectionManager()
          Getter method for property connectionManager.
 void setConnectionEventListener(ConnectionEventListener listener)
          Setter method for property listener.
 void setConnectionManager(ConnectionManager connectionManager)
          Setter method for property connectionManager.
 void setReconnectManager(ReconnectManager reconnectManager)
          Setter method for property reconnectManager.
 void userEventTriggered(io.netty.channel.ChannelHandlerContext ctx, Object event)
           
 
Methods inherited from class io.netty.channel.ChannelDuplexHandler
bind, deregister, flush, read, write
 
Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelRead, channelReadComplete, channelWritabilityChanged
 
Methods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, 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
handlerAdded, handlerRemoved
 

Constructor Detail

ConnectionEventHandler

public ConnectionEventHandler()

ConnectionEventHandler

public ConnectionEventHandler(GlobalSwitch globalSwitch)
Method Detail

connect

public void connect(io.netty.channel.ChannelHandlerContext ctx,
                    SocketAddress remoteAddress,
                    SocketAddress localAddress,
                    io.netty.channel.ChannelPromise promise)
             throws Exception
Specified by:
connect in interface io.netty.channel.ChannelOutboundHandler
Overrides:
connect in class io.netty.channel.ChannelDuplexHandler
Throws:
Exception
See Also:
ChannelDuplexHandler.connect(io.netty.channel.ChannelHandlerContext, java.net.SocketAddress, java.net.SocketAddress, io.netty.channel.ChannelPromise)

disconnect

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

close

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

channelRegistered

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

channelUnregistered

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

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

userEventTriggered

public void userEventTriggered(io.netty.channel.ChannelHandlerContext ctx,
                               Object event)
                        throws Exception
Specified by:
userEventTriggered in interface io.netty.channel.ChannelInboundHandler
Overrides:
userEventTriggered in class io.netty.channel.ChannelInboundHandlerAdapter
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

getConnectionEventListener

public ConnectionEventListener getConnectionEventListener()
Getter method for property listener.

Returns:
property value of listener

setConnectionEventListener

public void setConnectionEventListener(ConnectionEventListener listener)
Setter method for property listener.

Parameters:
listener - value to be assigned to property listener

getConnectionManager

public ConnectionManager getConnectionManager()
Getter method for property connectionManager.

Returns:
property value of connectionManager

setConnectionManager

public void setConnectionManager(ConnectionManager connectionManager)
Setter method for property connectionManager.

Parameters:
connectionManager - value to be assigned to property connectionManager

setReconnectManager

public void setReconnectManager(ReconnectManager reconnectManager)
Setter method for property reconnectManager.

Parameters:
reconnectManager - value to be assigned to property reconnectManager


Copyright © 2018. All rights reserved.