Runnable sendThread = (Runnable) initAll.ac.getBean("sendMessageRun");
Runnable receiveThread = (Runnable) initAll.ac.getBean("receivemessageRun");
Runnable updateThread = (Runnable) initAll.ac.getBean("updateSendStateRun");
Runnable heartbeatUtil = (Runnable) initAll.ac.getBean("heartbeatUtil");
Thread sendService = new Thread(sendThread);
Thread receiveService = new Thread(receiveThread);
Thread updateService = new Thread(updateThread);
Thread heartbeatUtilService = new Thread(heartbeatUtil);
threadPool.add(sendService);
threadPool.add(receiveService);
threadPool.add(updateService);
for (Thread thread : threadPool) {
thread.start();
}
Runnable receiveThread = (Runnable) initAll.ac.getBean("receivemessageRun");
Runnable updateThread = (Runnable) initAll.ac.getBean("updateSendStateRun");
Runnable heartbeatUtil = (Runnable) initAll.ac.getBean("heartbeatUtil");
Thread sendService = new Thread(sendThread);
Thread receiveService = new Thread(receiveThread);
Thread updateService = new Thread(updateThread);
Thread heartbeatUtilService = new Thread(heartbeatUtil);
threadPool.add(sendService);
threadPool.add(receiveService);
threadPool.add(updateService);
for (Thread thread : threadPool) {
thread.start();
}