Spring生命周期

初始化和销毁 init在构造方法之前执行 destroy在applicationContext.close方法之后执行 ClassPathXmlApplicationContext才拥有close方法 两种方式 一是使用reflection applicationContext.getClass() 获取反射对象 .getMethod(“close”) 获取反射对象的方法 .invoke(appl
相关文章
相关标签/搜索