com.alipay.sofa.rpc.log.Logger.info()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(7.0k)|赞(0)|评价(0)|浏览(302)

本文整理了Java中com.alipay.sofa.rpc.log.Logger.info()方法的一些代码示例,展示了Logger.info()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Logger.info()方法的具体详情如下:
包路径:com.alipay.sofa.rpc.log.Logger
类名称:Logger
方法名:info

Logger.info介绍

[英]Info.
[中]信息。

代码示例

代码示例来源:origin: alipay/sofa-rpc

@Override
  public String echoStr(String arg) {
    LOGGER.info(arg);
    return arg;
  }
}

代码示例来源:origin: alipay/sofa-rpc

public SnappyRpcCompressor() {
  if (LOGGER.isInfoEnabled()) {
    LOGGER.info("Init Snappy compressor");
  }
}

代码示例来源:origin: alipay/sofa-rpc

public SnappyRpcCompressor() {
  if (LOGGER.isInfoEnabled()) {
    LOGGER.info("Init Snappy compressor");
  }
}

代码示例来源:origin: alipay/sofa-rpc

@Override
  public void stop() {
    if (LOGGER.isInfoEnabled()) {
      LOGGER.info("Shutdown the SOFA RPC HTTP/2 server transport now...");
    }
    NettyHelper.closeServerBossEventLoopGroup(transportConfig);
    if (bizGroup != null) {
      bizGroup.shutdownGracefully();
    }
    serverBootstrap = null;
  }
}

代码示例来源:origin: alipay/sofa-rpc

@Override
  public void stop() {
    if (LOGGER.isInfoEnabled()) {
      LOGGER.info("Shutdown the SOFA RPC HTTP/2 server transport now...");
    }
    NettyHelper.closeServerBossEventLoopGroup(transportConfig);
    if (bizGroup != null) {
      bizGroup.shutdownGracefully();
    }
    serverBootstrap = null;
  }
}

代码示例来源:origin: alipay/sofa-rpc

@Override
  public void stateChanged(CuratorFramework client, ConnectionState newState) {
    if (LOGGER.isInfoEnabled()) {
      LOGGER.info("reconnect to zookeeper,recover provider and consumer data");
    }
    if (newState == ConnectionState.RECONNECTED) {
      recoverRegistryData();
    }
  }
});

代码示例来源:origin: alipay/sofa-rpc

@Override
  public void stateChanged(CuratorFramework client, ConnectionState newState) {
    if (LOGGER.isInfoEnabled()) {
      LOGGER.info("reconnect to zookeeper,recover provider and consumer data");
    }
    if (newState == ConnectionState.RECONNECTED) {
      recoverRegistryData();
    }
  }
});

代码示例来源:origin: alipay/sofa-rpc

@Override
  public void userEventTriggered(ChannelHandlerContext ctx, Object evt) {
    if (LOGGER.isInfoEnabled()) {
      LOGGER.info("User Event Triggered: {}", evt);
    }
    ctx.fireUserEventTriggered(evt);
  }
}

代码示例来源:origin: alipay/sofa-rpc

@Override
public void channelInactive(final ChannelHandlerContext ctx) throws Exception {
  Channel channel = ctx.channel();
  if (LOGGER.isInfoEnabled()) {
    LOGGER.info("Channel inactive: {}", channel);
  }
  final Exception e = new SofaRpcException(RpcErrorType.CLIENT_NETWORK, "Channel "
    + NetUtils.channelToString(channel.localAddress(), channel.remoteAddress())
    + " has been closed, remove future when channel inactive.");
  Iterator<Entry<Integer, Entry<ChannelFuture, AbstractHttpClientHandler>>> it =
      streamIdPromiseMap.entrySet().iterator();
  while (it.hasNext()) {
    Map.Entry<Integer, Entry<ChannelFuture, AbstractHttpClientHandler>> mapEntry = it.next();
    it.remove();
    Entry<ChannelFuture, AbstractHttpClientHandler> entry = mapEntry.getValue();
    entry.getValue().onException(e);
  }
}

代码示例来源:origin: alipay/sofa-rpc

@Override
  public void userEventTriggered(ChannelHandlerContext ctx, Object evt) {
    if (LOGGER.isInfoEnabled()) {
      LOGGER.info("User Event Triggered: {}", evt);
    }
    ctx.fireUserEventTriggered(evt);
  }
}

代码示例来源:origin: alipay/sofa-rpc

@Override
public void channelInactive(final ChannelHandlerContext ctx) throws Exception {
  Channel channel = ctx.channel();
  if (LOGGER.isInfoEnabled()) {
    LOGGER.info("Channel inactive: {}", channel);
  }
  final Exception e = new SofaRpcException(RpcErrorType.CLIENT_NETWORK, "Channel "
    + NetUtils.channelToString(channel.localAddress(), channel.remoteAddress())
    + " has been closed, remove future when channel inactive.");
  Iterator<Entry<Integer, Entry<ChannelFuture, AbstractHttpClientHandler>>> it =
      streamIdPromiseMap.entrySet().iterator();
  while (it.hasNext()) {
    Map.Entry<Integer, Entry<ChannelFuture, AbstractHttpClientHandler>> mapEntry = it.next();
    it.remove();
    Entry<ChannelFuture, AbstractHttpClientHandler> entry = mapEntry.getValue();
    entry.getValue().onException(e);
  }
}

代码示例来源:origin: alipay/sofa-rpc

/**
 * 关闭全部客户端连接
 */
public static void closeAll() {
  if (LOGGER.isInfoEnabled()) {
    LOGGER.info("Shutdown all client transport now!");
  }
  try {
    CLIENT_TRANSPORT_HOLDER.destroy();
  } catch (Exception e) {
    LOGGER.error(e.getMessage(), e);
  }
}

代码示例来源:origin: alipay/sofa-rpc

/**
 * 关闭全部客户端连接
 */
public static void closeAll() {
  if (LOGGER.isInfoEnabled()) {
    LOGGER.info("Shutdown all client transport now!");
  }
  try {
    CLIENT_TRANSPORT_HOLDER.destroy();
  } catch (Exception e) {
    LOGGER.error(e.getMessage(), e);
  }
}

代码示例来源:origin: alipay/sofa-rpc

/**
 * 卸载全部模块
 */
public static void uninstallModules() {
  for (Map.Entry<String, Module> o : INSTALLED_MODULES.entrySet()) {
    String moduleName = o.getKey();
    try {
      if (LOGGER.isInfoEnabled()) {
        LOGGER.info("Uninstall Module: {}", moduleName);
      }
      o.getValue().uninstall();
      INSTALLED_MODULES.remove(moduleName);
    } catch (Exception e) {
      if (LOGGER.isWarnEnabled()) {
        LOGGER.warn("Error when uninstall module " + moduleName, e);
      }
    }
  }
}

代码示例来源:origin: alipay/sofa-rpc

@Override
  public void operationComplete(ChannelFuture future) throws Exception {
    if (future.isSuccess()) {
      if (LOGGER.isInfoEnabled()) {
        LOGGER.info("HTTP/2 Server bind to {}:{} success!",
          transportConfig.getHost(), transportConfig.getPort());
      }
    } else {
      LOGGER.error("HTTP/2 Server bind to {}:{} failed!",
        transportConfig.getHost(), transportConfig.getPort());
      stop();
    }
  }
});

代码示例来源:origin: alipay/sofa-rpc

@Override
  public void operationComplete(ChannelFuture future) throws Exception {
    if (future.isSuccess()) {
      if (LOGGER.isInfoEnabled()) {
        LOGGER.info("HTTP/2 Server bind to {}:{} success!",
          transportConfig.getHost(), transportConfig.getPort());
      }
    } else {
      LOGGER.error("HTTP/2 Server bind to {}:{} failed!",
        transportConfig.getHost(), transportConfig.getPort());
      stop();
    }
  }
});

代码示例来源:origin: alipay/sofa-rpc

@Override
public void stop() {
  if (!started) {
    return;
  }
  try {
    // 关闭端口,不关闭线程池
    if (LOGGER.isInfoEnabled()) {
      LOGGER.info("Stop the http rest server at port {}", serverConfig.getPort());
    }
    httpServer.stop();
  } catch (Exception e) {
    LOGGER.error("Stop the http rest server at port " + serverConfig.getPort() + " error !", e);
  }
  started = false;
}

代码示例来源:origin: alipay/sofa-rpc

@Override
public void stop() {
  if (!started) {
    return;
  }
  try {
    // 关闭端口,不关闭线程池
    if (LOGGER.isInfoEnabled()) {
      LOGGER.info("Stop the http rest server at port {}", serverConfig.getPort());
    }
    httpServer.stop();
  } catch (Exception e) {
    LOGGER.error("Stop the http rest server at port " + serverConfig.getPort() + " error !", e);
  }
  started = false;
}

代码示例来源:origin: alipay/sofa-rpc

@Override
public void disconnect() {
  try {
    if (connection != null) {
      if (LOGGER.isInfoEnabled()) {
        LOGGER.info("Try disconnect client transport now. The connection is {}.",
          NetUtils.channelToString(localAddress(), remoteAddress()));
      }
      connectionManager.closeConnection(RPC_CLIENT, transportConfig, url);
      connection = null;
    }
  } catch (Exception e) {
    throw new SofaRpcRuntimeException("", e);
  }
}

代码示例来源:origin: alipay/sofa-rpc

@Override
public void disconnect() {
  try {
    if (connection != null) {
      if (LOGGER.isInfoEnabled()) {
        LOGGER.info("Try disconnect client transport now. The connection is {}.",
          NetUtils.channelToString(localAddress(), remoteAddress()));
      }
      connectionManager.closeConnection(RPC_CLIENT, transportConfig, url);
      connection = null;
    }
  } catch (Exception e) {
    throw new SofaRpcRuntimeException("", e);
  }
}

相关文章