AbstractApplicationContext ax = new ClassPathXmlApplicationContext("applicationContext.xml");
ax.registerShutdownHook();
[color=red]当执行这个方式时,容器将会对所有定义了destroy-method这个方法的方法进行执行[/color]
AbstractApplicationContext ax = new ClassPathXmlApplicationContext("applicationContext.xml");
ax.registerShutdownHook();