Helius
2021-03-05 9e6054ca0612a05ec2b698b8a63db7605c600725
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package com.xcong.excoin.quartz.job;
 
import com.xcong.excoin.netty.server.TcpServer;
import com.xcong.excoin.netty.server.WebSocketServer;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContextAware;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
 
import javax.annotation.PostConstruct;
 
/**
 * @author wzy
 * @date 2021-02-26
 **/
 
@Slf4j
@Component
public class NettyServerStartUp {
 
    @Autowired
    WebSocketServer webSocketServer;
 
    @Autowired
    TcpServer tcpServer;
 
    @Order(0)
    @PostConstruct
    public void start() throws Exception {
        log.info("启动netty服务器");
        webSocketServer.start();
        tcpServer.start();
    }
}