作者 crossoverJie

:recycle: Refactoring code.

@@ -52,8 +52,6 @@ public class CIMClientHandle extends SimpleChannelInboundHandler<CIMResponseProt @@ -52,8 +52,6 @@ public class CIMClientHandle extends SimpleChannelInboundHandler<CIMResponseProt
52 if (evt instanceof IdleStateEvent){ 52 if (evt instanceof IdleStateEvent){
53 IdleStateEvent idleStateEvent = (IdleStateEvent) evt ; 53 IdleStateEvent idleStateEvent = (IdleStateEvent) evt ;
54 54
55 - //LOGGER.info("定时检测服务端是否存活");  
56 -  
57 if (idleStateEvent.state() == IdleState.WRITER_IDLE){ 55 if (idleStateEvent.state() == IdleState.WRITER_IDLE){
58 CIMRequestProto.CIMReqProtocol heartBeat = SpringBeanFactory.getBean("heartBeat", 56 CIMRequestProto.CIMReqProtocol heartBeat = SpringBeanFactory.getBean("heartBeat",
59 CIMRequestProto.CIMReqProtocol.class); 57 CIMRequestProto.CIMReqProtocol.class);
@@ -37,7 +37,7 @@ public class ShutDownCommand implements InnerCommand { @@ -37,7 +37,7 @@ public class ShutDownCommand implements InnerCommand {
37 private MsgLogger msgLogger; 37 private MsgLogger msgLogger;
38 38
39 @Resource(name = "callBackThreadPool") 39 @Resource(name = "callBackThreadPool")
40 - private ThreadPoolExecutor executor; 40 + private ThreadPoolExecutor callBackExecutor;
41 41
42 @Autowired 42 @Autowired
43 private EchoService echoService ; 43 private EchoService echoService ;
@@ -55,10 +55,10 @@ public class ShutDownCommand implements InnerCommand { @@ -55,10 +55,10 @@ public class ShutDownCommand implements InnerCommand {
55 shutDownMsg.shutdown(); 55 shutDownMsg.shutdown();
56 routeRequest.offLine(); 56 routeRequest.offLine();
57 msgLogger.stop(); 57 msgLogger.stop();
58 - executor.shutdown(); 58 + callBackExecutor.shutdown();
59 ringBufferWheel.stop(false); 59 ringBufferWheel.stop(false);
60 try { 60 try {
61 - while (!executor.awaitTermination(1, TimeUnit.SECONDS)) { 61 + while (!callBackExecutor.awaitTermination(1, TimeUnit.SECONDS)) {
62 echoService.echo("thread pool closing"); 62 echoService.echo("thread pool closing");
63 } 63 }
64 cimClient.close(); 64 cimClient.close();