pull/14003/head
Stephane Nicoll 6 years ago
parent 0f095abded
commit 737b4a275b

@ -44,6 +44,7 @@ import org.springframework.boot.autoconfigure.jmx.JmxAutoConfiguration;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.util.ObjectUtils;
/**
@ -54,6 +55,7 @@ import org.springframework.util.ObjectUtils;
* @author Phillip Webb
* @since 2.0.0
*/
@Configuration
@AutoConfigureAfter(JmxAutoConfiguration.class)
@EnableConfigurationProperties(JmxEndpointProperties.class)
public class JmxEndpointAutoConfiguration {

@ -55,7 +55,7 @@ public class ServletEndpointManagementContextConfiguration {
@Configuration
@ConditionalOnClass(DispatcherServlet.class)
public class WebMvcServletEndpointManagementContextConfiguration {
public static class WebMvcServletEndpointManagementContextConfiguration {
private final ApplicationContext context;
@ -80,7 +80,7 @@ public class ServletEndpointManagementContextConfiguration {
@Configuration
@ConditionalOnClass(ResourceConfig.class)
@ConditionalOnMissingClass("org.springframework.web.servlet.DispatcherServlet")
public class JerseyServletEndpointManagementContextConfiguration {
public static class JerseyServletEndpointManagementContextConfiguration {
@Bean
public ServletEndpointRegistrar servletEndpointRegistrar(

@ -20,6 +20,7 @@ import io.micrometer.core.instrument.composite.CompositeMeterRegistry;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
/**
@ -29,6 +30,7 @@ import org.springframework.context.annotation.Import;
* @author Andy Wilkinson
* @since 2.0.0
*/
@Configuration
@Import({ NoOpMeterRegistryConfiguration.class,
CompositeMeterRegistryConfiguration.class })
@ConditionalOnClass(CompositeMeterRegistry.class)

@ -23,6 +23,7 @@ import io.micrometer.core.instrument.composite.CompositeMeterRegistry;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* Configuration for a no-op meter registry when the context does not contain an
@ -30,6 +31,7 @@ import org.springframework.context.annotation.Bean;
*
* @author Andy Wilkinson
*/
@Configuration
@ConditionalOnBean(Clock.class)
@ConditionalOnMissingBean(MeterRegistry.class)
class NoOpMeterRegistryConfiguration {

@ -31,6 +31,7 @@ import org.springframework.boot.web.embedded.tomcat.TomcatReactiveWebServerFacto
import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
import org.springframework.boot.web.server.WebServerFactoryCustomizer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* {@link EnableAutoConfiguration Auto-configuration} for {@link TomcatMetrics}.
@ -38,6 +39,7 @@ import org.springframework.context.annotation.Bean;
* @author Andy Wilkinson
* @since 2.0.0
*/
@Configuration
@ConditionalOnWebApplication
@ConditionalOnClass({ TomcatMetrics.class, Manager.class })
public class TomcatMetricsAutoConfiguration {

@ -54,6 +54,7 @@ public class HttpTraceAutoConfiguration {
return new HttpExchangeTracer(traceProperties.getInclude());
}
@Configuration
@ConditionalOnWebApplication(type = Type.SERVLET)
static class ServletTraceFilterConfiguration {
@ -66,6 +67,7 @@ public class HttpTraceAutoConfiguration {
}
@Configuration
@ConditionalOnWebApplication(type = Type.REACTIVE)
static class ReactiveTraceFilterConfiguration {

@ -83,7 +83,7 @@ class ServletManagementChildContextConfiguration {
@Configuration
@ConditionalOnClass({ EnableWebSecurity.class, Filter.class })
@ConditionalOnBean(name = BeanIds.SPRING_SECURITY_FILTER_CHAIN, search = SearchStrategy.ANCESTORS)
class ServletManagementContextSecurityConfiguration {
static class ServletManagementContextSecurityConfiguration {
@Bean
public Filter springSecurityFilterChain(HierarchicalBeanFactory beanFactory) {

@ -21,6 +21,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;
import org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor;
@ -33,6 +34,7 @@ import org.springframework.dao.annotation.PersistenceExceptionTranslationPostPro
* @author Madhura Bhave
* @since 1.2.0
*/
@Configuration
@ConditionalOnClass(PersistenceExceptionTranslationPostProcessor.class)
public class PersistenceExceptionTranslationAutoConfiguration {

@ -1,5 +1,5 @@
/*
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2018 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.
@ -29,6 +29,7 @@ import org.springframework.beans.factory.ListableBeanFactory;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.hateoas.mvc.TypeConstrainedMappingJackson2HttpMessageConverter;
import org.springframework.http.MediaType;
import org.springframework.http.converter.AbstractHttpMessageConverter;
@ -41,6 +42,7 @@ import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandl
*
* @author Andy Wilkinson
*/
@Configuration
public class HypermediaHttpMessageConverterConfiguration {
@Bean

@ -1,5 +1,5 @@
/*
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2018 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.
@ -36,6 +36,7 @@ import org.springframework.core.io.Resource;
* @author Vedran Pavic
* @author Stephane Nicoll
*/
@Configuration
@ConditionalOnClass(HazelcastClient.class)
@ConditionalOnMissingBean(HazelcastInstance.class)
class HazelcastClientConfiguration {

@ -1,5 +1,5 @@
/*
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2018 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.
@ -35,6 +35,7 @@ import org.springframework.core.io.Resource;
* @author Stephane Nicoll
* @author Vedran Pavic
*/
@Configuration
@ConditionalOnMissingBean(HazelcastInstance.class)
class HazelcastServerConfiguration {

@ -132,6 +132,7 @@ public class IntegrationAutoConfiguration {
/**
* Integration component scan configuration.
*/
@Configuration
@ConditionalOnMissingBean(GatewayProxyFactoryBean.class)
@Import(IntegrationAutoConfigurationScanRegistrar.class)
protected static class IntegrationComponentScanConfiguration {

@ -38,6 +38,7 @@ import org.springframework.boot.context.properties.source.MapConfigurationProper
import org.springframework.boot.jdbc.DatabaseDriver;
import org.springframework.boot.jdbc.XADataSourceWrapper;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType;
import org.springframework.util.Assert;
import org.springframework.util.ClassUtils;
@ -51,6 +52,7 @@ import org.springframework.util.StringUtils;
* @author Madhura Bhave
* @since 1.2.0
*/
@Configuration
@AutoConfigureBefore(DataSourceAutoConfiguration.class)
@EnableConfigurationProperties(DataSourceProperties.class)
@ConditionalOnClass({ DataSource.class, TransactionManager.class,

@ -35,6 +35,7 @@ import org.springframework.security.config.annotation.web.configuration.WebSecur
* @author Madhura Bhave
* @since 2.0.0
*/
@Configuration
@ConditionalOnClass(WebSecurityConfigurerAdapter.class)
@ConditionalOnMissingBean(WebSecurityConfigurerAdapter.class)
@ConditionalOnWebApplication(type = Type.SERVLET)

@ -19,6 +19,7 @@ package org.springframework.boot.autoconfigure.security.servlet;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.BeanIds;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
@ -34,6 +35,7 @@ import org.springframework.security.config.annotation.web.configuration.WebSecur
* @author Madhura Bhave
* @since 2.0.0
*/
@Configuration
@ConditionalOnBean(WebSecurityConfigurerAdapter.class)
@ConditionalOnMissingBean(name = BeanIds.SPRING_SECURITY_FILTER_CHAIN)
@ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.SERVLET)

@ -1,5 +1,5 @@
/*
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2018 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.
@ -25,6 +25,7 @@ import org.springframework.boot.autoconfigure.jms.activemq.ActiveMQAutoConfigura
import org.springframework.boot.autoconfigure.jms.artemis.ArtemisAutoConfiguration;
import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
/**
@ -34,6 +35,7 @@ import org.springframework.context.annotation.Import;
* @author Phillip Webb
* @since 1.2.0
*/
@Configuration
@ConditionalOnClass(javax.transaction.Transaction.class)
@ConditionalOnProperty(prefix = "spring.jta", value = "enabled", matchIfMissing = true)
@AutoConfigureBefore({ XADataSourceAutoConfiguration.class,

@ -43,6 +43,10 @@ import org.springframework.core.env.Environment;
@EnableConfigurationProperties(ServerProperties.class)
public class EmbeddedWebServerFactoryCustomizerAutoConfiguration {
/**
* Nested configuration if Tomcat is being used.
*/
@Configuration
@ConditionalOnClass({ Tomcat.class, UpgradeProtocol.class })
public static class TomcatWebServerFactoryCustomizerConfiguration {

@ -48,6 +48,7 @@ import org.springframework.context.annotation.Configuration;
* @author Brian Clozel
* @author Stephane Nicoll
*/
@Configuration
class ServletWebServerFactoryConfiguration {
@Configuration

@ -44,6 +44,7 @@ import org.springframework.web.socket.config.annotation.WebSocketMessageBrokerCo
* @author Andy Wilkinson
* @since 1.3.0
*/
@Configuration
@ConditionalOnWebApplication(type = Type.SERVLET)
@ConditionalOnClass(WebSocketMessageBrokerConfigurer.class)
@AutoConfigureAfter(JacksonAutoConfiguration.class)

@ -104,6 +104,7 @@ public class RemoteDevToolsAutoConfiguration {
/**
* Configuration for remote update and restarts.
*/
@Configuration
@ConditionalOnProperty(prefix = "spring.devtools.remote.restart", name = "enabled", matchIfMissing = true)
static class RemoteRestartConfiguration {

@ -1,5 +1,5 @@
/*
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2018 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.
@ -129,6 +129,7 @@ public class RemoteClientConfiguration implements InitializingBean {
/**
* LiveReload configuration.
*/
@Configuration
@ConditionalOnProperty(prefix = "spring.devtools.livereload", name = "enabled", matchIfMissing = true)
static class LiveReloadConfiguration {
@ -175,6 +176,7 @@ public class RemoteClientConfiguration implements InitializingBean {
/**
* Client configuration for remote update and restarts.
*/
@Configuration
@ConditionalOnProperty(prefix = "spring.devtools.remote.restart", name = "enabled", matchIfMissing = true)
static class RemoteRestartClientConfiguration {

Loading…
Cancel
Save