Spring中ApplicationContext的close方法執行流程:
1、發布關閉事件
2、執行lifeCycleProcess的close方法
3、執行destroyBeans()方法;
注釋原文:// Destroy all cached singletons in the context's BeanFactory. 銷毀上下文BeanFactory中所有緩存的單例對象
3.1、找到所有的DisposableBean
3.2、遍歷找出所有依賴了當前DisposableBean的所有bean,將這些bean從單例池中移除
3.3、調用了DisposableBean的destroy方法
3.4、找到當前bean的所有inner Bean,將這些Inner Bean全部移除掉