private void destroySingletons ( ) { if ( log . isDebugEnabled ( ) ) { log . debug ( "Destroying singletons in " + this ) ; } int failedDestroyes = 0 ; for ( BeanRule beanRule : beanRuleRegistry . getIdBasedBeanRules ( ) ) { failedDestroyes += doDestroySingleton ( beanRule ) ; } for ( Set < BeanRule > beanRuleSet : beanRuleRegistry . getTypeBasedBeanRules ( ) ) { for ( BeanRule beanRule : beanRuleSet ) { failedDestroyes += doDestroySingleton ( beanRule ) ; } } for ( BeanRule beanRule : beanRuleRegistry . getConfigurableBeanRules ( ) ) { failedDestroyes += doDestroySingleton ( beanRule ) ; } if ( failedDestroyes > 0 ) { log . warn ( "Singletons has not been destroyed cleanly (Failure Count: " + failedDestroyes + ")" ) ; } else { log . debug ( "Destroyed all cached singletons in " + this ) ; } }
Destroy all cached singletons .