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");
}
}
标签:springboot,destory,System,学习,println,public,out
From: https://www.cnblogs.com/ch2020/p/16927752.html