Spring提供可扩展点

1、BeanNameAware

/**
     * spring提供的 beanName回调处理方法
     * @param beanName
     */
    void setBeanName(String beanName);


2、InitializingBean
 
/** 
   * 初始化检查
   *
   */
  void afterPropertiesSet() throws Exception;

3、BeanPostProcessor

/**
     * 初始化前执行
     * @param bean
     * @param beanName
     * @return
     * @throws Exception
     */
     Object postProcessBeforeInitialization(Object bean, String beanName) throws Exception;


    /**
     * 初始化后执行
     * @param bean
     * @param beanName
     * @return
     * @throws Exception
     */
     Object postProcessAfterInitialization(Object bean, String beanName) throws Exception;

 

posted @ 2022-03-15 20:21  scwyfy  阅读(49)  评论(0)    收藏  举报