Revert "Fix APC registration for @EnableTransactionManagement"
@PostConstruct added to ProxyTransactionManagementConfiguration cases ConcurrentModificationException (as detailed previously in SPR-8397. Backing out for now until a better solution can be devised. This reverts commit 235b729514d125aef79fc3fae4bcfb1893642212.
This commit is contained in:
@@ -16,12 +16,9 @@
|
||||
|
||||
package org.springframework.transaction.annotation;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
|
||||
import org.springframework.aop.config.AopConfigUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.aop.framework.autoproxy.InfrastructureAdvisorAutoProxyCreator;
|
||||
import org.springframework.beans.factory.config.BeanDefinition;
|
||||
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Role;
|
||||
@@ -42,17 +39,6 @@ import org.springframework.transaction.interceptor.TransactionInterceptor;
|
||||
@Configuration
|
||||
public class ProxyTransactionManagementConfiguration extends AbstractTransactionManagementConfiguration {
|
||||
|
||||
@Autowired
|
||||
private DefaultListableBeanFactory registry;
|
||||
|
||||
@PostConstruct
|
||||
public void registerAutoProxyCreator() {
|
||||
AopConfigUtils.registerAutoProxyCreatorIfNecessary(registry);
|
||||
if ((Boolean)enableTx.get("proxyTargetClass")) {
|
||||
AopConfigUtils.forceAutoProxyCreatorToUseClassProxying(registry);
|
||||
}
|
||||
}
|
||||
|
||||
@Bean(name=TransactionManagementConfigUtils.TRANSACTION_ADVISOR_BEAN_NAME)
|
||||
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
|
||||
public BeanFactoryTransactionAttributeSourceAdvisor transactionAdvisor() {
|
||||
@@ -81,4 +67,12 @@ public class ProxyTransactionManagementConfiguration extends AbstractTransaction
|
||||
return interceptor;
|
||||
}
|
||||
|
||||
// TODO: deal with escalation of APCs
|
||||
@Bean(name=AopConfigUtils.AUTO_PROXY_CREATOR_BEAN_NAME)
|
||||
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
|
||||
public InfrastructureAdvisorAutoProxyCreator apc() {
|
||||
InfrastructureAdvisorAutoProxyCreator apc = new InfrastructureAdvisorAutoProxyCreator();
|
||||
apc.setProxyTargetClass((Boolean) this.enableTx.get("proxyTargetClass"));
|
||||
return apc;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user