spring-reading./spring-aware/spring-aware-applicationSta.../src/main/java/com/xcs/spring/ApplicationStartupAwareAppl...

21 lines
680 B
Java
Raw Normal View History

package com.xcs.spring;
import com.xcs.spring.config.MyConfiguration;
import org.springframework.boot.context.metrics.buffering.BufferingApplicationStartup;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
/**
* @author xcs
* @date 20230916 1609
**/
public class ApplicationStartupAwareApplication {
public static void main(String[] args) {
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
context.setApplicationStartup(new BufferingApplicationStartup(100));
context.register(MyConfiguration.class);
context.refresh();
context.close();
}
}