mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-07-15 01:07:30 +08:00
Switch default value of spring.aop.proxy-target-class
This commit ensures that the default proxying value matches the opinion we have applied for `@EnableTransactionManagement` Closes gh-8786
This commit is contained in:
parent
6c6b9c284d
commit
78845fe63a
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2016 the original author or authors.
|
||||
* Copyright 2012-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -45,14 +45,14 @@ public class AopAutoConfiguration {
|
||||
|
||||
@Configuration
|
||||
@EnableAspectJAutoProxy(proxyTargetClass = false)
|
||||
@ConditionalOnProperty(prefix = "spring.aop", name = "proxy-target-class", havingValue = "false", matchIfMissing = true)
|
||||
@ConditionalOnProperty(prefix = "spring.aop", name = "proxy-target-class", havingValue = "false", matchIfMissing = false)
|
||||
public static class JdkDynamicAutoProxyConfiguration {
|
||||
|
||||
}
|
||||
|
||||
@Configuration
|
||||
@EnableAspectJAutoProxy(proxyTargetClass = true)
|
||||
@ConditionalOnProperty(prefix = "spring.aop", name = "proxy-target-class", havingValue = "true", matchIfMissing = false)
|
||||
@ConditionalOnProperty(prefix = "spring.aop", name = "proxy-target-class", havingValue = "true", matchIfMissing = true)
|
||||
public static class CglibAutoProxyConfiguration {
|
||||
|
||||
}
|
||||
|
@ -43,7 +43,7 @@
|
||||
"name": "spring.aop.proxy-target-class",
|
||||
"type": "java.lang.Boolean",
|
||||
"description": "Whether subclass-based (CGLIB) proxies are to be created (true) as opposed to standard Java interface-based proxies (false).",
|
||||
"defaultValue": false
|
||||
"defaultValue": true
|
||||
},
|
||||
{
|
||||
"name": "spring.application.admin.enabled",
|
||||
|
@ -60,7 +60,7 @@ public class AopAutoConfigurationTests {
|
||||
@Test
|
||||
public void aopWithDefaultSettings() {
|
||||
load(TestConfiguration.class);
|
||||
testProxyTargetClassDisabled();
|
||||
testProxyTargetClassEnabled();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -50,7 +50,7 @@ content into your application; rather pick only the properties that you need.
|
||||
|
||||
# AOP
|
||||
spring.aop.auto=true # Add @EnableAspectJAutoProxy.
|
||||
spring.aop.proxy-target-class=false # Whether subclass-based (CGLIB) proxies are to be created (true) as opposed to standard Java interface-based proxies (false).
|
||||
spring.aop.proxy-target-class=true # Whether subclass-based (CGLIB) proxies are to be created (true) as opposed to standard Java interface-based proxies (false).
|
||||
|
||||
# IDENTITY ({sc-spring-boot}/context/ContextIdApplicationContextInitializer.{sc-ext}[ContextIdApplicationContextInitializer])
|
||||
spring.application.index= # Application index.
|
||||
|
Loading…
Reference in New Issue
Block a user