Add comment on DisposableBean use in @Configuration

Issue: SPR-7901
This commit is contained in:
Chris Beams 2011-05-06 19:00:55 +00:00
parent d3678caa37
commit d2faef44fa
1 changed files with 2 additions and 0 deletions

View File

@ -163,6 +163,8 @@ class ConfigurationClassEnhancer {
public Object intercept(Object obj, Method method, Object[] args, MethodProxy proxy) throws Throwable {
Enhancer.registerStaticCallbacks(obj.getClass(), null);
// does the actual (non-CGLIB) superclass actually implement DisposableBean?
// if so, call its dispose() method. If not, just exit.
if (DisposableBean.class.isAssignableFrom(obj.getClass().getSuperclass())) {
return proxy.invokeSuper(obj, args);
}