1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| package com.lou.springboot;
import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.ConfigurableApplicationContext;
import java.io.IOException;
@SpringBootApplication public class Application {
public static void main(String[] args) throws NoSuchFieldException, IllegalAccessException, IOException { ConfigurableApplicationContext configurableApplicationContext = SpringApplication.run(Application.class, args);
configurableApplicationContext.publishEvent(new UserEvent(configurableApplicationContext));
} }
|