Helius
2021-05-31 7236be66852b4ac245e9c1ddb2dd3d591fcd3941
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package com.xcong.excoin.quartz.job;
 
 
import com.xcong.excoin.netty.server.WebSocketServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Component;
 
@Component
@ConditionalOnProperty(prefix = "app", name = "websocket-job", havingValue = "true")
public class NettyServerStartUp implements CommandLineRunner {
 
    @Autowired
    private WebSocketServer webSocketServer;
 
    @Override
    public void run(String... args) throws Exception {
        webSocketServer.start();
    }
}