@ UsedByGeneratedCode protected Object preDestroy ( BeanResolutionContext resolutionContext , BeanContext context , Object bean ) { DefaultBeanContext defaultContext = ( DefaultBeanContext ) context ; for ( int i = 0 ; i < methodInjectionPoints . size ( ) ; i ++ ) { MethodInjectionPoint methodInjectionPoint = methodInjectionPoints . get ( i ) ; if ( methodInjectionPoint . isPreDestroyMethod ( ) && methodInjectionPoint . requiresReflection ( ) ) { injectBeanMethod ( resolutionContext , defaultContext , i , bean ) ; } } if ( bean instanceof LifeCycle ) { bean = ( ( LifeCycle ) bean ) . stop ( ) ; } return bean ; }
Default preDestroy hook that only invokes methods that require reflection . Generated subclasses should override to call methods that don t require reflection .