Эх сурвалжийг харах

netty close method update

shjung 18 цаг өмнө
parent
commit
520eeff134

+ 7 - 0
conf/dsrc-comm-server.yml

@@ -0,0 +1,7 @@
+spring:
+  datasource:
+    hikari:
+      driver-class-name: oracle.jdbc.OracleDriver
+      jdbc-url: jdbc:oracle:thin:@115.91.94.42:1522:HANTE19C
+      username: ptatms
+      password: ptatms

+ 42 - 29
src/main/java/com/its/dsrc/DsrcCommServerApplication.java

@@ -1,6 +1,5 @@
 package com.its.dsrc;
 
-import com.its.app.AppUtils;
 import com.its.app.utils.OS;
 import com.its.app.utils.SysUtils;
 import com.its.dsrc.config.ApplicationConfig;
@@ -17,6 +16,7 @@ import com.its.dsrc.ui.MainUI;
 import com.its.dsrc.xnettcp.center.CenterTcpServerService;
 import com.its.dsrc.xnettcp.dsrc.DsrcTcpCommServerService;
 import com.its.dsrc.xnettcp.dsrc.process.TcpServerDataProcess;
+import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.DisposableBean;
 import org.springframework.beans.factory.InitializingBean;
@@ -49,10 +49,23 @@ import java.nio.charset.Charset;
 @EnableAsync
 @Configuration
 @SpringBootApplication
+@RequiredArgsConstructor
 @ComponentScan(basePackages = {"com.its.dsrc.config", "com.its.dsrc.dao.mapper", "com.its"})
 public class DsrcCommServerApplication implements CommandLineRunner, ApplicationListener<ContextClosedEvent>, InitializingBean, DisposableBean {
 
-    private static String applicationName = "dsrc-comm-server";
+    private final ApplicationConfig applicationConfig;
+    private final RunningConfig runningConfig;
+    private final AppRepository appRepository;
+    private final DbmsDataProcess dbmsDataProcess;
+    private final TcpServerDataProcess tcpServerDataProcess;
+    private final UnitSystService unitSystService;
+    private final RseCtlrService rseCtlrService;
+    private final RseSectService rseSectService;
+    private final MultimediaService multimediaService;
+    private final DsrcTcpCommServerService dsrcTcpCommServerService;
+    private final CenterTcpServerService centerTcpServerService;
+
+    private static final String APPLICATION_NAME = "dsrc-comm-server";
     private static ConfigurableApplicationContext context = null;
 
     public static void main(String[] args) {
@@ -64,7 +77,7 @@ public class DsrcCommServerApplication implements CommandLineRunner, Application
         } catch(Exception e){
         }
 
-        File file1 = new File("./conf/" + applicationName + ".pid");
+        File file1 = new File("./conf/" + APPLICATION_NAME + ".pid");
         if (file1.exists()) {
             System.out.println(System.getProperty("Program Already Running....."));
             log.error("Program Already Running.....");
@@ -73,14 +86,14 @@ public class DsrcCommServerApplication implements CommandLineRunner, Application
         if (OS.isWindows() || OS.isMac()) {
             context = new SpringApplicationBuilder(DsrcCommServerApplication.class)
                     //.web(WebApplicationType.NONE)
-                    .listeners(new ApplicationPidFileWriter("./conf/" + applicationName + ".pid"))
+                    .listeners(new ApplicationPidFileWriter("./conf/" + APPLICATION_NAME + ".pid"))
                     .headless(false)
                     .bannerMode(Banner.Mode.OFF)
                     .run(args);
         } else {
             SpringApplication application = new SpringApplicationBuilder()
                     .sources(DsrcCommServerApplication.class)
-                    .listeners(new ApplicationPidFileWriter("./conf/" + applicationName + ".pid"))
+                    .listeners(new ApplicationPidFileWriter("./conf/" + APPLICATION_NAME + ".pid"))
                     .build();
             application.setBannerMode(Banner.Mode.OFF);
             application.run(args);
@@ -90,15 +103,15 @@ public class DsrcCommServerApplication implements CommandLineRunner, Application
     @Override
     public void run(String... args) throws Exception {
 
-        ApplicationConfig applicationConfig = (ApplicationConfig) AppUtils.getBean(ApplicationConfig.class);
-        RunningConfig runningConfig = (RunningConfig)AppUtils.getBean(RunningConfig.class);
-        AppRepository appRepository = (AppRepository)AppUtils.getBean(AppRepository.class);
+//        ApplicationConfig applicationConfig = (ApplicationConfig) AppUtils.getBean(ApplicationConfig.class);
+//        RunningConfig runningConfig = (RunningConfig)AppUtils.getBean(RunningConfig.class);
+//        AppRepository appRepository = (AppRepository)AppUtils.getBean(AppRepository.class);
 
         if (OS.isWindows() || OS.isMac()) {
             String sysTime = SysUtils.getSysTimeStr();
             //JFrame.setDefaultLookAndFeelDecorated(true);
             JFrame frame = new JFrame("DSRC 통신 서버 - [" + sysTime + "]");
-            MainUI mainUI = new MainUI(frame);
+            MainUI mainUI = new MainUI(frame, appRepository);
             mainUI.updateBindPort(runningConfig.getCommBindingPort());
             SwingUtilities.invokeLater(() -> {
                 try {
@@ -152,13 +165,13 @@ public class DsrcCommServerApplication implements CommandLineRunner, Application
         log.info("************************************************************************************");
 
         // init application
-        DbmsDataProcess dbmsDataProcess = (DbmsDataProcess)AppUtils.getBean(DbmsDataProcess.class);
+//        DbmsDataProcess dbmsDataProcess = (DbmsDataProcess)AppUtils.getBean(DbmsDataProcess.class);
         dbmsDataProcess.run();
 
-        TcpServerDataProcess tcpServerDataProcess = (TcpServerDataProcess)AppUtils.getBean(TcpServerDataProcess.class);
+//        TcpServerDataProcess tcpServerDataProcess = (TcpServerDataProcess)AppUtils.getBean(TcpServerDataProcess.class);
         tcpServerDataProcess.run();
 
-        UnitSystService unitSystService = (UnitSystService)AppUtils.getBean(UnitSystService.class);
+//        UnitSystService unitSystService = (UnitSystService)AppUtils.getBean(UnitSystService.class);
         unitSystService.loadMaster();
         unitSystService.updateUnitSystStts(true);
         TbUnitSyst unit = unitSystService.getUnitSystMap().get(applicationConfig.getId());
@@ -166,14 +179,14 @@ public class DsrcCommServerApplication implements CommandLineRunner, Application
             applicationConfig.setListenPort(unit.getPRGM_PORT());
         }
 
-        RseCtlrService ctlrService = (RseCtlrService)AppUtils.getBean(RseCtlrService.class);
-        ctlrService.loadDb();
-        ctlrService.updateCtlrStts(true);
+//        RseCtlrService rseCtlrService = (RseCtlrService)AppUtils.getBean(RseCtlrService.class);
+        rseCtlrService.loadDb();
+        rseCtlrService.updateCtlrStts(true);
 
-        RseSectService rseSectService = (RseSectService)AppUtils.getBean(RseSectService.class);
+//        RseSectService rseSectService = (RseSectService)AppUtils.getBean(RseSectService.class);
         rseSectService.loadMaster();
 
-        MultimediaService multimediaService = (MultimediaService)AppUtils.getBean(MultimediaService.class);
+//        MultimediaService multimediaService = (MultimediaService)AppUtils.getBean(MultimediaService.class);
         multimediaService.loadMaster();
 
         applicationConfig.setControllerBindingPort(runningConfig.getCommBindingPort());
@@ -182,29 +195,29 @@ public class DsrcCommServerApplication implements CommandLineRunner, Application
         applicationConfig.setStartSchedule(true);
 
         if (OS.isWindows() || OS.isMac()) {
-            MainUI UI = MainUI.getInstance();
-            if (UI != null) {
-                UI.loadControllerInfo(appRepository);
+            MainUI mainUI = MainUI.getInstance();
+            if (mainUI != null) {
+                mainUI.loadControllerInfo();
             }
         }
 
-        DsrcTcpCommServerService dsrcTcpCommServerService = (DsrcTcpCommServerService)AppUtils.getBean(DsrcTcpCommServerService.class);
+//        DsrcTcpCommServerService dsrcTcpCommServerService = (DsrcTcpCommServerService)AppUtils.getBean(DsrcTcpCommServerService.class);
         dsrcTcpCommServerService.run();
 
-        CenterTcpServerService centerService = (CenterTcpServerService)AppUtils.getBean(CenterTcpServerService.class);
-        centerService.run();
+//        CenterTcpServerService centerTcpServerService = (CenterTcpServerService)AppUtils.getBean(CenterTcpServerService.class);
+        centerTcpServerService.run();
     }
 
     public void terminateApplication() {
-        CenterTcpServerService centerService = (CenterTcpServerService)AppUtils.getBean(CenterTcpServerService.class);
+//        CenterTcpServerService centerTcpServerService = (CenterTcpServerService)AppUtils.getBean(CenterTcpServerService.class);
         try {
             log.error("Application Terminated: center communication stop.");
-            centerService.stop();
+            centerTcpServerService.stop();
         } catch (Exception e) {
             // no logging
         }
 
-        DsrcTcpCommServerService dsrcTcpCommServerService = (DsrcTcpCommServerService)AppUtils.getBean(DsrcTcpCommServerService.class);
+//        DsrcTcpCommServerService dsrcTcpCommServerService = (DsrcTcpCommServerService)AppUtils.getBean(DsrcTcpCommServerService.class);
         try {
             log.error("Application Terminated: dsrc communication stop.");
             dsrcTcpCommServerService.stop();
@@ -212,15 +225,15 @@ public class DsrcCommServerApplication implements CommandLineRunner, Application
             // no logging
         }
 
-        RseCtlrService ctlrService = (RseCtlrService) AppUtils.getBean(RseCtlrService.class);
+//        RseCtlrService rseCtlrService = (RseCtlrService) AppUtils.getBean(RseCtlrService.class);
         try {
             log.error("Application Terminated: controller state update.");
-            ctlrService.updateCtlrStts(false);
+            rseCtlrService.updateCtlrStts(false);
         } catch (Exception e) {
             // no logging
         }
 
-        UnitSystService unitSystService = (UnitSystService) AppUtils.getBean(UnitSystService.class);
+//        UnitSystService unitSystService = (UnitSystService) AppUtils.getBean(UnitSystService.class);
         try {
             log.error("Application Terminated: unit state update.");
             unitSystService.updateUnitSystStts(false);

+ 6 - 6
src/main/java/com/its/dsrc/global/AppRepository.java

@@ -10,7 +10,6 @@ import com.its.dsrc.entity.TbRseSect;
 import io.netty.channel.Channel;
 import lombok.Getter;
 import lombok.RequiredArgsConstructor;
-import lombok.Setter;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Component;
 
@@ -21,7 +20,6 @@ import java.util.concurrent.ConcurrentHashMap;
 
 @Slf4j
 @Getter
-@Setter
 @RequiredArgsConstructor
 @Component
 public class AppRepository {
@@ -41,10 +39,12 @@ public class AppRepository {
     private final List<TbRseOffrDrct> rseOffrDrctList = Collections.synchronizedList(new ArrayList<>());
 
     public List<TbRseOffrDrct> getRseOffrDrctList(String rseId) {
-        List<TbRseOffrDrct> list = Collections.synchronizedList(new ArrayList<>());
-        for (TbRseOffrDrct vo : this.rseOffrDrctList) {
-            if (vo.getRSE_CTLR_NMBR().equals(rseId))
-                list.add(vo);
+        List<TbRseOffrDrct> list = new ArrayList<>();
+        synchronized (this.rseOffrDrctList) {
+            for (TbRseOffrDrct vo : this.rseOffrDrctList) {
+                if (vo.getRSE_CTLR_NMBR().equals(rseId))
+                    list.add(vo);
+            }
         }
         return list;
     }

+ 8 - 9
src/main/java/com/its/dsrc/service/RseObuClctService.java

@@ -1,11 +1,11 @@
 package com.its.dsrc.service;
 
-import com.its.app.AppUtils;
-import com.its.dsrc.dao.mapper.RseSectMapper;
 import com.its.dsrc.dao.mapper.RseObuClctMapper;
+import com.its.dsrc.dao.mapper.RseSectMapper;
+import com.its.dsrc.entity.TbRseObuClct;
 import com.its.dsrc.entity.TbRseSectPassHs;
 import com.its.dsrc.entity.TbRseSectTraf;
-import com.its.dsrc.entity.TbRseObuClct;
+import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -15,18 +15,17 @@ import java.util.List;
 
 @Slf4j
 @Service
+@RequiredArgsConstructor
 @Transactional(rollbackFor = {Exception.class})
 public class RseObuClctService {
 
-    private RseObuClctMapper rseObuClctMapper;
-    private RseSectMapper rseSectMapper;
+    private final RseObuClctMapper rseObuClctMapper;
+    private final RseSectMapper rseSectMapper;
 
     @PostConstruct
     private void init() {
-        log.info("OBUGatherService.init: Start.");
-        this.rseObuClctMapper = (RseObuClctMapper) AppUtils.getBean(RseObuClctMapper.class);
-        this.rseSectMapper = (RseSectMapper) AppUtils.getBean(RseSectMapper.class);
-        log.info("OBUGatherService.init: ..End.");
+//        log.info("OBUGatherService.init: Start.");
+//        log.info("OBUGatherService.init: ..End.");
     }
 
     public int insertOBUGatherInfoHs(List<TbRseObuClct> list) {

+ 13 - 16
src/main/java/com/its/dsrc/ui/MainUI.java

@@ -73,7 +73,7 @@ public class MainUI {
     private JLabel lblBindPort;
     private boolean isUpdatable;
 
-    private AppRepository appRepository = null;
+    private final AppRepository appRepository;
 
     public static MainUI getInstance() {
         return _instance;
@@ -95,9 +95,10 @@ public class MainUI {
         }
     }
 
-    public MainUI(JFrame jFrame) {
+    public MainUI(JFrame jFrame, AppRepository appRepository) {
         System.setProperty("awt.useSystemAAFontSettings", "false"); // AntiAliasing false
 
+        this.appRepository = appRepository;
         this.isUpdatable = false;
         this.jFrame = jFrame;
         if (_instance == null) {
@@ -335,14 +336,12 @@ public class MainUI {
     public void updateCommSttsTotal() {
         int ctlrTotal = 0;
         int ctlrError = 0;
-        if (this.appRepository != null) {
-            for (Map.Entry<String, TbRseCtlr> e : this.appRepository.getCtlrMap().entrySet()) {
-                TbRseCtlr obj = e.getValue();
-                if (StringUtils.equals("N", obj.getDEL_YN())) {
-                    ctlrTotal++;
-                    if (!"CMS0".equals(obj.getStts().getCMNC_STTS_CD())) {
-                        ctlrError++;
-                    }
+        for (Map.Entry<String, TbRseCtlr> e : this.appRepository.getCtlrMap().entrySet()) {
+            TbRseCtlr obj = e.getValue();
+            if (StringUtils.equals("N", obj.getDEL_YN())) {
+                ctlrTotal++;
+                if (!"CMS0".equals(obj.getStts().getCMNC_STTS_CD())) {
+                    ctlrError++;
                 }
             }
         }
@@ -357,12 +356,10 @@ public class MainUI {
         }
     }
 
-    public void loadControllerInfo(AppRepository appRepository) {
-        this.appRepository = appRepository;
-
-        log.info("loadControllerInfo: start. {} EA.", appRepository.getCtlrMap().size());
+    public void loadControllerInfo() {
+        log.info("loadControllerInfo: start. {} EA.", this.appRepository.getCtlrMap().size());
         SortedMap<Integer, TbRseCtlr> ctlrMap = new TreeMap<>();
-        for (Map.Entry<String, TbRseCtlr> e : appRepository.getCtlrMap().entrySet()) {
+        for (Map.Entry<String, TbRseCtlr> e : this.appRepository.getCtlrMap().entrySet()) {
             TbRseCtlr obj = e.getValue();
             if (StringUtils.equals("N", obj.getDEL_YN())) {
                 ctlrMap.put(Integer.valueOf(obj.getID()), obj);
@@ -627,7 +624,7 @@ public class MainUI {
         if (fontName == null) {
             resultName = currentFont.getName();
         } else {
-            Font testFont = new Font(fontName, java.awt.Font.PLAIN, 10);
+            Font testFont = new Font(fontName, Font.PLAIN, 10);
             if (testFont.canDisplay('a') && testFont.canDisplay('1')) {
                 resultName = fontName;
             } else {

+ 34 - 18
src/main/java/com/its/dsrc/xnettcp/center/CenterTcpServerService.java

@@ -28,7 +28,6 @@ public class CenterTcpServerService {
 
     private EventLoopGroup acceptGroups = null;
     private EventLoopGroup workerGroups = null;
-    private ServerBootstrap serverBootstrap = null;
     private ChannelFuture channelFuture = null;
 
     public void run() {
@@ -45,7 +44,16 @@ public class CenterTcpServerService {
             log.info("서버가 윈도우 NIO 모드에서 실행됩니다.");
         }
 
-        this.serverBootstrap = createBootstrap();
+        ServerBootstrap serverBootstrap = null;
+        try {
+            serverBootstrap = createBootstrap();
+            this.acceptGroups = serverBootstrap.config().group();
+            this.workerGroups = serverBootstrap.config().childGroup();
+        } catch (Exception e) {
+            log.error("CenterTcpServerService createBootstrap exception: {}", e.getMessage());
+            log.error("CenterTcpServerService cannot be started. It will be terminated. *************************************");
+            return;
+        }
 
         log.info("*********************************************************************************");
         log.info("**                Center Communication Server Information                      **");
@@ -58,26 +66,34 @@ public class CenterTcpServerService {
 
         try {
             if (this.config.getBindingAddr().equals("0.0.0.0")) {
-                this.channelFuture = this.serverBootstrap.bind(this.config.getListenPort());
+                this.channelFuture = serverBootstrap.bind(this.config.getListenPort());
             }
             else {
-                this.channelFuture = this.serverBootstrap.bind(this.config.getBindingAddr(), config.getListenPort());
+                this.channelFuture = serverBootstrap.bind(this.config.getBindingAddr(), config.getListenPort());
             }
         }
         catch (Exception e) {
-            log.error("start, InterruptedException");
-            this.acceptGroups.shutdownGracefully();
-            this.workerGroups.shutdownGracefully();
+            log.error("CenterTcpServerService bind exception: {}", e.getMessage());
+            if (this.acceptGroups != null) this.acceptGroups.shutdownGracefully();
+            if (this.workerGroups != null) this.workerGroups.shutdownGracefully();
         }
     }
 
     public void stop() {
         try {
-            this.acceptGroups.shutdownGracefully().sync();
-            this.workerGroups.shutdownGracefully().sync();
-//            this.channelFuture.channel().closeFuture().sync();
-        } catch (InterruptedException e) {
-            log.error("CenterTcpServerService.stop, InterruptedException");
+            if (this.acceptGroups != null) {
+                this.acceptGroups.shutdownGracefully().sync();
+            }
+            if (this.workerGroups != null) {
+                this.workerGroups.shutdownGracefully().sync();
+            }
+//            if (this.channelFuture != null && this.channelFuture.channel() != null) {
+//                this.channelFuture.channel().closeFuture().sync();
+//            }
+        }
+        catch (InterruptedException e) {
+            log.error("CenterTcpServerService stop interrupt: {}", e.getMessage());
+            Thread.currentThread().interrupt();
         }
     }
 
@@ -88,15 +104,15 @@ public class CenterTcpServerService {
     }
 
     public ServerBootstrap createBootstrap() {
-        final int DEFAULT_EVENT_THREADS  = Runtime.getRuntime().availableProcessors() * 2;
+//        final int DEFAULT_EVENT_THREADS  = Runtime.getRuntime().availableProcessors() * 2;
         ServerBootstrap serverBootstrap = new ServerBootstrap();
-//        EventLoopGroup acceptGroups;
-//        EventLoopGroup workerGroups;
+        EventLoopGroup acceptGroups;
+        EventLoopGroup workerGroups;
 
-        this.acceptGroups = NettyUtils.newEventLoopGroup(this.config.getAcceptThreads(), "Accept");
-        this.workerGroups = NettyUtils.newEventLoopGroup(this.config.getWorkerThreads(), "Worker");
+        acceptGroups = NettyUtils.newEventLoopGroup(this.config.getAcceptThreads(), "Accept");
+        workerGroups = NettyUtils.newEventLoopGroup(this.config.getWorkerThreads(), "Worker");
         serverBootstrap.channel(NettyUtils.getServerSocketChannel());
-        serverBootstrap.group(this.acceptGroups, this.workerGroups);
+        serverBootstrap.group(acceptGroups, workerGroups);
 
         serverBootstrap.option(ChannelOption.AUTO_READ, true);
         serverBootstrap.option(ChannelOption.SO_BACKLOG, this.config.getBacklog());

+ 33 - 17
src/main/java/com/its/dsrc/xnettcp/dsrc/DsrcTcpCommServerService.java

@@ -29,7 +29,6 @@ public class DsrcTcpCommServerService {
 
     private EventLoopGroup acceptGroups = null;
     private EventLoopGroup workerGroups = null;
-    private ServerBootstrap serverBootstrap = null;
     private ChannelFuture channelFuture = null;
 
     public void run() {
@@ -46,7 +45,16 @@ public class DsrcTcpCommServerService {
             log.info("서버가 윈도우 NIO 모드에서 실행됩니다.");
         }
 
-        this.serverBootstrap = createBootstrap();
+        ServerBootstrap serverBootstrap = null;
+        try {
+            serverBootstrap = createBootstrap();
+            this.acceptGroups = serverBootstrap.config().group();
+            this.workerGroups = serverBootstrap.config().childGroup();
+        } catch (Exception e) {
+            log.error("DsrcTcpCommServerService createBootstrap exception: {}", e.getMessage());
+            log.error("DsrcTcpCommServerService cannot be started. It will be terminated. *************************************");
+            return;
+        }
 
         log.info("*********************************************************************************");
         log.info("**                    DSRC Communication Server Information                    **");
@@ -59,26 +67,34 @@ public class DsrcTcpCommServerService {
 
         try {
             if (this.runningConfig.getCommBindingAddr().equals("0.0.0.0")) {
-                this.channelFuture = this.serverBootstrap.bind(this.runningConfig.getCommBindingPort());
+                this.channelFuture = serverBootstrap.bind(this.runningConfig.getCommBindingPort());
             }
             else {
-                this.channelFuture = this.serverBootstrap.bind(this.runningConfig.getCommBindingAddr(), this.runningConfig.getCommBindingPort());
+                this.channelFuture = serverBootstrap.bind(this.runningConfig.getCommBindingAddr(), this.runningConfig.getCommBindingPort());
             }
         }
         catch (Exception e) {
-            log.error("start, InterruptedException");
-            this.acceptGroups.shutdownGracefully();
-            this.workerGroups.shutdownGracefully();
+            log.error("DsrcTcpCommServerService bind exception: {}", e.getMessage());
+            if (this.acceptGroups != null) this.acceptGroups.shutdownGracefully();
+            if (this.workerGroups != null) this.workerGroups.shutdownGracefully();
         }
     }
 
     public void stop() {
         try {
-            this.acceptGroups.shutdownGracefully().sync();
-            this.workerGroups.shutdownGracefully().sync();
-//            this.channelFuture.channel().closeFuture().sync();
-        } catch (InterruptedException e) {
-            log.error("DsrcTcpCommServerService.stop, InterruptedException");
+            if (this.acceptGroups != null) {
+                this.acceptGroups.shutdownGracefully().sync();
+            }
+            if (this.workerGroups != null) {
+                this.workerGroups.shutdownGracefully().sync();
+            }
+//            if (this.channelFuture != null && this.channelFuture.channel() != null) {
+//                this.channelFuture.channel().closeFuture().sync();
+//            }
+        }
+        catch (InterruptedException e) {
+            log.error("DsrcTcpCommServerService stop interrupt: {}", e.getMessage());
+            Thread.currentThread().interrupt();
         }
     }
 
@@ -90,13 +106,13 @@ public class DsrcTcpCommServerService {
 
     public ServerBootstrap createBootstrap() {
         ServerBootstrap serverBootstrap = new ServerBootstrap();
-//        EventLoopGroup acceptGroups;
-//        EventLoopGroup workerGroups;
+        EventLoopGroup acceptGroups;
+        EventLoopGroup workerGroups;
 
-        this.acceptGroups = NettyUtils.newEventLoopGroup(this.runningConfig.getCommAcceptThreads(), "Accept");
-        this.workerGroups = NettyUtils.newEventLoopGroup(this.runningConfig.getCommWorkerThreads(), "Worker");
+        acceptGroups = NettyUtils.newEventLoopGroup(this.runningConfig.getCommAcceptThreads(), "Accept");
+        workerGroups = NettyUtils.newEventLoopGroup(this.runningConfig.getCommWorkerThreads(), "Worker");
         serverBootstrap.channel(NettyUtils.getServerSocketChannel());
-        serverBootstrap.group(this.acceptGroups, this.workerGroups);
+        serverBootstrap.group(acceptGroups, workerGroups);
 
         serverBootstrap.option(ChannelOption.AUTO_READ, true);
         serverBootstrap.option(ChannelOption.SO_BACKLOG, this.runningConfig.getCommBacklog());