Ignore (Auto)Closeable for interface-based proxy decisions

Issue: SPR-15779
This commit is contained in:
Juergen Hoeller 2017-07-19 22:40:45 +02:00
parent 13080f04f4
commit 118d1470fd
1 changed files with 4 additions and 2 deletions

View File

@ -16,6 +16,8 @@
package org.springframework.aop.framework; package org.springframework.aop.framework;
import java.io.Closeable;
import org.springframework.beans.factory.Aware; import org.springframework.beans.factory.Aware;
import org.springframework.beans.factory.BeanClassLoaderAware; import org.springframework.beans.factory.BeanClassLoaderAware;
import org.springframework.beans.factory.DisposableBean; import org.springframework.beans.factory.DisposableBean;
@ -129,8 +131,8 @@ public class ProxyProcessorSupport extends ProxyConfig implements Ordered, BeanC
* @return whether the given interface is just a container callback * @return whether the given interface is just a container callback
*/ */
protected boolean isConfigurationCallbackInterface(Class<?> ifc) { protected boolean isConfigurationCallbackInterface(Class<?> ifc) {
return (InitializingBean.class == ifc || DisposableBean.class == ifc || return (InitializingBean.class == ifc || DisposableBean.class == ifc || Closeable.class == ifc ||
ObjectUtils.containsElement(ifc.getInterfaces(), Aware.class)); AutoCloseable.class == ifc || ObjectUtils.containsElement(ifc.getInterfaces(), Aware.class));
} }
/** /**