DATACMNS-749 - RepositoryFactorySupport now registers global ExposeInvocationInterceptor.

This frees RepositoryProxyPostProcessors from having to register the interceptor manually and thus prevents it from being registered multiple times.
This commit is contained in:
Oliver Gierke
2015-08-08 10:55:41 +02:00
parent 7b791d2825
commit 6775d11c65

View File

@@ -27,6 +27,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;
import org.springframework.aop.framework.ProxyFactory;
import org.springframework.aop.interceptor.ExposeInvocationInterceptor;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.BeanClassLoaderAware;
import org.springframework.core.GenericTypeResolver;
@@ -188,6 +189,8 @@ public abstract class RepositoryFactorySupport implements BeanClassLoaderAware {
result.setTarget(target);
result.setInterfaces(new Class[] { repositoryInterface, Repository.class });
result.addAdvice(ExposeInvocationInterceptor.INSTANCE);
if (TRANSACTION_PROXY_TYPE != null) {
result.addInterface(TRANSACTION_PROXY_TYPE);
}