TransactionAttributeSourcePointcut pointcut skips target classes with TransactionalProxy marker (e.g. Spring Data proxies)
This 4.2 commit also makes TransactionProxyFactoryBean expose the TransactionalProxy marker and refines SpringProxy marker handling. Issue: SPR-13109
This commit is contained in:
@@ -173,6 +173,8 @@ public abstract class AbstractSingletonProxyFactoryBean extends ProxyConfig
|
||||
ClassUtils.getAllInterfacesForClass(targetSource.getTargetClass(), this.proxyClassLoader));
|
||||
}
|
||||
|
||||
postProcessProxyFactory(proxyFactory);
|
||||
|
||||
this.proxy = proxyFactory.getProxy(this.proxyClassLoader);
|
||||
}
|
||||
|
||||
@@ -191,6 +193,15 @@ public abstract class AbstractSingletonProxyFactoryBean extends ProxyConfig
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A hook for subclasses to post-process the {@link ProxyFactory}
|
||||
* before creating the proxy instance with it.
|
||||
* @param proxyFactory the AOP ProxyFactory about to be used
|
||||
* @since 4.2
|
||||
*/
|
||||
protected void postProcessProxyFactory(ProxyFactory proxyFactory) {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Object getObject() {
|
||||
|
||||
@@ -70,8 +70,8 @@ public class DefaultAopProxyFactory implements AopProxyFactory, Serializable {
|
||||
* (or no proxy interfaces specified at all).
|
||||
*/
|
||||
private boolean hasNoUserSuppliedProxyInterfaces(AdvisedSupport config) {
|
||||
Class<?>[] interfaces = config.getProxiedInterfaces();
|
||||
return (interfaces.length == 0 || (interfaces.length == 1 && SpringProxy.class == interfaces[0]));
|
||||
Class<?>[] ifcs = config.getProxiedInterfaces();
|
||||
return (ifcs.length == 0 || (ifcs.length == 1 && SpringProxy.class.isAssignableFrom(ifcs[0])));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user