对Ioc器皿进行销毁

对Ioc容器进行销毁AbstractApplicationContext ax new ClassPathXmlApplicationContext(applicationCon

对Ioc容器进行销毁

AbstractApplicationContext ax = new ClassPathXmlApplicationContext("applicationContext.xml");ax.registerShutdownHook();

当执行这个方式时,容器将会对所有定义了destroy-method这个方法的方法进行执行