springboot学习
package com.cy.pj.common.cache;
@Component
@Scope("singleton")
@Lazy // 不会启动的时候就加载类
public class DefaultCache {
public DefaultCache() {
System.out.println("cache()");
}
@PostConstruct
public void init() {
System.out.println("init()");
}
@PreDestroy
public void destory() {
System.out.println("destory");
}
}
本文来自博客园,作者:竹石2020,转载请注明原文链接:https://www.cnblogs.com/ch2020/p/16927752.html