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 = "netty-job", havingValue = "true") public class NettyServerStartUp implements CommandLineRunner { @Autowired private WebSocketServer webSocketServer; @Override public void run(String... args) throws Exception { webSocketServer.start(); } }