接口 Business<T,U>

所有已知实现类:
BusinessHttp4, BusinessHttp7, BusinessTcp

public interface Business<T,U>
  • 方法概要

    修饰符和类型
    方法
    说明
    void
    close(io.netty.channel.Channel channel)
    链接关闭
    boolean
    connectController(io.netty.channel.ChannelHandlerContext ctx, boolean connectResult, int connectNum, Throwable error)
    失败是否重连,同时告知连接结果 返回真标识重新重连
    void
    exceptionCaught(io.netty.channel.ChannelHandlerContext ctx, Throwable cause)
    全局异常
    getProxyHost(io.netty.channel.ChannelHandlerContext ctx, T t, SocketAddress sourceSocketAddress)
    代理host 业务代码只处理选择什么样的服务,比如常见随机模式 hash模式 循环模式等
    in(io.netty.channel.ChannelHandlerContext ctx, T t)
    数据入场 业务处理模式,拦截器 限流等
    out(io.netty.channel.Channel channel, U u)
    数据出场 数据加密等操作
  • 方法详细资料

    • in

      Object in(io.netty.channel.ChannelHandlerContext ctx, T t)
      数据入场 业务处理模式,拦截器 限流等
      参数:
      t -
      返回:
    • getProxyHost

      SocketAddress getProxyHost(io.netty.channel.ChannelHandlerContext ctx, T t, SocketAddress sourceSocketAddress)
      代理host 业务代码只处理选择什么样的服务,比如常见随机模式 hash模式 循环模式等
      参数:
      t -
      sourceSocketAddress -
      返回:
    • out

      Object out(io.netty.channel.Channel channel, U u)
      数据出场 数据加密等操作
      参数:
      u -
      返回:
    • close

      void close(io.netty.channel.Channel channel)
      链接关闭
      参数:
      channel -
    • connectController

      boolean connectController(io.netty.channel.ChannelHandlerContext ctx, boolean connectResult, int connectNum, Throwable error)
      失败是否重连,同时告知连接结果 返回真标识重新重连
      参数:
      ctx -
      connectResult - 连接结果
      connectNum - 连接次数
      error - 连接错误
      返回:
    • exceptionCaught

      void exceptionCaught(io.netty.channel.ChannelHandlerContext ctx, Throwable cause)
      全局异常
      参数:
      ctx -
      cause -