Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
5e736c0d
Commit
5e736c0d
authored
Jan 07, 2019
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '2.1.x'
parents
e907bf0c
6ad01a6d
Changes
25
Hide whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
79 additions
and
64 deletions
+79
-64
AuditEventsEndpointAutoConfiguration.java
...configure/audit/AuditEventsEndpointAutoConfiguration.java
+2
-2
BeansEndpointAutoConfiguration.java
...e/autoconfigure/beans/BeansEndpointAutoConfiguration.java
+2
-2
CachesEndpointAutoConfiguration.java
.../autoconfigure/cache/CachesEndpointAutoConfiguration.java
+2
-3
ConditionsReportEndpointAutoConfiguration.java
.../condition/ConditionsReportEndpointAutoConfiguration.java
+2
-2
ShutdownEndpointAutoConfiguration.java
...oconfigure/context/ShutdownEndpointAutoConfiguration.java
+2
-2
ConfigurationPropertiesReportEndpointAutoConfiguration.java
...nfigurationPropertiesReportEndpointAutoConfiguration.java
+2
-2
ConditionalOnEnabledEndpoint.java
...gure/endpoint/condition/ConditionalOnEnabledEndpoint.java
+2
-2
OnEnabledEndpointCondition.java
...figure/endpoint/condition/OnEnabledEndpointCondition.java
+12
-12
EnvironmentEndpointAutoConfiguration.java
...toconfigure/env/EnvironmentEndpointAutoConfiguration.java
+2
-3
FlywayEndpointAutoConfiguration.java
...autoconfigure/flyway/FlywayEndpointAutoConfiguration.java
+2
-2
HealthEndpointConfiguration.java
...ate/autoconfigure/health/HealthEndpointConfiguration.java
+2
-2
HealthEndpointWebExtensionConfiguration.java
...igure/health/HealthEndpointWebExtensionConfiguration.java
+3
-3
InfoEndpointAutoConfiguration.java
...ate/autoconfigure/info/InfoEndpointAutoConfiguration.java
+2
-2
IntegrationGraphEndpointAutoConfiguration.java
...ntegration/IntegrationGraphEndpointAutoConfiguration.java
+2
-3
JolokiaEndpointAutoConfiguration.java
...toconfigure/jolokia/JolokiaEndpointAutoConfiguration.java
+2
-2
LiquibaseEndpointAutoConfiguration.java
...nfigure/liquibase/LiquibaseEndpointAutoConfiguration.java
+2
-3
LoggersEndpointAutoConfiguration.java
...toconfigure/logging/LoggersEndpointAutoConfiguration.java
+2
-2
HeapDumpWebEndpointAutoConfiguration.java
...gure/management/HeapDumpWebEndpointAutoConfiguration.java
+2
-2
ThreadDumpEndpointAutoConfiguration.java
...igure/management/ThreadDumpEndpointAutoConfiguration.java
+2
-2
MetricsEndpointAutoConfiguration.java
...toconfigure/metrics/MetricsEndpointAutoConfiguration.java
+2
-2
PrometheusMetricsExportAutoConfiguration.java
.../prometheus/PrometheusMetricsExportAutoConfiguration.java
+2
-2
ScheduledTasksEndpointAutoConfiguration.java
...e/scheduling/ScheduledTasksEndpointAutoConfiguration.java
+2
-2
SessionsEndpointAutoConfiguration.java
...oconfigure/session/SessionsEndpointAutoConfiguration.java
+2
-2
HttpTraceEndpointAutoConfiguration.java
...figure/trace/http/HttpTraceEndpointAutoConfiguration.java
+2
-2
ConditionalOnEnabledEndpointTests.java
...endpoint/condition/ConditionalOnEnabledEndpointTests.java
+20
-1
No files found.
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/audit/AuditEventsEndpointAutoConfiguration.java
View file @
5e736c0d
/*
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -37,12 +37,12 @@ import org.springframework.context.annotation.Configuration;
...
@@ -37,12 +37,12 @@ import org.springframework.context.annotation.Configuration;
*/
*/
@Configuration
@Configuration
@AutoConfigureAfter
(
AuditAutoConfiguration
.
class
)
@AutoConfigureAfter
(
AuditAutoConfiguration
.
class
)
@ConditionalOnEnabledEndpoint
(
endpoint
=
AuditEventsEndpoint
.
class
)
public
class
AuditEventsEndpointAutoConfiguration
{
public
class
AuditEventsEndpointAutoConfiguration
{
@Bean
@Bean
@ConditionalOnMissingBean
@ConditionalOnMissingBean
@ConditionalOnBean
(
AuditEventRepository
.
class
)
@ConditionalOnBean
(
AuditEventRepository
.
class
)
@ConditionalOnEnabledEndpoint
public
AuditEventsEndpoint
auditEventsEndpoint
(
public
AuditEventsEndpoint
auditEventsEndpoint
(
AuditEventRepository
auditEventRepository
)
{
AuditEventRepository
auditEventRepository
)
{
return
new
AuditEventsEndpoint
(
auditEventRepository
);
return
new
AuditEventsEndpoint
(
auditEventRepository
);
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/beans/BeansEndpointAutoConfiguration.java
View file @
5e736c0d
/*
/*
* Copyright 2012-201
7
the original author or authors.
* Copyright 2012-201
9
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -31,11 +31,11 @@ import org.springframework.context.annotation.Configuration;
...
@@ -31,11 +31,11 @@ import org.springframework.context.annotation.Configuration;
* @since 2.0.0
* @since 2.0.0
*/
*/
@Configuration
@Configuration
@ConditionalOnEnabledEndpoint
(
endpoint
=
BeansEndpoint
.
class
)
public
class
BeansEndpointAutoConfiguration
{
public
class
BeansEndpointAutoConfiguration
{
@Bean
@Bean
@ConditionalOnMissingBean
@ConditionalOnMissingBean
@ConditionalOnEnabledEndpoint
public
BeansEndpoint
beansEndpoint
(
public
BeansEndpoint
beansEndpoint
(
ConfigurableApplicationContext
applicationContext
)
{
ConfigurableApplicationContext
applicationContext
)
{
return
new
BeansEndpoint
(
applicationContext
);
return
new
BeansEndpoint
(
applicationContext
);
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cache/CachesEndpointAutoConfiguration.java
View file @
5e736c0d
/*
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -42,12 +42,12 @@ import org.springframework.context.annotation.Configuration;
...
@@ -42,12 +42,12 @@ import org.springframework.context.annotation.Configuration;
*/
*/
@Configuration
@Configuration
@ConditionalOnClass
(
CacheManager
.
class
)
@ConditionalOnClass
(
CacheManager
.
class
)
@ConditionalOnEnabledEndpoint
(
endpoint
=
CachesEndpoint
.
class
)
@AutoConfigureAfter
(
CacheAutoConfiguration
.
class
)
@AutoConfigureAfter
(
CacheAutoConfiguration
.
class
)
public
class
CachesEndpointAutoConfiguration
{
public
class
CachesEndpointAutoConfiguration
{
@Bean
@Bean
@ConditionalOnMissingBean
@ConditionalOnMissingBean
@ConditionalOnEnabledEndpoint
public
CachesEndpoint
cachesEndpoint
(
public
CachesEndpoint
cachesEndpoint
(
ObjectProvider
<
Map
<
String
,
CacheManager
>>
cacheManagers
)
{
ObjectProvider
<
Map
<
String
,
CacheManager
>>
cacheManagers
)
{
return
new
CachesEndpoint
(
cacheManagers
.
getIfAvailable
(
LinkedHashMap:
:
new
));
return
new
CachesEndpoint
(
cacheManagers
.
getIfAvailable
(
LinkedHashMap:
:
new
));
...
@@ -55,7 +55,6 @@ public class CachesEndpointAutoConfiguration {
...
@@ -55,7 +55,6 @@ public class CachesEndpointAutoConfiguration {
@Bean
@Bean
@ConditionalOnMissingBean
@ConditionalOnMissingBean
@ConditionalOnEnabledEndpoint
@ConditionalOnBean
(
CachesEndpoint
.
class
)
@ConditionalOnBean
(
CachesEndpoint
.
class
)
public
CachesEndpointWebExtension
cachesEndpointWebExtension
(
public
CachesEndpointWebExtension
cachesEndpointWebExtension
(
CachesEndpoint
cachesEndpoint
)
{
CachesEndpoint
cachesEndpoint
)
{
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/condition/ConditionsReportEndpointAutoConfiguration.java
View file @
5e736c0d
/*
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -32,11 +32,11 @@ import org.springframework.context.annotation.Configuration;
...
@@ -32,11 +32,11 @@ import org.springframework.context.annotation.Configuration;
* @since 2.0.0
* @since 2.0.0
*/
*/
@Configuration
@Configuration
@ConditionalOnEnabledEndpoint
(
endpoint
=
ConditionsReportEndpoint
.
class
)
public
class
ConditionsReportEndpointAutoConfiguration
{
public
class
ConditionsReportEndpointAutoConfiguration
{
@Bean
@Bean
@ConditionalOnMissingBean
(
search
=
SearchStrategy
.
CURRENT
)
@ConditionalOnMissingBean
(
search
=
SearchStrategy
.
CURRENT
)
@ConditionalOnEnabledEndpoint
public
ConditionsReportEndpoint
conditionsReportEndpoint
(
public
ConditionsReportEndpoint
conditionsReportEndpoint
(
ConfigurableApplicationContext
context
)
{
ConfigurableApplicationContext
context
)
{
return
new
ConditionsReportEndpoint
(
context
);
return
new
ConditionsReportEndpoint
(
context
);
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/context/ShutdownEndpointAutoConfiguration.java
View file @
5e736c0d
/*
/*
* Copyright 2012-201
7
the original author or authors.
* Copyright 2012-201
9
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -30,11 +30,11 @@ import org.springframework.context.annotation.Configuration;
...
@@ -30,11 +30,11 @@ import org.springframework.context.annotation.Configuration;
* @since 2.0.0
* @since 2.0.0
*/
*/
@Configuration
@Configuration
@ConditionalOnEnabledEndpoint
(
endpoint
=
ShutdownEndpoint
.
class
)
public
class
ShutdownEndpointAutoConfiguration
{
public
class
ShutdownEndpointAutoConfiguration
{
@Bean
@Bean
@ConditionalOnMissingBean
@ConditionalOnMissingBean
@ConditionalOnEnabledEndpoint
public
ShutdownEndpoint
shutdownEndpoint
()
{
public
ShutdownEndpoint
shutdownEndpoint
()
{
return
new
ShutdownEndpoint
();
return
new
ShutdownEndpoint
();
}
}
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/context/properties/ConfigurationPropertiesReportEndpointAutoConfiguration.java
View file @
5e736c0d
/*
/*
* Copyright 2012-201
7
the original author or authors.
* Copyright 2012-201
9
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -33,6 +33,7 @@ import org.springframework.context.annotation.Configuration;
...
@@ -33,6 +33,7 @@ import org.springframework.context.annotation.Configuration;
* @since 2.0.0
* @since 2.0.0
*/
*/
@Configuration
@Configuration
@ConditionalOnEnabledEndpoint
(
endpoint
=
ConfigurationPropertiesReportEndpoint
.
class
)
@EnableConfigurationProperties
(
ConfigurationPropertiesReportEndpointProperties
.
class
)
@EnableConfigurationProperties
(
ConfigurationPropertiesReportEndpointProperties
.
class
)
public
class
ConfigurationPropertiesReportEndpointAutoConfiguration
{
public
class
ConfigurationPropertiesReportEndpointAutoConfiguration
{
...
@@ -45,7 +46,6 @@ public class ConfigurationPropertiesReportEndpointAutoConfiguration {
...
@@ -45,7 +46,6 @@ public class ConfigurationPropertiesReportEndpointAutoConfiguration {
@Bean
@Bean
@ConditionalOnMissingBean
@ConditionalOnMissingBean
@ConditionalOnEnabledEndpoint
public
ConfigurationPropertiesReportEndpoint
configurationPropertiesReportEndpoint
()
{
public
ConfigurationPropertiesReportEndpoint
configurationPropertiesReportEndpoint
()
{
ConfigurationPropertiesReportEndpoint
endpoint
=
new
ConfigurationPropertiesReportEndpoint
();
ConfigurationPropertiesReportEndpoint
endpoint
=
new
ConfigurationPropertiesReportEndpoint
();
String
[]
keysToSanitize
=
this
.
properties
.
getKeysToSanitize
();
String
[]
keysToSanitize
=
this
.
properties
.
getKeysToSanitize
();
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/condition/ConditionalOnEnabledEndpoint.java
View file @
5e736c0d
/*
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -92,7 +92,7 @@ import org.springframework.core.env.Environment;
...
@@ -92,7 +92,7 @@ import org.springframework.core.env.Environment;
* @see Endpoint
* @see Endpoint
*/
*/
@Retention
(
RetentionPolicy
.
RUNTIME
)
@Retention
(
RetentionPolicy
.
RUNTIME
)
@Target
(
ElementType
.
METHOD
)
@Target
(
{
ElementType
.
METHOD
,
ElementType
.
TYPE
}
)
@Documented
@Documented
@Conditional
(
OnEnabledEndpointCondition
.
class
)
@Conditional
(
OnEnabledEndpointCondition
.
class
)
public
@interface
ConditionalOnEnabledEndpoint
{
public
@interface
ConditionalOnEnabledEndpoint
{
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/condition/OnEnabledEndpointCondition.java
View file @
5e736c0d
/*
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -90,15 +90,11 @@ class OnEnabledEndpointCondition extends SpringBootCondition {
...
@@ -90,15 +90,11 @@ class OnEnabledEndpointCondition extends SpringBootCondition {
private
AnnotationAttributes
getEndpointAttributes
(
ConditionContext
context
,
private
AnnotationAttributes
getEndpointAttributes
(
ConditionContext
context
,
AnnotatedTypeMetadata
metadata
)
{
AnnotatedTypeMetadata
metadata
)
{
Assert
.
state
(
return
getEndpointAttributes
(
getEndpointType
(
context
,
metadata
));
metadata
instanceof
MethodMetadata
&&
metadata
.
isAnnotated
(
Bean
.
class
.
getName
()),
"OnEnabledEndpointCondition may only be used on @Bean methods"
);
Class
<?>
endpointType
=
getEndpointType
(
context
,
(
MethodMetadata
)
metadata
);
return
getEndpointAttributes
(
endpointType
);
}
}
private
Class
<?>
getEndpointType
(
ConditionContext
context
,
MethodMetadata
metadata
)
{
private
Class
<?>
getEndpointType
(
ConditionContext
context
,
AnnotatedTypeMetadata
metadata
)
{
Map
<
String
,
Object
>
attributes
=
metadata
Map
<
String
,
Object
>
attributes
=
metadata
.
getAnnotationAttributes
(
ConditionalOnEnabledEndpoint
.
class
.
getName
());
.
getAnnotationAttributes
(
ConditionalOnEnabledEndpoint
.
class
.
getName
());
if
(
attributes
!=
null
&&
attributes
.
containsKey
(
"endpoint"
))
{
if
(
attributes
!=
null
&&
attributes
.
containsKey
(
"endpoint"
))
{
...
@@ -107,15 +103,19 @@ class OnEnabledEndpointCondition extends SpringBootCondition {
...
@@ -107,15 +103,19 @@ class OnEnabledEndpointCondition extends SpringBootCondition {
return
target
;
return
target
;
}
}
}
}
// We should be safe to load at this point since we are in the REGISTER_BEAN phase
Assert
.
state
(
metadata
instanceof
MethodMetadata
&&
metadata
.
isAnnotated
(
Bean
.
class
.
getName
()),
"OnEnabledEndpointCondition must be used on @Bean methods when the endpoint is not specified"
);
MethodMetadata
methodMetadata
=
(
MethodMetadata
)
metadata
;
try
{
try
{
return
ClassUtils
.
forName
(
metadata
.
getReturnTypeName
(),
return
ClassUtils
.
forName
(
met
hodMet
adata
.
getReturnTypeName
(),
context
.
getClassLoader
());
context
.
getClassLoader
());
}
}
catch
(
Throwable
ex
)
{
catch
(
Throwable
ex
)
{
throw
new
IllegalStateException
(
"Failed to extract endpoint id for "
throw
new
IllegalStateException
(
"Failed to extract endpoint id for "
+
met
adata
.
getDeclaringClassName
()
+
"."
+
metadata
.
getMethodName
(),
+
met
hodMetadata
.
getDeclaringClassName
()
+
"."
ex
);
+
methodMetadata
.
getMethodName
(),
ex
);
}
}
}
}
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/env/EnvironmentEndpointAutoConfiguration.java
View file @
5e736c0d
/*
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -35,6 +35,7 @@ import org.springframework.core.env.Environment;
...
@@ -35,6 +35,7 @@ import org.springframework.core.env.Environment;
* @since 2.0.0
* @since 2.0.0
*/
*/
@Configuration
@Configuration
@ConditionalOnEnabledEndpoint
(
endpoint
=
EnvironmentEndpoint
.
class
)
@EnableConfigurationProperties
(
EnvironmentEndpointProperties
.
class
)
@EnableConfigurationProperties
(
EnvironmentEndpointProperties
.
class
)
public
class
EnvironmentEndpointAutoConfiguration
{
public
class
EnvironmentEndpointAutoConfiguration
{
...
@@ -47,7 +48,6 @@ public class EnvironmentEndpointAutoConfiguration {
...
@@ -47,7 +48,6 @@ public class EnvironmentEndpointAutoConfiguration {
@Bean
@Bean
@ConditionalOnMissingBean
@ConditionalOnMissingBean
@ConditionalOnEnabledEndpoint
public
EnvironmentEndpoint
environmentEndpoint
(
Environment
environment
)
{
public
EnvironmentEndpoint
environmentEndpoint
(
Environment
environment
)
{
EnvironmentEndpoint
endpoint
=
new
EnvironmentEndpoint
(
environment
);
EnvironmentEndpoint
endpoint
=
new
EnvironmentEndpoint
(
environment
);
String
[]
keysToSanitize
=
this
.
properties
.
getKeysToSanitize
();
String
[]
keysToSanitize
=
this
.
properties
.
getKeysToSanitize
();
...
@@ -59,7 +59,6 @@ public class EnvironmentEndpointAutoConfiguration {
...
@@ -59,7 +59,6 @@ public class EnvironmentEndpointAutoConfiguration {
@Bean
@Bean
@ConditionalOnMissingBean
@ConditionalOnMissingBean
@ConditionalOnEnabledEndpoint
@ConditionalOnBean
(
EnvironmentEndpoint
.
class
)
@ConditionalOnBean
(
EnvironmentEndpoint
.
class
)
public
EnvironmentEndpointWebExtension
environmentEndpointWebExtension
(
public
EnvironmentEndpointWebExtension
environmentEndpointWebExtension
(
EnvironmentEndpoint
environmentEndpoint
)
{
EnvironmentEndpoint
environmentEndpoint
)
{
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/flyway/FlywayEndpointAutoConfiguration.java
View file @
5e736c0d
/*
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -38,13 +38,13 @@ import org.springframework.context.annotation.Configuration;
...
@@ -38,13 +38,13 @@ import org.springframework.context.annotation.Configuration;
*/
*/
@Configuration
@Configuration
@ConditionalOnClass
(
Flyway
.
class
)
@ConditionalOnClass
(
Flyway
.
class
)
@ConditionalOnEnabledEndpoint
(
endpoint
=
FlywayEndpoint
.
class
)
@AutoConfigureAfter
(
FlywayAutoConfiguration
.
class
)
@AutoConfigureAfter
(
FlywayAutoConfiguration
.
class
)
public
class
FlywayEndpointAutoConfiguration
{
public
class
FlywayEndpointAutoConfiguration
{
@Bean
@Bean
@ConditionalOnBean
(
Flyway
.
class
)
@ConditionalOnBean
(
Flyway
.
class
)
@ConditionalOnMissingBean
@ConditionalOnMissingBean
@ConditionalOnEnabledEndpoint
public
FlywayEndpoint
flywayEndpoint
(
ApplicationContext
context
)
{
public
FlywayEndpoint
flywayEndpoint
(
ApplicationContext
context
)
{
return
new
FlywayEndpoint
(
context
);
return
new
FlywayEndpoint
(
context
);
}
}
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/health/HealthEndpointConfiguration.java
View file @
5e736c0d
/*
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -33,11 +33,11 @@ import org.springframework.context.annotation.Configuration;
...
@@ -33,11 +33,11 @@ import org.springframework.context.annotation.Configuration;
*/
*/
@Configuration
@Configuration
@ConditionalOnSingleCandidate
(
HealthIndicatorRegistry
.
class
)
@ConditionalOnSingleCandidate
(
HealthIndicatorRegistry
.
class
)
@ConditionalOnEnabledEndpoint
(
endpoint
=
HealthEndpoint
.
class
)
class
HealthEndpointConfiguration
{
class
HealthEndpointConfiguration
{
@Bean
@Bean
@ConditionalOnMissingBean
@ConditionalOnMissingBean
@ConditionalOnEnabledEndpoint
public
HealthEndpoint
healthEndpoint
(
HealthAggregator
healthAggregator
,
public
HealthEndpoint
healthEndpoint
(
HealthAggregator
healthAggregator
,
HealthIndicatorRegistry
registry
)
{
HealthIndicatorRegistry
registry
)
{
return
new
HealthEndpoint
(
return
new
HealthEndpoint
(
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/health/HealthEndpointWebExtensionConfiguration.java
View file @
5e736c0d
/*
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -69,6 +69,7 @@ class HealthEndpointWebExtensionConfiguration {
...
@@ -69,6 +69,7 @@ class HealthEndpointWebExtensionConfiguration {
@Configuration
@Configuration
@ConditionalOnWebApplication
(
type
=
Type
.
REACTIVE
)
@ConditionalOnWebApplication
(
type
=
Type
.
REACTIVE
)
@ConditionalOnSingleCandidate
(
ReactiveHealthIndicatorRegistry
.
class
)
@ConditionalOnSingleCandidate
(
ReactiveHealthIndicatorRegistry
.
class
)
@ConditionalOnEnabledEndpoint
(
endpoint
=
HealthEndpoint
.
class
)
static
class
ReactiveWebHealthConfiguration
{
static
class
ReactiveWebHealthConfiguration
{
private
final
ReactiveHealthIndicator
reactiveHealthIndicator
;
private
final
ReactiveHealthIndicator
reactiveHealthIndicator
;
...
@@ -82,7 +83,6 @@ class HealthEndpointWebExtensionConfiguration {
...
@@ -82,7 +83,6 @@ class HealthEndpointWebExtensionConfiguration {
@Bean
@Bean
@ConditionalOnMissingBean
@ConditionalOnMissingBean
@ConditionalOnEnabledEndpoint
@ConditionalOnBean
(
HealthEndpoint
.
class
)
@ConditionalOnBean
(
HealthEndpoint
.
class
)
public
ReactiveHealthEndpointWebExtension
reactiveHealthEndpointWebExtension
(
public
ReactiveHealthEndpointWebExtension
reactiveHealthEndpointWebExtension
(
HealthWebEndpointResponseMapper
responseMapper
)
{
HealthWebEndpointResponseMapper
responseMapper
)
{
...
@@ -94,11 +94,11 @@ class HealthEndpointWebExtensionConfiguration {
...
@@ -94,11 +94,11 @@ class HealthEndpointWebExtensionConfiguration {
@Configuration
@Configuration
@ConditionalOnWebApplication
(
type
=
Type
.
SERVLET
)
@ConditionalOnWebApplication
(
type
=
Type
.
SERVLET
)
@ConditionalOnEnabledEndpoint
(
endpoint
=
HealthEndpoint
.
class
)
static
class
ServletWebHealthConfiguration
{
static
class
ServletWebHealthConfiguration
{
@Bean
@Bean
@ConditionalOnMissingBean
@ConditionalOnMissingBean
@ConditionalOnEnabledEndpoint
@ConditionalOnBean
(
HealthEndpoint
.
class
)
@ConditionalOnBean
(
HealthEndpoint
.
class
)
public
HealthEndpointWebExtension
healthEndpointWebExtension
(
public
HealthEndpointWebExtension
healthEndpointWebExtension
(
HealthEndpoint
healthEndpoint
,
HealthEndpoint
healthEndpoint
,
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/info/InfoEndpointAutoConfiguration.java
View file @
5e736c0d
/*
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -35,12 +35,12 @@ import org.springframework.context.annotation.Configuration;
...
@@ -35,12 +35,12 @@ import org.springframework.context.annotation.Configuration;
* @since 2.0.0
* @since 2.0.0
*/
*/
@Configuration
@Configuration
@ConditionalOnEnabledEndpoint
(
endpoint
=
InfoEndpoint
.
class
)
@AutoConfigureAfter
(
InfoContributorAutoConfiguration
.
class
)
@AutoConfigureAfter
(
InfoContributorAutoConfiguration
.
class
)
public
class
InfoEndpointAutoConfiguration
{
public
class
InfoEndpointAutoConfiguration
{
@Bean
@Bean
@ConditionalOnMissingBean
@ConditionalOnMissingBean
@ConditionalOnEnabledEndpoint
public
InfoEndpoint
infoEndpoint
(
ObjectProvider
<
InfoContributor
>
infoContributors
)
{
public
InfoEndpoint
infoEndpoint
(
ObjectProvider
<
InfoContributor
>
infoContributors
)
{
return
new
InfoEndpoint
(
return
new
InfoEndpoint
(
infoContributors
.
orderedStream
().
collect
(
Collectors
.
toList
()));
infoContributors
.
orderedStream
().
collect
(
Collectors
.
toList
()));
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/integration/IntegrationGraphEndpointAutoConfiguration.java
View file @
5e736c0d
/*
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -40,12 +40,12 @@ import org.springframework.integration.graph.IntegrationGraphServer;
...
@@ -40,12 +40,12 @@ import org.springframework.integration.graph.IntegrationGraphServer;
@Configuration
@Configuration
@ConditionalOnClass
(
IntegrationGraphServer
.
class
)
@ConditionalOnClass
(
IntegrationGraphServer
.
class
)
@ConditionalOnBean
(
IntegrationConfigurationBeanFactoryPostProcessor
.
class
)
@ConditionalOnBean
(
IntegrationConfigurationBeanFactoryPostProcessor
.
class
)
@ConditionalOnEnabledEndpoint
(
endpoint
=
IntegrationGraphEndpoint
.
class
)
@AutoConfigureAfter
(
IntegrationAutoConfiguration
.
class
)
@AutoConfigureAfter
(
IntegrationAutoConfiguration
.
class
)
public
class
IntegrationGraphEndpointAutoConfiguration
{
public
class
IntegrationGraphEndpointAutoConfiguration
{
@Bean
@Bean
@ConditionalOnMissingBean
@ConditionalOnMissingBean
@ConditionalOnEnabledEndpoint
public
IntegrationGraphEndpoint
integrationGraphEndpoint
(
public
IntegrationGraphEndpoint
integrationGraphEndpoint
(
IntegrationGraphServer
integrationGraphServer
)
{
IntegrationGraphServer
integrationGraphServer
)
{
return
new
IntegrationGraphEndpoint
(
integrationGraphServer
);
return
new
IntegrationGraphEndpoint
(
integrationGraphServer
);
...
@@ -53,7 +53,6 @@ public class IntegrationGraphEndpointAutoConfiguration {
...
@@ -53,7 +53,6 @@ public class IntegrationGraphEndpointAutoConfiguration {
@Bean
@Bean
@ConditionalOnMissingBean
@ConditionalOnMissingBean
@ConditionalOnEnabledEndpoint
(
endpoint
=
IntegrationGraphEndpoint
.
class
)
public
IntegrationGraphServer
integrationGraphServer
()
{
public
IntegrationGraphServer
integrationGraphServer
()
{
return
new
IntegrationGraphServer
();
return
new
IntegrationGraphServer
();
}
}
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/jolokia/JolokiaEndpointAutoConfiguration.java
View file @
5e736c0d
/*
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -36,11 +36,11 @@ import org.springframework.context.annotation.Configuration;
...
@@ -36,11 +36,11 @@ import org.springframework.context.annotation.Configuration;
@Configuration
@Configuration
@ConditionalOnWebApplication
(
type
=
Type
.
SERVLET
)
@ConditionalOnWebApplication
(
type
=
Type
.
SERVLET
)
@ConditionalOnClass
(
AgentServlet
.
class
)
@ConditionalOnClass
(
AgentServlet
.
class
)
@ConditionalOnEnabledEndpoint
(
endpoint
=
JolokiaEndpoint
.
class
)
@EnableConfigurationProperties
(
JolokiaProperties
.
class
)
@EnableConfigurationProperties
(
JolokiaProperties
.
class
)
public
class
JolokiaEndpointAutoConfiguration
{
public
class
JolokiaEndpointAutoConfiguration
{
@Bean
@Bean
@ConditionalOnEnabledEndpoint
public
JolokiaEndpoint
jolokiaEndpoint
(
JolokiaProperties
properties
)
{
public
JolokiaEndpoint
jolokiaEndpoint
(
JolokiaProperties
properties
)
{
return
new
JolokiaEndpoint
(
properties
.
getConfig
());
return
new
JolokiaEndpoint
(
properties
.
getConfig
());
}
}
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/liquibase/LiquibaseEndpointAutoConfiguration.java
View file @
5e736c0d
/*
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -41,20 +41,19 @@ import org.springframework.context.annotation.Configuration;
...
@@ -41,20 +41,19 @@ import org.springframework.context.annotation.Configuration;
*/
*/
@Configuration
@Configuration
@ConditionalOnClass
(
SpringLiquibase
.
class
)
@ConditionalOnClass
(
SpringLiquibase
.
class
)
@ConditionalOnEnabledEndpoint
(
endpoint
=
LiquibaseEndpoint
.
class
)
@AutoConfigureAfter
(
LiquibaseAutoConfiguration
.
class
)
@AutoConfigureAfter
(
LiquibaseAutoConfiguration
.
class
)
public
class
LiquibaseEndpointAutoConfiguration
{
public
class
LiquibaseEndpointAutoConfiguration
{
@Bean
@Bean
@ConditionalOnBean
(
SpringLiquibase
.
class
)
@ConditionalOnBean
(
SpringLiquibase
.
class
)
@ConditionalOnMissingBean
@ConditionalOnMissingBean
@ConditionalOnEnabledEndpoint
public
LiquibaseEndpoint
liquibaseEndpoint
(
ApplicationContext
context
)
{
public
LiquibaseEndpoint
liquibaseEndpoint
(
ApplicationContext
context
)
{
return
new
LiquibaseEndpoint
(
context
);
return
new
LiquibaseEndpoint
(
context
);
}
}
@Bean
@Bean
@ConditionalOnBean
(
SpringLiquibase
.
class
)
@ConditionalOnBean
(
SpringLiquibase
.
class
)
@ConditionalOnEnabledEndpoint
(
endpoint
=
LiquibaseEndpoint
.
class
)
public
static
BeanPostProcessor
preventDataSourceCloseBeanPostProcessor
()
{
public
static
BeanPostProcessor
preventDataSourceCloseBeanPostProcessor
()
{
return
new
BeanPostProcessor
()
{
return
new
BeanPostProcessor
()
{
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/logging/LoggersEndpointAutoConfiguration.java
View file @
5e736c0d
/*
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -38,13 +38,13 @@ import org.springframework.core.type.AnnotatedTypeMetadata;
...
@@ -38,13 +38,13 @@ import org.springframework.core.type.AnnotatedTypeMetadata;
* @since 2.0.0
* @since 2.0.0
*/
*/
@Configuration
@Configuration
@ConditionalOnEnabledEndpoint
(
endpoint
=
LoggersEndpoint
.
class
)
public
class
LoggersEndpointAutoConfiguration
{
public
class
LoggersEndpointAutoConfiguration
{
@Bean
@Bean
@ConditionalOnBean
(
LoggingSystem
.
class
)
@ConditionalOnBean
(
LoggingSystem
.
class
)
@Conditional
(
OnEnabledLoggingSystemCondition
.
class
)
@Conditional
(
OnEnabledLoggingSystemCondition
.
class
)
@ConditionalOnMissingBean
@ConditionalOnMissingBean
@ConditionalOnEnabledEndpoint
public
LoggersEndpoint
loggersEndpoint
(
LoggingSystem
loggingSystem
)
{
public
LoggersEndpoint
loggersEndpoint
(
LoggingSystem
loggingSystem
)
{
return
new
LoggersEndpoint
(
loggingSystem
);
return
new
LoggersEndpoint
(
loggingSystem
);
}
}
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/management/HeapDumpWebEndpointAutoConfiguration.java
View file @
5e736c0d
/*
/*
* Copyright 2012-201
7
the original author or authors.
* Copyright 2012-201
9
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -30,11 +30,11 @@ import org.springframework.context.annotation.Configuration;
...
@@ -30,11 +30,11 @@ import org.springframework.context.annotation.Configuration;
* @since 2.0.0
* @since 2.0.0
*/
*/
@Configuration
@Configuration
@ConditionalOnEnabledEndpoint
(
endpoint
=
HeapDumpWebEndpoint
.
class
)
public
class
HeapDumpWebEndpointAutoConfiguration
{
public
class
HeapDumpWebEndpointAutoConfiguration
{
@Bean
@Bean
@ConditionalOnMissingBean
@ConditionalOnMissingBean
@ConditionalOnEnabledEndpoint
public
HeapDumpWebEndpoint
heapDumpWebEndpoint
()
{
public
HeapDumpWebEndpoint
heapDumpWebEndpoint
()
{
return
new
HeapDumpWebEndpoint
();
return
new
HeapDumpWebEndpoint
();
}
}
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/management/ThreadDumpEndpointAutoConfiguration.java
View file @
5e736c0d
/*
/*
* Copyright 2012-201
7
the original author or authors.
* Copyright 2012-201
9
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -30,11 +30,11 @@ import org.springframework.context.annotation.Configuration;
...
@@ -30,11 +30,11 @@ import org.springframework.context.annotation.Configuration;
* @since 2.0.0
* @since 2.0.0
*/
*/
@Configuration
@Configuration
@ConditionalOnEnabledEndpoint
(
endpoint
=
ThreadDumpEndpoint
.
class
)
public
class
ThreadDumpEndpointAutoConfiguration
{
public
class
ThreadDumpEndpointAutoConfiguration
{
@Bean
@Bean
@ConditionalOnMissingBean
@ConditionalOnMissingBean
@ConditionalOnEnabledEndpoint
public
ThreadDumpEndpoint
dumpEndpoint
()
{
public
ThreadDumpEndpoint
dumpEndpoint
()
{
return
new
ThreadDumpEndpoint
();
return
new
ThreadDumpEndpoint
();
}
}
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/MetricsEndpointAutoConfiguration.java
View file @
5e736c0d
/*
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -37,6 +37,7 @@ import org.springframework.context.annotation.Configuration;
...
@@ -37,6 +37,7 @@ import org.springframework.context.annotation.Configuration;
*/
*/
@Configuration
@Configuration
@ConditionalOnClass
(
Timed
.
class
)
@ConditionalOnClass
(
Timed
.
class
)
@ConditionalOnEnabledEndpoint
(
endpoint
=
MetricsEndpoint
.
class
)
@AutoConfigureAfter
({
MetricsAutoConfiguration
.
class
,
@AutoConfigureAfter
({
MetricsAutoConfiguration
.
class
,
CompositeMeterRegistryAutoConfiguration
.
class
})
CompositeMeterRegistryAutoConfiguration
.
class
})
public
class
MetricsEndpointAutoConfiguration
{
public
class
MetricsEndpointAutoConfiguration
{
...
@@ -44,7 +45,6 @@ public class MetricsEndpointAutoConfiguration {
...
@@ -44,7 +45,6 @@ public class MetricsEndpointAutoConfiguration {
@Bean
@Bean
@ConditionalOnBean
(
MeterRegistry
.
class
)
@ConditionalOnBean
(
MeterRegistry
.
class
)
@ConditionalOnMissingBean
@ConditionalOnMissingBean
@ConditionalOnEnabledEndpoint
public
MetricsEndpoint
metricsEndpoint
(
MeterRegistry
registry
)
{
public
MetricsEndpoint
metricsEndpoint
(
MeterRegistry
registry
)
{
return
new
MetricsEndpoint
(
registry
);
return
new
MetricsEndpoint
(
registry
);
}
}
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/prometheus/PrometheusMetricsExportAutoConfiguration.java
View file @
5e736c0d
/*
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -82,10 +82,10 @@ public class PrometheusMetricsExportAutoConfiguration {
...
@@ -82,10 +82,10 @@ public class PrometheusMetricsExportAutoConfiguration {
}
}
@Configuration
@Configuration
@ConditionalOnEnabledEndpoint
(
endpoint
=
PrometheusScrapeEndpoint
.
class
)
public
static
class
PrometheusScrapeEndpointConfiguration
{
public
static
class
PrometheusScrapeEndpointConfiguration
{
@Bean
@Bean
@ConditionalOnEnabledEndpoint
@ConditionalOnMissingBean
@ConditionalOnMissingBean
public
PrometheusScrapeEndpoint
prometheusEndpoint
(
public
PrometheusScrapeEndpoint
prometheusEndpoint
(
CollectorRegistry
collectorRegistry
)
{
CollectorRegistry
collectorRegistry
)
{
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/scheduling/ScheduledTasksEndpointAutoConfiguration.java
View file @
5e736c0d
/*
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -34,11 +34,11 @@ import org.springframework.scheduling.config.ScheduledTaskHolder;
...
@@ -34,11 +34,11 @@ import org.springframework.scheduling.config.ScheduledTaskHolder;
* @since 2.0.0
* @since 2.0.0
*/
*/
@Configuration
@Configuration
@ConditionalOnEnabledEndpoint
(
endpoint
=
ScheduledTasksEndpoint
.
class
)
public
class
ScheduledTasksEndpointAutoConfiguration
{
public
class
ScheduledTasksEndpointAutoConfiguration
{
@Bean
@Bean
@ConditionalOnMissingBean
@ConditionalOnMissingBean
@ConditionalOnEnabledEndpoint
public
ScheduledTasksEndpoint
scheduledTasksEndpoint
(
public
ScheduledTasksEndpoint
scheduledTasksEndpoint
(
ObjectProvider
<
ScheduledTaskHolder
>
holders
)
{
ObjectProvider
<
ScheduledTaskHolder
>
holders
)
{
return
new
ScheduledTasksEndpoint
(
return
new
ScheduledTasksEndpoint
(
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/session/SessionsEndpointAutoConfiguration.java
View file @
5e736c0d
/*
/*
* Copyright 2012-201
7
the original author or authors.
* Copyright 2012-201
9
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -37,13 +37,13 @@ import org.springframework.session.Session;
...
@@ -37,13 +37,13 @@ import org.springframework.session.Session;
*/
*/
@Configuration
@Configuration
@ConditionalOnClass
(
FindByIndexNameSessionRepository
.
class
)
@ConditionalOnClass
(
FindByIndexNameSessionRepository
.
class
)
@ConditionalOnEnabledEndpoint
(
endpoint
=
SessionsEndpoint
.
class
)
@AutoConfigureAfter
(
SessionAutoConfiguration
.
class
)
@AutoConfigureAfter
(
SessionAutoConfiguration
.
class
)
public
class
SessionsEndpointAutoConfiguration
{
public
class
SessionsEndpointAutoConfiguration
{
@Bean
@Bean
@ConditionalOnBean
(
FindByIndexNameSessionRepository
.
class
)
@ConditionalOnBean
(
FindByIndexNameSessionRepository
.
class
)
@ConditionalOnMissingBean
@ConditionalOnMissingBean
@ConditionalOnEnabledEndpoint
public
SessionsEndpoint
sessionEndpoint
(
public
SessionsEndpoint
sessionEndpoint
(
FindByIndexNameSessionRepository
<?
extends
Session
>
sessionRepository
)
{
FindByIndexNameSessionRepository
<?
extends
Session
>
sessionRepository
)
{
return
new
SessionsEndpoint
(
sessionRepository
);
return
new
SessionsEndpoint
(
sessionRepository
);
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/trace/http/HttpTraceEndpointAutoConfiguration.java
View file @
5e736c0d
/*
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -33,13 +33,13 @@ import org.springframework.context.annotation.Configuration;
...
@@ -33,13 +33,13 @@ import org.springframework.context.annotation.Configuration;
* @since 2.0.0
* @since 2.0.0
*/
*/
@Configuration
@Configuration
@ConditionalOnEnabledEndpoint
(
endpoint
=
HttpTraceEndpoint
.
class
)
@AutoConfigureAfter
(
HttpTraceAutoConfiguration
.
class
)
@AutoConfigureAfter
(
HttpTraceAutoConfiguration
.
class
)
public
class
HttpTraceEndpointAutoConfiguration
{
public
class
HttpTraceEndpointAutoConfiguration
{
@Bean
@Bean
@ConditionalOnBean
(
HttpTraceRepository
.
class
)
@ConditionalOnBean
(
HttpTraceRepository
.
class
)
@ConditionalOnMissingBean
@ConditionalOnMissingBean
@ConditionalOnEnabledEndpoint
public
HttpTraceEndpoint
httpTraceEndpoint
(
HttpTraceRepository
traceRepository
)
{
public
HttpTraceEndpoint
httpTraceEndpoint
(
HttpTraceRepository
traceRepository
)
{
return
new
HttpTraceEndpoint
(
traceRepository
);
return
new
HttpTraceEndpoint
(
traceRepository
);
}
}
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/condition/ConditionalOnEnabledEndpointTests.java
View file @
5e736c0d
/*
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -148,6 +148,14 @@ public class ConditionalOnEnabledEndpointTests {
...
@@ -148,6 +148,14 @@ public class ConditionalOnEnabledEndpointTests {
.
run
((
context
)
->
assertThat
(
context
).
hasBean
(
"fooBar"
));
.
run
((
context
)
->
assertThat
(
context
).
hasBean
(
"fooBar"
));
}
}
@Test
public
void
outcomeWhenEndpointEnabledPropertyIsFalseOnClassShouldNotMatch
()
{
this
.
contextRunner
.
withPropertyValues
(
"management.endpoint.foo.enabled=false"
)
.
withUserConfiguration
(
FooEndpointEnabledByDefaultTrueOnConfigurationConfiguration
.
class
)
.
run
((
context
)
->
assertThat
(
context
).
doesNotHaveBean
(
"foo"
));
}
@Endpoint
(
id
=
"foo"
,
enableByDefault
=
true
)
@Endpoint
(
id
=
"foo"
,
enableByDefault
=
true
)
static
class
FooEndpointEnabledByDefaultTrue
{
static
class
FooEndpointEnabledByDefaultTrue
{
...
@@ -193,6 +201,17 @@ public class ConditionalOnEnabledEndpointTests {
...
@@ -193,6 +201,17 @@ public class ConditionalOnEnabledEndpointTests {
}
}
@Configuration
@ConditionalOnEnabledEndpoint
(
endpoint
=
FooEndpointEnabledByDefaultTrue
.
class
)
static
class
FooEndpointEnabledByDefaultTrueOnConfigurationConfiguration
{
@Bean
public
FooEndpointEnabledByDefaultTrue
foo
()
{
return
new
FooEndpointEnabledByDefaultTrue
();
}
}
@Configuration
@Configuration
static
class
FooEndpointEnabledByDefaultFalseConfiguration
{
static
class
FooEndpointEnabledByDefaultFalseConfiguration
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment