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