Browse Source

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.
1.10.x
Oliver Gierke 11 years ago
parent
commit
3014ee2f58
  1. 3
      src/main/java/org/springframework/data/repository/core/support/RepositoryFactorySupport.java

3
src/main/java/org/springframework/data/repository/core/support/RepositoryFactorySupport.java

@ -28,6 +28,7 @@ import java.util.concurrent.ConcurrentHashMap; @@ -28,6 +28,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.factory.BeanClassLoaderAware;
import org.springframework.core.GenericTypeResolver;
import org.springframework.core.MethodParameter;
@ -175,6 +176,8 @@ public abstract class RepositoryFactorySupport implements BeanClassLoaderAware { @@ -175,6 +176,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);
}

Loading…
Cancel
Save