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");
        }
}
posted @ 2022-11-26 16:57  竹石2020  阅读(5)  评论(0编辑  收藏  举报