springboot CommandLineRunner ApplicationRunner
package com.anyec.demo;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.SpringApplicationRunListener;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationListener;
@SpringBootApplication
public class DemoApplication implements ApplicationListener<ApplicationEvent>,CommandLineRunner,
ApplicationRunner,SpringApplicationRunListener{
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
}
@Override
public void onApplicationEvent(ApplicationEvent event) {//ApplicationListener
}
@Override
public void run(String... args) throws Exception {//CommandLineRunner
}
@Override
public void run(ApplicationArguments args) throws Exception {//ApplicationRunner
}
}
上一篇: Linux常用命令总结
下一篇: LR.Net自定义工作流可视化配置