metrics监控
摘要:依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency> 在 application.properti
阅读全文
ApplicationContextAware使用场景:获取Bean
摘要:定义 @Component public class ApplicationContextHelper implements ApplicationContextAware { private static ApplicationContext _context; @Autowired @Prima
阅读全文
HandlerMethodArgumentResolver使用场景:自定义参数解析,如认证
摘要:依赖 <dependency> <groupId>javax.inject</groupId> <artifactId>javax.inject</artifactId> <version>1</version> </dependency> 添加拦截: HandlerInterceptorAdapt
阅读全文
调用InitializingBean之后想要销毁,使用DisposableBean
摘要:java @Log4j2 @Component public class Neo4jStore implements InitializingBean, DisposableBean{ private GraphDatabaseService graphDb; private final BoltC
阅读全文
Bean实体启动初始化顺序&整体项目启动顺序
摘要:Bean实体启动初始化顺序 Construct > @Autowired(依赖注入) > @postConstruct > InitializingBean 整体项目启动顺序 CommandLineRunner & ApplicationRunner > ApplicationListener 参考
阅读全文
CommandLineRunner等的使用场景: 应用层加载json,xml,redis等数据
摘要:java @Component @Order(value = 1) public class RoleStartRunner implements CommandLineRunner { private static AppDataProcessor processor = new AppDataP
阅读全文