标签:work div tor system class actor frame auto log
有时候我们想要在spring启动后就做一些初始化配置,或者启动一个常住线程,这个时候需要定义一个类,且实现ApplicationRunner接口
@Component public class ZKMasterClient implements ApplicationRunner{ private final Logger logger = LoggerFactory.getLogger(ZKMasterClient.class); @Autowired private CuratorFramework zkClient; @Override public void run(ApplicationArguments args) throws Exception{ System.out.println("**************i‘m ZKMasterClient.run()***************"); } }
标签:work div tor system class actor frame auto log
原文地址:https://www.cnblogs.com/wangbin2188/p/14745773.html