upd: 日志统一
This commit is contained in:
parent
e187a378d5
commit
767c710e84
|
@ -29,17 +29,19 @@ public class ConfigClientHandler extends ChannelInboundHandlerAdapter {
|
|||
|
||||
@Override
|
||||
public void channelRegistered(ChannelHandlerContext ctx) throws Exception {
|
||||
logger.info("当Channel已经注册到它的EventLoop并且能够处理I/O时被调用");
|
||||
/// logger.info("当Channel已经注册到它的EventLoop并且能够处理I/O时被调用");
|
||||
super.channelRegistered(ctx);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void channelUnregistered(ChannelHandlerContext ctx) throws Exception {
|
||||
logger.info("当Channel从它的EventLoop注销并且无法处理任何I/O时被调用");
|
||||
/// logger.info("当Channel从它的EventLoop注销并且无法处理任何I/O时被调用");
|
||||
super.channelUnregistered(ctx);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void channelActive(ChannelHandlerContext ctx) throws Exception {
|
||||
logger.info("当Channel处于活动状态(已经连接到它的远程节点)时被调用, 注册客户端");
|
||||
/// logger.info("当Channel处于活动状态(已经连接到它的远程节点)时被调用, 注册客户端");
|
||||
SmallMessage smallMessage = new SmallMessage();
|
||||
smallMessage.setType(TransferMessageType.REGISTER);
|
||||
smallMessage.setResp(SmallMessage.Response.ok(ClientConfigLoader.clientInfo));
|
||||
|
@ -48,8 +50,9 @@ public class ConfigClientHandler extends ChannelInboundHandlerAdapter {
|
|||
|
||||
@Override
|
||||
public void channelInactive(ChannelHandlerContext ctx) throws Exception {
|
||||
logger.info("当Channel离开活动状态并且不再连接到它的远程节点时被调用");
|
||||
/// logger.info("当Channel离开活动状态并且不再连接到它的远程节点时被调用");
|
||||
/// this.configClient.reConnect();
|
||||
super.channelInactive(ctx);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -109,7 +109,7 @@ public class ConfigServerHandler extends ChannelInboundHandlerAdapter {
|
|||
|
||||
@Override
|
||||
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
|
||||
log.error("当Channel发生异常被调用", cause);
|
||||
log.error("Channel发生异常", cause);
|
||||
/// cause.printStackTrace();
|
||||
ConfigClientManage.unregister(ctx.channel().id());
|
||||
ctx.close();
|
||||
|
@ -117,13 +117,13 @@ public class ConfigServerHandler extends ChannelInboundHandlerAdapter {
|
|||
|
||||
@Override
|
||||
public void channelInactive(ChannelHandlerContext ctx) throws Exception {
|
||||
log.info("当Channel处于非活动状态(已经连接到它的远程节点)时被调用");
|
||||
/// log.info("当Channel处于非活动状态(已经连接到它的远程节点)时被调用");
|
||||
ConfigClientManage.unregister(ctx.channel().id());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void channelUnregistered(ChannelHandlerContext ctx) throws Exception {
|
||||
log.info("当Channel从它的EventLoop注销并且不能够处理I/O时被调用");
|
||||
/// log.info("当Channel从它的EventLoop注销并且不能够处理I/O时被调用");
|
||||
ConfigClientManage.unregister(ctx.channel().id());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue