From 2c05e9f1500377becc4f71698a3d8da38851382f Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Sat, 6 Jul 2013 18:38:30 -0700 Subject: [PATCH] Restructure packages --- .../autoconfigure/AuditAutoConfiguration.java | 4 +- .../EndpointAutoConfiguration.java | 2 +- .../EndpointWebMvcAutoConfiguration.java | 6 +- ...dpointWebMvcChildContextConfiguration.java | 4 +- .../ErrorMvcAutoConfiguration.java | 4 +- ...mentServerPropertiesAutoConfiguration.java | 4 +- .../MetricFilterAutoConfiguration.java | 4 +- .../MetricRepositoryAutoConfiguration.java | 2 +- .../SecurityAutoConfiguration.java | 6 +- .../TraceRepositoryAutoConfiguration.java | 2 +- .../TraceWebFilterAutoConfiguration.java | 2 +- .../zero/actuate/endpoint/BeansEndpoint.java | 2 +- .../zero/actuate/endpoint/DumpEndpoint.java | 2 +- .../actuate/endpoint/EnvironmentEndpoint.java | 2 +- .../zero/actuate/endpoint/HealthEndpoint.java | 2 +- .../zero/actuate/endpoint/InfoEndpoint.java | 2 +- .../actuate/endpoint/MetricsEndpoint.java | 2 +- .../actuate/endpoint/ShutdownEndpoint.java | 2 +- .../zero/actuate/endpoint/TraceEndpoint.java | 2 +- .../fixme/ManagementServerConfiguration.java | 4 +- .../ManagementServerProperties.java | 4 +- .../properties/SecurityProperties.java | 2 +- .../actuate/endpoint/BeansEndpointTests.java | 2 +- .../actuate/endpoint/DumpEndpointTests.java | 2 +- .../endpoint/EnvironmentEndpointTests.java | 2 +- .../actuate/endpoint/HealthEndpointTests.java | 2 +- .../actuate/endpoint/InfoEndpointTests.java | 2 +- .../endpoint/MetricsEndpointTests.java | 2 +- .../endpoint/ShutdownEndpointTests.java | 2 +- .../actuate/endpoint/TraceEndpointTests.java | 2 +- .../MessageSourceAutoConfiguration.java | 2 +- .../PropertyPlaceholderAutoConfiguration.java | 2 +- .../batch/BatchAutoConfiguration.java | 6 +- .../JpaRepositoriesAutoConfiguration.java | 4 +- .../jdbc/DataSourceAutoConfiguration.java | 6 +- ...ceTransactionManagerAutoConfiguration.java | 6 +- .../jpa/HibernateJpaAutoConfiguration.java | 2 +- .../orm/jpa/JpaAutoConfiguration.java | 4 +- .../thymeleaf/ThymeleafAutoConfiguration.java | 6 +- ...ddedServletContainerAutoConfiguration.java | 4 +- .../web/MultipartAutoConfiguration.java | 4 +- .../ServerPropertiesAutoConfiguration.java | 61 ++++--------------- .../web/WebMvcAutoConfiguration.java | 6 +- .../annotation/EnableAutoConfiguration.java | 6 +- ...ervletContainerAutoConfigurationTests.java | 2 +- ...erverPropertiesAutoConfigurationTests.java | 9 ++- .../AbstractOnBeanCondition.java | 2 +- .../ConditionLogUtils.java | 2 +- .../ConditionalOnBean.java | 2 +- .../ConditionalOnClass.java | 2 +- .../ConditionalOnExpression.java | 2 +- .../ConditionalOnMissingBean.java | 2 +- .../ConditionalOnMissingClass.java | 2 +- .../ConditionalOnNotWebApplication.java | 2 +- .../ConditionalOnResource.java | 2 +- .../ConditionalOnWebApplication.java | 2 +- .../OnBeanCondition.java | 2 +- .../OnClassCondition.java | 2 +- .../OnExpressionCondition.java | 2 +- .../OnMissingBeanCondition.java | 2 +- .../OnMissingClassCondition.java | 2 +- .../OnNotWebApplicationCondition.java | 2 +- .../OnResourceCondition.java | 2 +- .../OnWebApplicationCondition.java | 2 +- .../embedded}/ServerProperties.java | 48 +++++++++++++-- ...TomcatEmbeddedServletContainerFactory.java | 2 + .../ConfigurationProperties.java | 4 +- ...urationPropertiesBindingConfiguration.java | 8 ++- ...rationPropertiesBindingPostProcessor.java} | 6 +- .../EnableConfigurationProperties.java | 2 +- ...ConfigurationPropertiesImportSelector.java | 4 +- .../AssertMissingBean.java | 4 +- .../AssertMissingBeanCondition.java | 4 +- .../NotWebApplicationConditionTests.java | 6 +- .../OnBeanConditionTests.java | 3 +- .../OnClassConditionTests.java | 6 +- .../OnExpressionConditionTests.java | 4 +- .../OnMissingBeanConditionTests.java | 6 +- .../OnMissingClassConditionTests.java | 4 +- .../OnResourceConditionTests.java | 4 +- .../WebApplicationConditionTests.java | 6 +- .../embedded}/ServerPropertiesTests.java | 7 ++- .../EnableConfigurationPropertiesTests.java | 9 ++- .../EnableConfigurationPropertiesTests.java | 4 +- .../zero/context/{annotation => }/foo.xml | 0 .../testProperties.xml | 4 +- .../actuator/SampleActuatorApplication.java | 2 +- .../sample/actuator/ServiceProperties.java | 2 +- .../SampleIntegrationApplication.java | 2 +- .../sample/integration/ServiceProperties.java | 2 +- 90 files changed, 205 insertions(+), 196 deletions(-) rename spring-zero-core/src/main/java/org/springframework/zero/context/{annotation => condition}/AbstractOnBeanCondition.java (99%) rename spring-zero-core/src/main/java/org/springframework/zero/context/{annotation => condition}/ConditionLogUtils.java (96%) rename spring-zero-core/src/main/java/org/springframework/zero/context/{annotation => condition}/ConditionalOnBean.java (97%) rename spring-zero-core/src/main/java/org/springframework/zero/context/{annotation => condition}/ConditionalOnClass.java (96%) rename spring-zero-core/src/main/java/org/springframework/zero/context/{annotation => condition}/ConditionalOnExpression.java (95%) rename spring-zero-core/src/main/java/org/springframework/zero/context/{annotation => condition}/ConditionalOnMissingBean.java (97%) rename spring-zero-core/src/main/java/org/springframework/zero/context/{annotation => condition}/ConditionalOnMissingClass.java (96%) rename spring-zero-core/src/main/java/org/springframework/zero/context/{annotation => condition}/ConditionalOnNotWebApplication.java (95%) rename spring-zero-core/src/main/java/org/springframework/zero/context/{annotation => condition}/ConditionalOnResource.java (96%) rename spring-zero-core/src/main/java/org/springframework/zero/context/{annotation => condition}/ConditionalOnWebApplication.java (95%) rename spring-zero-core/src/main/java/org/springframework/zero/context/{annotation => condition}/OnBeanCondition.java (94%) rename spring-zero-core/src/main/java/org/springframework/zero/context/{annotation => condition}/OnClassCondition.java (98%) rename spring-zero-core/src/main/java/org/springframework/zero/context/{annotation => condition}/OnExpressionCondition.java (98%) rename spring-zero-core/src/main/java/org/springframework/zero/context/{annotation => condition}/OnMissingBeanCondition.java (95%) rename spring-zero-core/src/main/java/org/springframework/zero/context/{annotation => condition}/OnMissingClassCondition.java (98%) rename spring-zero-core/src/main/java/org/springframework/zero/context/{annotation => condition}/OnNotWebApplicationCondition.java (97%) rename spring-zero-core/src/main/java/org/springframework/zero/context/{annotation => condition}/OnResourceCondition.java (98%) rename spring-zero-core/src/main/java/org/springframework/zero/context/{annotation => condition}/OnWebApplicationCondition.java (97%) rename spring-zero-core/src/main/java/org/springframework/zero/{properties => context/embedded}/ServerProperties.java (56%) rename spring-zero-core/src/main/java/org/springframework/zero/context/{annotation => properties}/ConfigurationProperties.java (95%) rename spring-zero-core/src/main/java/org/springframework/zero/context/{annotation => properties}/ConfigurationPropertiesBindingConfiguration.java (93%) rename spring-zero-core/src/main/java/org/springframework/zero/context/{annotation/PropertySourcesBindingPostProcessor.java => properties/ConfigurationPropertiesBindingPostProcessor.java} (95%) rename spring-zero-core/src/main/java/org/springframework/zero/context/{annotation => properties}/EnableConfigurationProperties.java (96%) rename spring-zero-core/src/main/java/org/springframework/zero/context/{annotation => properties}/EnableConfigurationPropertiesImportSelector.java (96%) rename spring-zero-core/src/test/java/org/springframework/zero/context/{annotation => condition}/AssertMissingBean.java (93%) rename spring-zero-core/src/test/java/org/springframework/zero/context/{annotation => condition}/AssertMissingBeanCondition.java (92%) rename spring-zero-core/src/test/java/org/springframework/zero/context/{annotation => condition}/NotWebApplicationConditionTests.java (89%) rename spring-zero-core/src/test/java/org/springframework/zero/context/{annotation => condition}/OnBeanConditionTests.java (96%) rename spring-zero-core/src/test/java/org/springframework/zero/context/{annotation => condition}/OnClassConditionTests.java (93%) rename spring-zero-core/src/test/java/org/springframework/zero/context/{annotation => condition}/OnExpressionConditionTests.java (93%) rename spring-zero-core/src/test/java/org/springframework/zero/context/{annotation => condition}/OnMissingBeanConditionTests.java (95%) rename spring-zero-core/src/test/java/org/springframework/zero/context/{annotation => condition}/OnMissingClassConditionTests.java (92%) rename spring-zero-core/src/test/java/org/springframework/zero/context/{annotation => condition}/OnResourceConditionTests.java (93%) rename spring-zero-core/src/test/java/org/springframework/zero/context/{annotation => condition}/WebApplicationConditionTests.java (90%) rename spring-zero-core/src/test/java/org/springframework/zero/{properties => context/embedded}/ServerPropertiesTests.java (93%) rename spring-zero-core/src/test/java/org/springframework/zero/context/{annotation => properties}/EnableConfigurationPropertiesTests.java (96%) rename spring-zero-core/src/test/resources/org/springframework/zero/context/{annotation => }/foo.xml (100%) rename spring-zero-core/src/test/resources/org/springframework/zero/context/{annotation => properties}/testProperties.xml (76%) diff --git a/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/autoconfigure/AuditAutoConfiguration.java b/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/autoconfigure/AuditAutoConfiguration.java index 684c59fa10..9f116f61d8 100644 --- a/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/autoconfigure/AuditAutoConfiguration.java +++ b/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/autoconfigure/AuditAutoConfiguration.java @@ -25,9 +25,9 @@ import org.springframework.zero.actuate.audit.InMemoryAuditEventRepository; import org.springframework.zero.actuate.audit.listener.AuditListener; import org.springframework.zero.actuate.security.AuthenticationAuditListener; import org.springframework.zero.actuate.security.AuthorizationAuditListener; -import org.springframework.zero.context.annotation.ConditionalOnClass; -import org.springframework.zero.context.annotation.ConditionalOnMissingBean; import org.springframework.zero.context.annotation.EnableAutoConfiguration; +import org.springframework.zero.context.condition.ConditionalOnClass; +import org.springframework.zero.context.condition.ConditionalOnMissingBean; /** * {@link EnableAutoConfiguration Auto-configuration} for {@link AuditEvent}s. diff --git a/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/autoconfigure/EndpointAutoConfiguration.java b/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/autoconfigure/EndpointAutoConfiguration.java index 83c6f531f7..0a6eb7f392 100644 --- a/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/autoconfigure/EndpointAutoConfiguration.java +++ b/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/autoconfigure/EndpointAutoConfiguration.java @@ -45,8 +45,8 @@ import org.springframework.zero.actuate.metrics.MetricRepository; import org.springframework.zero.actuate.trace.InMemoryTraceRepository; import org.springframework.zero.actuate.trace.TraceRepository; import org.springframework.zero.bind.PropertiesConfigurationFactory; -import org.springframework.zero.context.annotation.ConditionalOnMissingBean; import org.springframework.zero.context.annotation.EnableAutoConfiguration; +import org.springframework.zero.context.condition.ConditionalOnMissingBean; /** * {@link EnableAutoConfiguration Auto-configuration} for common management diff --git a/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/autoconfigure/EndpointWebMvcAutoConfiguration.java b/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/autoconfigure/EndpointWebMvcAutoConfiguration.java index e2c93c3780..10a6e439b1 100644 --- a/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/autoconfigure/EndpointWebMvcAutoConfiguration.java +++ b/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/autoconfigure/EndpointWebMvcAutoConfiguration.java @@ -39,11 +39,11 @@ import org.springframework.zero.autoconfigure.PropertyPlaceholderAutoConfigurati import org.springframework.zero.autoconfigure.web.EmbeddedServletContainerAutoConfiguration; import org.springframework.zero.autoconfigure.web.WebMvcAutoConfiguration; import org.springframework.zero.context.annotation.AutoConfigureAfter; -import org.springframework.zero.context.annotation.ConditionalOnClass; -import org.springframework.zero.context.annotation.ConditionalOnMissingBean; import org.springframework.zero.context.annotation.EnableAutoConfiguration; +import org.springframework.zero.context.condition.ConditionalOnClass; +import org.springframework.zero.context.condition.ConditionalOnMissingBean; import org.springframework.zero.context.embedded.AnnotationConfigEmbeddedWebApplicationContext; -import org.springframework.zero.properties.ServerProperties; +import org.springframework.zero.context.embedded.ServerProperties; /** * {@link EnableAutoConfiguration Auto-configuration} to enable Spring MVC to handle diff --git a/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/autoconfigure/EndpointWebMvcChildContextConfiguration.java b/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/autoconfigure/EndpointWebMvcChildContextConfiguration.java index 4f65cc2d65..067f94c6b2 100644 --- a/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/autoconfigure/EndpointWebMvcChildContextConfiguration.java +++ b/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/autoconfigure/EndpointWebMvcChildContextConfiguration.java @@ -29,8 +29,8 @@ import org.springframework.web.servlet.HandlerMapping; import org.springframework.zero.actuate.endpoint.mvc.EndpointHandlerAdapter; import org.springframework.zero.actuate.endpoint.mvc.EndpointHandlerMapping; import org.springframework.zero.actuate.properties.ManagementServerProperties; -import org.springframework.zero.context.annotation.ConditionalOnBean; -import org.springframework.zero.context.annotation.ConditionalOnClass; +import org.springframework.zero.context.condition.ConditionalOnBean; +import org.springframework.zero.context.condition.ConditionalOnClass; import org.springframework.zero.context.embedded.ConfigurableEmbeddedServletContainerFactory; import org.springframework.zero.context.embedded.EmbeddedServletContainer; import org.springframework.zero.context.embedded.EmbeddedServletContainerCustomizer; diff --git a/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/autoconfigure/ErrorMvcAutoConfiguration.java b/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/autoconfigure/ErrorMvcAutoConfiguration.java index ff9a434384..4e58c8f91f 100644 --- a/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/autoconfigure/ErrorMvcAutoConfiguration.java +++ b/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/autoconfigure/ErrorMvcAutoConfiguration.java @@ -23,9 +23,9 @@ import org.springframework.context.annotation.Bean; import org.springframework.web.servlet.DispatcherServlet; import org.springframework.zero.actuate.web.BasicErrorController; import org.springframework.zero.actuate.web.ErrorController; -import org.springframework.zero.context.annotation.ConditionalOnClass; -import org.springframework.zero.context.annotation.ConditionalOnMissingBean; import org.springframework.zero.context.annotation.EnableAutoConfiguration; +import org.springframework.zero.context.condition.ConditionalOnClass; +import org.springframework.zero.context.condition.ConditionalOnMissingBean; import org.springframework.zero.context.embedded.ConfigurableEmbeddedServletContainerFactory; import org.springframework.zero.context.embedded.EmbeddedServletContainerCustomizer; import org.springframework.zero.context.embedded.ErrorPage; diff --git a/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/autoconfigure/ManagementServerPropertiesAutoConfiguration.java b/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/autoconfigure/ManagementServerPropertiesAutoConfiguration.java index 8c69dd23d9..6276e1fce3 100644 --- a/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/autoconfigure/ManagementServerPropertiesAutoConfiguration.java +++ b/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/autoconfigure/ManagementServerPropertiesAutoConfiguration.java @@ -20,9 +20,9 @@ import org.springframework.context.annotation.Configuration; import org.springframework.zero.actuate.properties.ManagementServerProperties; import org.springframework.zero.autoconfigure.web.ServerPropertiesAutoConfiguration; import org.springframework.zero.context.annotation.AutoConfigureAfter; -import org.springframework.zero.context.annotation.ConditionalOnMissingBean; import org.springframework.zero.context.annotation.EnableAutoConfiguration; -import org.springframework.zero.context.annotation.EnableConfigurationProperties; +import org.springframework.zero.context.condition.ConditionalOnMissingBean; +import org.springframework.zero.context.properties.EnableConfigurationProperties; /** * {@link EnableAutoConfiguration Auto-configuration} for the diff --git a/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/autoconfigure/MetricFilterAutoConfiguration.java b/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/autoconfigure/MetricFilterAutoConfiguration.java index 915683bc27..ffac0ce773 100644 --- a/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/autoconfigure/MetricFilterAutoConfiguration.java +++ b/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/autoconfigure/MetricFilterAutoConfiguration.java @@ -38,9 +38,9 @@ import org.springframework.web.util.UrlPathHelper; import org.springframework.zero.actuate.metrics.CounterService; import org.springframework.zero.actuate.metrics.GaugeService; import org.springframework.zero.context.annotation.AutoConfigureAfter; -import org.springframework.zero.context.annotation.ConditionalOnBean; -import org.springframework.zero.context.annotation.ConditionalOnClass; import org.springframework.zero.context.annotation.EnableAutoConfiguration; +import org.springframework.zero.context.condition.ConditionalOnBean; +import org.springframework.zero.context.condition.ConditionalOnClass; /** * {@link EnableAutoConfiguration Auto-configuration} that records Servlet interactions diff --git a/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/autoconfigure/MetricRepositoryAutoConfiguration.java b/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/autoconfigure/MetricRepositoryAutoConfiguration.java index be5764a8de..198a5c2d96 100644 --- a/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/autoconfigure/MetricRepositoryAutoConfiguration.java +++ b/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/autoconfigure/MetricRepositoryAutoConfiguration.java @@ -24,8 +24,8 @@ import org.springframework.zero.actuate.metrics.DefaultGaugeService; import org.springframework.zero.actuate.metrics.GaugeService; import org.springframework.zero.actuate.metrics.InMemoryMetricRepository; import org.springframework.zero.actuate.metrics.MetricRepository; -import org.springframework.zero.context.annotation.ConditionalOnMissingBean; import org.springframework.zero.context.annotation.EnableAutoConfiguration; +import org.springframework.zero.context.condition.ConditionalOnMissingBean; /** * {@link EnableAutoConfiguration Auto-configuration} for metrics services. diff --git a/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/autoconfigure/SecurityAutoConfiguration.java b/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/autoconfigure/SecurityAutoConfiguration.java index 0b4943065f..0adf656542 100644 --- a/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/autoconfigure/SecurityAutoConfiguration.java +++ b/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/autoconfigure/SecurityAutoConfiguration.java @@ -41,10 +41,10 @@ import org.springframework.zero.actuate.endpoint.Endpoint; import org.springframework.zero.actuate.endpoint.mvc.EndpointHandlerMapping; import org.springframework.zero.actuate.properties.SecurityProperties; import org.springframework.zero.actuate.web.ErrorController; -import org.springframework.zero.context.annotation.ConditionalOnClass; -import org.springframework.zero.context.annotation.ConditionalOnMissingBean; import org.springframework.zero.context.annotation.EnableAutoConfiguration; -import org.springframework.zero.context.annotation.EnableConfigurationProperties; +import org.springframework.zero.context.condition.ConditionalOnClass; +import org.springframework.zero.context.condition.ConditionalOnMissingBean; +import org.springframework.zero.context.properties.EnableConfigurationProperties; /** * {@link EnableAutoConfiguration Auto-configuration} for security of a web application or diff --git a/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/autoconfigure/TraceRepositoryAutoConfiguration.java b/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/autoconfigure/TraceRepositoryAutoConfiguration.java index d391aef36b..c3df801e05 100644 --- a/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/autoconfigure/TraceRepositoryAutoConfiguration.java +++ b/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/autoconfigure/TraceRepositoryAutoConfiguration.java @@ -20,8 +20,8 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.zero.actuate.trace.InMemoryTraceRepository; import org.springframework.zero.actuate.trace.TraceRepository; -import org.springframework.zero.context.annotation.ConditionalOnMissingBean; import org.springframework.zero.context.annotation.EnableAutoConfiguration; +import org.springframework.zero.context.condition.ConditionalOnMissingBean; /** * {@link EnableAutoConfiguration Auto-configuration} for {@link TraceRepository tracing}. diff --git a/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/autoconfigure/TraceWebFilterAutoConfiguration.java b/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/autoconfigure/TraceWebFilterAutoConfiguration.java index d826886aae..d11b986fe0 100644 --- a/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/autoconfigure/TraceWebFilterAutoConfiguration.java +++ b/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/autoconfigure/TraceWebFilterAutoConfiguration.java @@ -25,8 +25,8 @@ import org.springframework.web.servlet.DispatcherServlet; import org.springframework.zero.actuate.trace.TraceRepository; import org.springframework.zero.actuate.trace.WebRequestTraceFilter; import org.springframework.zero.context.annotation.AutoConfigureAfter; -import org.springframework.zero.context.annotation.ConditionalOnClass; import org.springframework.zero.context.annotation.EnableAutoConfiguration; +import org.springframework.zero.context.condition.ConditionalOnClass; /** * {@link EnableAutoConfiguration Auto-configuration} for {@link WebRequestTraceFilter diff --git a/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/endpoint/BeansEndpoint.java b/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/endpoint/BeansEndpoint.java index 8669b4074c..c23bd42cff 100644 --- a/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/endpoint/BeansEndpoint.java +++ b/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/endpoint/BeansEndpoint.java @@ -22,7 +22,7 @@ import org.springframework.context.ApplicationContextAware; import org.springframework.context.support.LiveBeansView; import org.springframework.core.env.Environment; import org.springframework.http.MediaType; -import org.springframework.zero.context.annotation.ConfigurationProperties; +import org.springframework.zero.context.properties.ConfigurationProperties; /** * Exposes JSON view of Spring beans. If the {@link Environment} contains a key setting diff --git a/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/endpoint/DumpEndpoint.java b/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/endpoint/DumpEndpoint.java index 72c0265f98..d7a809513a 100644 --- a/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/endpoint/DumpEndpoint.java +++ b/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/endpoint/DumpEndpoint.java @@ -21,7 +21,7 @@ import java.lang.management.ThreadInfo; import java.util.Arrays; import java.util.List; -import org.springframework.zero.context.annotation.ConfigurationProperties; +import org.springframework.zero.context.properties.ConfigurationProperties; /** * {@link Endpoint} to expose thread info. diff --git a/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/endpoint/EnvironmentEndpoint.java b/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/endpoint/EnvironmentEndpoint.java index 4c9eb08f0d..5dd0f88a71 100644 --- a/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/endpoint/EnvironmentEndpoint.java +++ b/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/endpoint/EnvironmentEndpoint.java @@ -25,7 +25,7 @@ import org.springframework.core.env.EnumerablePropertySource; import org.springframework.core.env.Environment; import org.springframework.core.env.PropertySource; import org.springframework.core.env.StandardEnvironment; -import org.springframework.zero.context.annotation.ConfigurationProperties; +import org.springframework.zero.context.properties.ConfigurationProperties; /** * {@link Endpoint} to expose {@link ConfigurableEnvironment environment} information. diff --git a/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/endpoint/HealthEndpoint.java b/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/endpoint/HealthEndpoint.java index 62d25899ea..17cb85ca32 100644 --- a/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/endpoint/HealthEndpoint.java +++ b/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/endpoint/HealthEndpoint.java @@ -18,7 +18,7 @@ package org.springframework.zero.actuate.endpoint; import org.springframework.util.Assert; import org.springframework.zero.actuate.health.HealthIndicator; -import org.springframework.zero.context.annotation.ConfigurationProperties; +import org.springframework.zero.context.properties.ConfigurationProperties; /** * {@link Endpoint} to expose application health. diff --git a/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/endpoint/InfoEndpoint.java b/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/endpoint/InfoEndpoint.java index 958c64a2dd..4545b89341 100644 --- a/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/endpoint/InfoEndpoint.java +++ b/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/endpoint/InfoEndpoint.java @@ -21,7 +21,7 @@ import java.util.LinkedHashMap; import java.util.Map; import org.springframework.util.Assert; -import org.springframework.zero.context.annotation.ConfigurationProperties; +import org.springframework.zero.context.properties.ConfigurationProperties; /** * {@link Endpoint} to expose arbitrary application information. diff --git a/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/endpoint/MetricsEndpoint.java b/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/endpoint/MetricsEndpoint.java index 91431e8185..799222f350 100644 --- a/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/endpoint/MetricsEndpoint.java +++ b/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/endpoint/MetricsEndpoint.java @@ -21,7 +21,7 @@ import java.util.Map; import org.springframework.util.Assert; import org.springframework.zero.actuate.metrics.Metric; -import org.springframework.zero.context.annotation.ConfigurationProperties; +import org.springframework.zero.context.properties.ConfigurationProperties; /** * {@link Endpoint} to expose {@link PublicMetrics}. diff --git a/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/endpoint/ShutdownEndpoint.java b/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/endpoint/ShutdownEndpoint.java index 832c81a8eb..b7816fac96 100644 --- a/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/endpoint/ShutdownEndpoint.java +++ b/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/endpoint/ShutdownEndpoint.java @@ -25,7 +25,7 @@ import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContextAware; import org.springframework.context.ConfigurableApplicationContext; import org.springframework.zero.actuate.properties.ManagementServerProperties; -import org.springframework.zero.context.annotation.ConfigurationProperties; +import org.springframework.zero.context.properties.ConfigurationProperties; /** * {@link ActionEndpoint} to shutdown the {@link ApplicationContext}. diff --git a/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/endpoint/TraceEndpoint.java b/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/endpoint/TraceEndpoint.java index 8321d4ea0d..a471f2eb9c 100644 --- a/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/endpoint/TraceEndpoint.java +++ b/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/endpoint/TraceEndpoint.java @@ -21,7 +21,7 @@ import java.util.List; import org.springframework.util.Assert; import org.springframework.zero.actuate.trace.Trace; import org.springframework.zero.actuate.trace.TraceRepository; -import org.springframework.zero.context.annotation.ConfigurationProperties; +import org.springframework.zero.context.properties.ConfigurationProperties; /** * {@link Endpoint} to expose {@link Trace} information. diff --git a/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/fixme/ManagementServerConfiguration.java b/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/fixme/ManagementServerConfiguration.java index 3827688050..777af6fe6f 100644 --- a/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/fixme/ManagementServerConfiguration.java +++ b/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/fixme/ManagementServerConfiguration.java @@ -38,8 +38,8 @@ import org.springframework.web.servlet.DispatcherServlet; import org.springframework.web.servlet.config.annotation.EnableWebMvc; import org.springframework.zero.actuate.properties.ManagementServerProperties; import org.springframework.zero.actuate.web.BasicErrorController; -import org.springframework.zero.context.annotation.ConditionalOnBean; -import org.springframework.zero.context.annotation.ConditionalOnClass; +import org.springframework.zero.context.condition.ConditionalOnBean; +import org.springframework.zero.context.condition.ConditionalOnClass; import org.springframework.zero.context.embedded.ConfigurableEmbeddedServletContainerFactory; import org.springframework.zero.context.embedded.EmbeddedServletContainerCustomizer; import org.springframework.zero.context.embedded.EmbeddedServletContainerFactory; diff --git a/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/properties/ManagementServerProperties.java b/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/properties/ManagementServerProperties.java index 896d79f9d3..8bc21dcc3a 100644 --- a/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/properties/ManagementServerProperties.java +++ b/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/properties/ManagementServerProperties.java @@ -20,8 +20,8 @@ import java.net.InetAddress; import javax.validation.constraints.NotNull; -import org.springframework.zero.context.annotation.ConfigurationProperties; -import org.springframework.zero.properties.ServerProperties; +import org.springframework.zero.context.embedded.ServerProperties; +import org.springframework.zero.context.properties.ConfigurationProperties; /** * Properties for the management server (e.g. port and path settings). diff --git a/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/properties/SecurityProperties.java b/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/properties/SecurityProperties.java index ad397021d0..d2ec43191d 100644 --- a/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/properties/SecurityProperties.java +++ b/spring-zero-actuator/src/main/java/org/springframework/zero/actuate/properties/SecurityProperties.java @@ -17,7 +17,7 @@ package org.springframework.zero.actuate.properties; import org.springframework.security.config.annotation.web.configurers.SessionCreationPolicy; -import org.springframework.zero.context.annotation.ConfigurationProperties; +import org.springframework.zero.context.properties.ConfigurationProperties; /** * Properties for the security aspects of an application. diff --git a/spring-zero-actuator/src/test/java/org/springframework/zero/actuate/endpoint/BeansEndpointTests.java b/spring-zero-actuator/src/test/java/org/springframework/zero/actuate/endpoint/BeansEndpointTests.java index 39b85d54cb..e921cc3c0a 100644 --- a/spring-zero-actuator/src/test/java/org/springframework/zero/actuate/endpoint/BeansEndpointTests.java +++ b/spring-zero-actuator/src/test/java/org/springframework/zero/actuate/endpoint/BeansEndpointTests.java @@ -21,7 +21,7 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.http.MediaType; import org.springframework.zero.actuate.endpoint.BeansEndpoint; -import org.springframework.zero.context.annotation.EnableConfigurationProperties; +import org.springframework.zero.context.properties.EnableConfigurationProperties; import static org.hamcrest.Matchers.containsString; import static org.junit.Assert.assertThat; diff --git a/spring-zero-actuator/src/test/java/org/springframework/zero/actuate/endpoint/DumpEndpointTests.java b/spring-zero-actuator/src/test/java/org/springframework/zero/actuate/endpoint/DumpEndpointTests.java index 64a5c8811a..a48fe34f97 100644 --- a/spring-zero-actuator/src/test/java/org/springframework/zero/actuate/endpoint/DumpEndpointTests.java +++ b/spring-zero-actuator/src/test/java/org/springframework/zero/actuate/endpoint/DumpEndpointTests.java @@ -23,7 +23,7 @@ import org.junit.Test; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.zero.actuate.endpoint.DumpEndpoint; -import org.springframework.zero.context.annotation.EnableConfigurationProperties; +import org.springframework.zero.context.properties.EnableConfigurationProperties; import static org.hamcrest.Matchers.greaterThan; import static org.junit.Assert.assertThat; diff --git a/spring-zero-actuator/src/test/java/org/springframework/zero/actuate/endpoint/EnvironmentEndpointTests.java b/spring-zero-actuator/src/test/java/org/springframework/zero/actuate/endpoint/EnvironmentEndpointTests.java index 577e34920c..bd88a88a86 100644 --- a/spring-zero-actuator/src/test/java/org/springframework/zero/actuate/endpoint/EnvironmentEndpointTests.java +++ b/spring-zero-actuator/src/test/java/org/springframework/zero/actuate/endpoint/EnvironmentEndpointTests.java @@ -20,7 +20,7 @@ import org.junit.Test; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.zero.actuate.endpoint.EnvironmentEndpoint; -import org.springframework.zero.context.annotation.EnableConfigurationProperties; +import org.springframework.zero.context.properties.EnableConfigurationProperties; import static org.hamcrest.Matchers.greaterThan; import static org.junit.Assert.assertThat; diff --git a/spring-zero-actuator/src/test/java/org/springframework/zero/actuate/endpoint/HealthEndpointTests.java b/spring-zero-actuator/src/test/java/org/springframework/zero/actuate/endpoint/HealthEndpointTests.java index bff7beb136..cc7f70b7c2 100644 --- a/spring-zero-actuator/src/test/java/org/springframework/zero/actuate/endpoint/HealthEndpointTests.java +++ b/spring-zero-actuator/src/test/java/org/springframework/zero/actuate/endpoint/HealthEndpointTests.java @@ -21,7 +21,7 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.zero.actuate.endpoint.HealthEndpoint; import org.springframework.zero.actuate.health.HealthIndicator; -import org.springframework.zero.context.annotation.EnableConfigurationProperties; +import org.springframework.zero.context.properties.EnableConfigurationProperties; import static org.hamcrest.Matchers.equalTo; import static org.junit.Assert.assertThat; diff --git a/spring-zero-actuator/src/test/java/org/springframework/zero/actuate/endpoint/InfoEndpointTests.java b/spring-zero-actuator/src/test/java/org/springframework/zero/actuate/endpoint/InfoEndpointTests.java index 9268691078..eb6a131933 100644 --- a/spring-zero-actuator/src/test/java/org/springframework/zero/actuate/endpoint/InfoEndpointTests.java +++ b/spring-zero-actuator/src/test/java/org/springframework/zero/actuate/endpoint/InfoEndpointTests.java @@ -22,7 +22,7 @@ import org.junit.Test; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.zero.actuate.endpoint.InfoEndpoint; -import org.springframework.zero.context.annotation.EnableConfigurationProperties; +import org.springframework.zero.context.properties.EnableConfigurationProperties; import static org.hamcrest.Matchers.equalTo; import static org.junit.Assert.assertThat; diff --git a/spring-zero-actuator/src/test/java/org/springframework/zero/actuate/endpoint/MetricsEndpointTests.java b/spring-zero-actuator/src/test/java/org/springframework/zero/actuate/endpoint/MetricsEndpointTests.java index e23cc76d69..a9c5aa4f4c 100644 --- a/spring-zero-actuator/src/test/java/org/springframework/zero/actuate/endpoint/MetricsEndpointTests.java +++ b/spring-zero-actuator/src/test/java/org/springframework/zero/actuate/endpoint/MetricsEndpointTests.java @@ -25,7 +25,7 @@ import org.springframework.context.annotation.Configuration; import org.springframework.zero.actuate.endpoint.MetricsEndpoint; import org.springframework.zero.actuate.endpoint.PublicMetrics; import org.springframework.zero.actuate.metrics.Metric; -import org.springframework.zero.context.annotation.EnableConfigurationProperties; +import org.springframework.zero.context.properties.EnableConfigurationProperties; import static org.hamcrest.Matchers.equalTo; import static org.junit.Assert.assertThat; diff --git a/spring-zero-actuator/src/test/java/org/springframework/zero/actuate/endpoint/ShutdownEndpointTests.java b/spring-zero-actuator/src/test/java/org/springframework/zero/actuate/endpoint/ShutdownEndpointTests.java index af005cf1e4..e97d2285bd 100644 --- a/spring-zero-actuator/src/test/java/org/springframework/zero/actuate/endpoint/ShutdownEndpointTests.java +++ b/spring-zero-actuator/src/test/java/org/springframework/zero/actuate/endpoint/ShutdownEndpointTests.java @@ -21,7 +21,7 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.zero.actuate.endpoint.ShutdownEndpoint; import org.springframework.zero.actuate.properties.ManagementServerProperties; -import org.springframework.zero.context.annotation.EnableConfigurationProperties; +import org.springframework.zero.context.properties.EnableConfigurationProperties; import static org.hamcrest.Matchers.startsWith; import static org.junit.Assert.assertFalse; diff --git a/spring-zero-actuator/src/test/java/org/springframework/zero/actuate/endpoint/TraceEndpointTests.java b/spring-zero-actuator/src/test/java/org/springframework/zero/actuate/endpoint/TraceEndpointTests.java index 69e88c0315..e8691659c2 100644 --- a/spring-zero-actuator/src/test/java/org/springframework/zero/actuate/endpoint/TraceEndpointTests.java +++ b/spring-zero-actuator/src/test/java/org/springframework/zero/actuate/endpoint/TraceEndpointTests.java @@ -25,7 +25,7 @@ import org.springframework.zero.actuate.endpoint.TraceEndpoint; import org.springframework.zero.actuate.trace.InMemoryTraceRepository; import org.springframework.zero.actuate.trace.Trace; import org.springframework.zero.actuate.trace.TraceRepository; -import org.springframework.zero.context.annotation.EnableConfigurationProperties; +import org.springframework.zero.context.properties.EnableConfigurationProperties; import static org.hamcrest.Matchers.equalTo; import static org.junit.Assert.assertThat; diff --git a/spring-zero-autoconfigure/src/main/java/org/springframework/zero/autoconfigure/MessageSourceAutoConfiguration.java b/spring-zero-autoconfigure/src/main/java/org/springframework/zero/autoconfigure/MessageSourceAutoConfiguration.java index a065538661..9b12d31318 100644 --- a/spring-zero-autoconfigure/src/main/java/org/springframework/zero/autoconfigure/MessageSourceAutoConfiguration.java +++ b/spring-zero-autoconfigure/src/main/java/org/springframework/zero/autoconfigure/MessageSourceAutoConfiguration.java @@ -23,8 +23,8 @@ import org.springframework.context.annotation.Configuration; import org.springframework.context.support.ResourceBundleMessageSource; import org.springframework.core.Ordered; import org.springframework.core.annotation.Order; -import org.springframework.zero.context.annotation.ConditionalOnMissingBean; import org.springframework.zero.context.annotation.EnableAutoConfiguration; +import org.springframework.zero.context.condition.ConditionalOnMissingBean; /** * {@link EnableAutoConfiguration Auto-configuration} for {@link MessageSource}. diff --git a/spring-zero-autoconfigure/src/main/java/org/springframework/zero/autoconfigure/PropertyPlaceholderAutoConfiguration.java b/spring-zero-autoconfigure/src/main/java/org/springframework/zero/autoconfigure/PropertyPlaceholderAutoConfiguration.java index b766ab7273..f30992d2f0 100644 --- a/spring-zero-autoconfigure/src/main/java/org/springframework/zero/autoconfigure/PropertyPlaceholderAutoConfiguration.java +++ b/spring-zero-autoconfigure/src/main/java/org/springframework/zero/autoconfigure/PropertyPlaceholderAutoConfiguration.java @@ -22,8 +22,8 @@ import org.springframework.context.annotation.Configuration; import org.springframework.context.support.PropertySourcesPlaceholderConfigurer; import org.springframework.core.Ordered; import org.springframework.core.annotation.Order; -import org.springframework.zero.context.annotation.ConditionalOnMissingBean; import org.springframework.zero.context.annotation.EnableAutoConfiguration; +import org.springframework.zero.context.condition.ConditionalOnMissingBean; /** * {@link EnableAutoConfiguration Auto-configuration} for diff --git a/spring-zero-autoconfigure/src/main/java/org/springframework/zero/autoconfigure/batch/BatchAutoConfiguration.java b/spring-zero-autoconfigure/src/main/java/org/springframework/zero/autoconfigure/batch/BatchAutoConfiguration.java index e103fe828b..6619df74a3 100644 --- a/spring-zero-autoconfigure/src/main/java/org/springframework/zero/autoconfigure/batch/BatchAutoConfiguration.java +++ b/spring-zero-autoconfigure/src/main/java/org/springframework/zero/autoconfigure/batch/BatchAutoConfiguration.java @@ -21,10 +21,10 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.zero.CommandLineRunner; import org.springframework.zero.ExitCodeGenerator; -import org.springframework.zero.context.annotation.ConditionalOnBean; -import org.springframework.zero.context.annotation.ConditionalOnClass; -import org.springframework.zero.context.annotation.ConditionalOnMissingBean; import org.springframework.zero.context.annotation.EnableAutoConfiguration; +import org.springframework.zero.context.condition.ConditionalOnBean; +import org.springframework.zero.context.condition.ConditionalOnClass; +import org.springframework.zero.context.condition.ConditionalOnMissingBean; /** * {@link EnableAutoConfiguration Auto-configuration} for Spring Batch. diff --git a/spring-zero-autoconfigure/src/main/java/org/springframework/zero/autoconfigure/data/JpaRepositoriesAutoConfiguration.java b/spring-zero-autoconfigure/src/main/java/org/springframework/zero/autoconfigure/data/JpaRepositoriesAutoConfiguration.java index cc676d0b3c..bd0c79b354 100644 --- a/spring-zero-autoconfigure/src/main/java/org/springframework/zero/autoconfigure/data/JpaRepositoriesAutoConfiguration.java +++ b/spring-zero-autoconfigure/src/main/java/org/springframework/zero/autoconfigure/data/JpaRepositoriesAutoConfiguration.java @@ -21,9 +21,9 @@ import org.springframework.context.annotation.Import; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.config.EnableJpaRepositories; import org.springframework.data.jpa.repository.support.JpaRepositoryFactoryBean; -import org.springframework.zero.context.annotation.ConditionalOnClass; -import org.springframework.zero.context.annotation.ConditionalOnMissingBean; import org.springframework.zero.context.annotation.EnableAutoConfiguration; +import org.springframework.zero.context.condition.ConditionalOnClass; +import org.springframework.zero.context.condition.ConditionalOnMissingBean; /** * {@link EnableAutoConfiguration Auto-configuration} for Spring Data's JPA Repositories. diff --git a/spring-zero-autoconfigure/src/main/java/org/springframework/zero/autoconfigure/jdbc/DataSourceAutoConfiguration.java b/spring-zero-autoconfigure/src/main/java/org/springframework/zero/autoconfigure/jdbc/DataSourceAutoConfiguration.java index fde6f45943..7ff79f7010 100644 --- a/spring-zero-autoconfigure/src/main/java/org/springframework/zero/autoconfigure/jdbc/DataSourceAutoConfiguration.java +++ b/spring-zero-autoconfigure/src/main/java/org/springframework/zero/autoconfigure/jdbc/DataSourceAutoConfiguration.java @@ -46,10 +46,10 @@ import org.springframework.jdbc.datasource.init.DatabasePopulatorUtils; import org.springframework.jdbc.datasource.init.ResourceDatabasePopulator; import org.springframework.util.ClassUtils; import org.springframework.util.StringUtils; -import org.springframework.zero.context.annotation.ConditionLogUtils; -import org.springframework.zero.context.annotation.ConditionalOnClass; -import org.springframework.zero.context.annotation.ConditionalOnMissingBean; import org.springframework.zero.context.annotation.EnableAutoConfiguration; +import org.springframework.zero.context.condition.ConditionLogUtils; +import org.springframework.zero.context.condition.ConditionalOnClass; +import org.springframework.zero.context.condition.ConditionalOnMissingBean; /** * {@link EnableAutoConfiguration Auto-configuration} for {@link DataSource}. diff --git a/spring-zero-autoconfigure/src/main/java/org/springframework/zero/autoconfigure/jdbc/DataSourceTransactionManagerAutoConfiguration.java b/spring-zero-autoconfigure/src/main/java/org/springframework/zero/autoconfigure/jdbc/DataSourceTransactionManagerAutoConfiguration.java index 3d45e73d02..0db0698806 100644 --- a/spring-zero-autoconfigure/src/main/java/org/springframework/zero/autoconfigure/jdbc/DataSourceTransactionManagerAutoConfiguration.java +++ b/spring-zero-autoconfigure/src/main/java/org/springframework/zero/autoconfigure/jdbc/DataSourceTransactionManagerAutoConfiguration.java @@ -25,10 +25,10 @@ import org.springframework.core.Ordered; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.datasource.DataSourceTransactionManager; import org.springframework.transaction.PlatformTransactionManager; -import org.springframework.zero.context.annotation.ConditionalOnBean; -import org.springframework.zero.context.annotation.ConditionalOnClass; -import org.springframework.zero.context.annotation.ConditionalOnMissingBean; import org.springframework.zero.context.annotation.EnableAutoConfiguration; +import org.springframework.zero.context.condition.ConditionalOnBean; +import org.springframework.zero.context.condition.ConditionalOnClass; +import org.springframework.zero.context.condition.ConditionalOnMissingBean; /** * {@link EnableAutoConfiguration Auto-configuration} for diff --git a/spring-zero-autoconfigure/src/main/java/org/springframework/zero/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.java b/spring-zero-autoconfigure/src/main/java/org/springframework/zero/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.java index db15240e52..a6fb34e73c 100644 --- a/spring-zero-autoconfigure/src/main/java/org/springframework/zero/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.java +++ b/spring-zero-autoconfigure/src/main/java/org/springframework/zero/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.java @@ -30,8 +30,8 @@ import org.springframework.orm.jpa.vendor.Database; import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter; import org.springframework.transaction.annotation.EnableTransactionManagement; import org.springframework.util.StringUtils; -import org.springframework.zero.context.annotation.ConditionalOnClass; import org.springframework.zero.context.annotation.EnableAutoConfiguration; +import org.springframework.zero.context.condition.ConditionalOnClass; /** * {@link EnableAutoConfiguration Auto-configuration} for Hibernate JPA. diff --git a/spring-zero-autoconfigure/src/main/java/org/springframework/zero/autoconfigure/orm/jpa/JpaAutoConfiguration.java b/spring-zero-autoconfigure/src/main/java/org/springframework/zero/autoconfigure/orm/jpa/JpaAutoConfiguration.java index 3b8d1e0a11..4047e8201b 100644 --- a/spring-zero-autoconfigure/src/main/java/org/springframework/zero/autoconfigure/orm/jpa/JpaAutoConfiguration.java +++ b/spring-zero-autoconfigure/src/main/java/org/springframework/zero/autoconfigure/orm/jpa/JpaAutoConfiguration.java @@ -36,9 +36,9 @@ import org.springframework.transaction.annotation.EnableTransactionManagement; import org.springframework.util.Assert; import org.springframework.zero.autoconfigure.AutoConfigurationUtils; import org.springframework.zero.autoconfigure.jdbc.EmbeddedDatabaseConfiguration; -import org.springframework.zero.context.annotation.ConditionalOnBean; -import org.springframework.zero.context.annotation.ConditionalOnClass; import org.springframework.zero.context.annotation.EnableAutoConfiguration; +import org.springframework.zero.context.condition.ConditionalOnBean; +import org.springframework.zero.context.condition.ConditionalOnClass; /** * Base {@link EnableAutoConfiguration Auto-configuration} for JPA. diff --git a/spring-zero-autoconfigure/src/main/java/org/springframework/zero/autoconfigure/thymeleaf/ThymeleafAutoConfiguration.java b/spring-zero-autoconfigure/src/main/java/org/springframework/zero/autoconfigure/thymeleaf/ThymeleafAutoConfiguration.java index c476e8d3df..15263e4518 100644 --- a/spring-zero-autoconfigure/src/main/java/org/springframework/zero/autoconfigure/thymeleaf/ThymeleafAutoConfiguration.java +++ b/spring-zero-autoconfigure/src/main/java/org/springframework/zero/autoconfigure/thymeleaf/ThymeleafAutoConfiguration.java @@ -33,10 +33,10 @@ import org.springframework.core.io.DefaultResourceLoader; import org.springframework.core.io.ResourceLoader; import org.springframework.zero.autoconfigure.web.WebMvcAutoConfiguration; import org.springframework.zero.context.annotation.AutoConfigureAfter; -import org.springframework.zero.context.annotation.ConditionalOnClass; -import org.springframework.zero.context.annotation.ConditionalOnMissingBean; -import org.springframework.zero.context.annotation.ConditionalOnMissingClass; import org.springframework.zero.context.annotation.EnableAutoConfiguration; +import org.springframework.zero.context.condition.ConditionalOnClass; +import org.springframework.zero.context.condition.ConditionalOnMissingBean; +import org.springframework.zero.context.condition.ConditionalOnMissingClass; import org.thymeleaf.TemplateProcessingParameters; import org.thymeleaf.resourceresolver.IResourceResolver; import org.thymeleaf.spring3.SpringTemplateEngine; diff --git a/spring-zero-autoconfigure/src/main/java/org/springframework/zero/autoconfigure/web/EmbeddedServletContainerAutoConfiguration.java b/spring-zero-autoconfigure/src/main/java/org/springframework/zero/autoconfigure/web/EmbeddedServletContainerAutoConfiguration.java index 06de4d1a13..2ff99895f0 100644 --- a/spring-zero-autoconfigure/src/main/java/org/springframework/zero/autoconfigure/web/EmbeddedServletContainerAutoConfiguration.java +++ b/spring-zero-autoconfigure/src/main/java/org/springframework/zero/autoconfigure/web/EmbeddedServletContainerAutoConfiguration.java @@ -26,9 +26,9 @@ import org.springframework.context.annotation.Configuration; import org.springframework.core.Ordered; import org.springframework.core.annotation.Order; import org.springframework.web.servlet.DispatcherServlet; -import org.springframework.zero.context.annotation.ConditionalOnClass; -import org.springframework.zero.context.annotation.ConditionalOnMissingBean; import org.springframework.zero.context.annotation.EnableAutoConfiguration; +import org.springframework.zero.context.condition.ConditionalOnClass; +import org.springframework.zero.context.condition.ConditionalOnMissingBean; import org.springframework.zero.context.embedded.EmbeddedServletContainerCustomizer; import org.springframework.zero.context.embedded.EmbeddedServletContainerCustomizerBeanPostProcessor; import org.springframework.zero.context.embedded.EmbeddedServletContainerFactory; diff --git a/spring-zero-autoconfigure/src/main/java/org/springframework/zero/autoconfigure/web/MultipartAutoConfiguration.java b/spring-zero-autoconfigure/src/main/java/org/springframework/zero/autoconfigure/web/MultipartAutoConfiguration.java index 416ded3432..56b955d5d7 100644 --- a/spring-zero-autoconfigure/src/main/java/org/springframework/zero/autoconfigure/web/MultipartAutoConfiguration.java +++ b/spring-zero-autoconfigure/src/main/java/org/springframework/zero/autoconfigure/web/MultipartAutoConfiguration.java @@ -22,9 +22,9 @@ import javax.servlet.Servlet; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.web.multipart.support.StandardServletMultipartResolver; -import org.springframework.zero.context.annotation.ConditionalOnBean; -import org.springframework.zero.context.annotation.ConditionalOnClass; import org.springframework.zero.context.annotation.EnableAutoConfiguration; +import org.springframework.zero.context.condition.ConditionalOnBean; +import org.springframework.zero.context.condition.ConditionalOnClass; import org.springframework.zero.context.embedded.EmbeddedWebApplicationContext; /** diff --git a/spring-zero-autoconfigure/src/main/java/org/springframework/zero/autoconfigure/web/ServerPropertiesAutoConfiguration.java b/spring-zero-autoconfigure/src/main/java/org/springframework/zero/autoconfigure/web/ServerPropertiesAutoConfiguration.java index d3a2a344ac..1a0e7c3c42 100644 --- a/spring-zero-autoconfigure/src/main/java/org/springframework/zero/autoconfigure/web/ServerPropertiesAutoConfiguration.java +++ b/spring-zero-autoconfigure/src/main/java/org/springframework/zero/autoconfigure/web/ServerPropertiesAutoConfiguration.java @@ -16,22 +16,19 @@ package org.springframework.zero.autoconfigure.web; -import org.apache.catalina.valves.AccessLogValve; -import org.apache.catalina.valves.RemoteIpValve; import org.springframework.beans.BeansException; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContextAware; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.util.Assert; import org.springframework.util.StringUtils; -import org.springframework.zero.context.annotation.ConditionalOnMissingBean; import org.springframework.zero.context.annotation.EnableAutoConfiguration; -import org.springframework.zero.context.annotation.EnableConfigurationProperties; +import org.springframework.zero.context.condition.ConditionalOnMissingBean; import org.springframework.zero.context.embedded.ConfigurableEmbeddedServletContainerFactory; import org.springframework.zero.context.embedded.EmbeddedServletContainerCustomizer; -import org.springframework.zero.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory; -import org.springframework.zero.properties.ServerProperties; -import org.springframework.zero.properties.ServerProperties.Tomcat; +import org.springframework.zero.context.embedded.ServerProperties; +import org.springframework.zero.context.properties.EnableConfigurationProperties; /** * {@link EnableAutoConfiguration Auto-configuration} that configures the @@ -42,8 +39,8 @@ import org.springframework.zero.properties.ServerProperties.Tomcat; */ @Configuration @EnableConfigurationProperties -public class ServerPropertiesAutoConfiguration implements - EmbeddedServletContainerCustomizer, ApplicationContextAware { +public class ServerPropertiesAutoConfiguration implements ApplicationContextAware, + EmbeddedServletContainerCustomizer { private ApplicationContext applicationContext; @@ -61,46 +58,12 @@ public class ServerPropertiesAutoConfiguration implements @Override public void customize(ConfigurableEmbeddedServletContainerFactory factory) { - - // Need to do a look up here to make it lazy - ServerProperties server = this.applicationContext.getBean(ServerProperties.class); - - factory.setPort(server.getPort()); - factory.setAddress(server.getAddress()); - factory.setContextPath(server.getContextPath()); - - if (factory instanceof TomcatEmbeddedServletContainerFactory) { - configureTomcat((TomcatEmbeddedServletContainerFactory) factory, server); - } - - } - - private void configureTomcat(TomcatEmbeddedServletContainerFactory tomcatFactory, - ServerProperties configuration) { - - Tomcat tomcat = configuration.getTomcat(); - if (tomcat.getBasedir() != null) { - tomcatFactory.setBaseDirectory(tomcat.getBasedir()); - } - - String remoteIpHeader = tomcat.getRemoteIpHeader(); - String protocolHeader = tomcat.getProtocolHeader(); - - if (StringUtils.hasText(remoteIpHeader) || StringUtils.hasText(protocolHeader)) { - RemoteIpValve valve = new RemoteIpValve(); - valve.setRemoteIpHeader(remoteIpHeader); - valve.setProtocolHeader(protocolHeader); - tomcatFactory.addContextValves(valve); - } - - String pattern = tomcat.getAccessLogPattern(); - if (pattern != null) { - AccessLogValve valve = new AccessLogValve(); - valve.setPattern(pattern); - valve.setSuffix(".log"); - tomcatFactory.addContextValves(valve); - } - + String[] serverPropertiesBeans = this.applicationContext + .getBeanNamesForType(ServerProperties.class); + Assert.state( + serverPropertiesBeans.length == 1, + "Multiple ServerProperties beans registered " + + StringUtils.arrayToCommaDelimitedString(serverPropertiesBeans)); } } diff --git a/spring-zero-autoconfigure/src/main/java/org/springframework/zero/autoconfigure/web/WebMvcAutoConfiguration.java b/spring-zero-autoconfigure/src/main/java/org/springframework/zero/autoconfigure/web/WebMvcAutoConfiguration.java index 3c9995eefe..388fe7793f 100644 --- a/spring-zero-autoconfigure/src/main/java/org/springframework/zero/autoconfigure/web/WebMvcAutoConfiguration.java +++ b/spring-zero-autoconfigure/src/main/java/org/springframework/zero/autoconfigure/web/WebMvcAutoConfiguration.java @@ -49,10 +49,10 @@ import org.springframework.web.servlet.resource.ResourceHttpRequestHandler; import org.springframework.web.servlet.view.BeanNameViewResolver; import org.springframework.web.servlet.view.ContentNegotiatingViewResolver; import org.springframework.zero.context.annotation.AutoConfigureAfter; -import org.springframework.zero.context.annotation.ConditionalOnBean; -import org.springframework.zero.context.annotation.ConditionalOnClass; -import org.springframework.zero.context.annotation.ConditionalOnMissingBean; import org.springframework.zero.context.annotation.EnableAutoConfiguration; +import org.springframework.zero.context.condition.ConditionalOnBean; +import org.springframework.zero.context.condition.ConditionalOnClass; +import org.springframework.zero.context.condition.ConditionalOnMissingBean; /** * {@link EnableAutoConfiguration Auto-configuration} for {@link EnableWebMvc Web MVC}. diff --git a/spring-zero-autoconfigure/src/main/java/org/springframework/zero/context/annotation/EnableAutoConfiguration.java b/spring-zero-autoconfigure/src/main/java/org/springframework/zero/context/annotation/EnableAutoConfiguration.java index d747f1f85e..297d108857 100644 --- a/spring-zero-autoconfigure/src/main/java/org/springframework/zero/context/annotation/EnableAutoConfiguration.java +++ b/spring-zero-autoconfigure/src/main/java/org/springframework/zero/context/annotation/EnableAutoConfiguration.java @@ -26,9 +26,9 @@ import org.springframework.context.annotation.Conditional; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; import org.springframework.core.io.support.SpringFactoriesLoader; -import org.springframework.zero.context.annotation.ConditionalOnBean; -import org.springframework.zero.context.annotation.ConditionalOnClass; -import org.springframework.zero.context.annotation.ConditionalOnMissingBean; +import org.springframework.zero.context.condition.ConditionalOnBean; +import org.springframework.zero.context.condition.ConditionalOnClass; +import org.springframework.zero.context.condition.ConditionalOnMissingBean; import org.springframework.zero.context.embedded.EmbeddedServletContainerFactory; import org.springframework.zero.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory; diff --git a/spring-zero-autoconfigure/src/test/java/org/springframework/zero/autoconfigure/web/EmbeddedServletContainerAutoConfigurationTests.java b/spring-zero-autoconfigure/src/test/java/org/springframework/zero/autoconfigure/web/EmbeddedServletContainerAutoConfigurationTests.java index 472ebdf9bf..61a8208c62 100644 --- a/spring-zero-autoconfigure/src/test/java/org/springframework/zero/autoconfigure/web/EmbeddedServletContainerAutoConfigurationTests.java +++ b/spring-zero-autoconfigure/src/test/java/org/springframework/zero/autoconfigure/web/EmbeddedServletContainerAutoConfigurationTests.java @@ -25,7 +25,7 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.stereotype.Component; import org.springframework.zero.autoconfigure.web.EmbeddedServletContainerAutoConfiguration; -import org.springframework.zero.context.annotation.ConditionalOnExpression; +import org.springframework.zero.context.condition.ConditionalOnExpression; import org.springframework.zero.context.embedded.AnnotationConfigEmbeddedWebApplicationContext; import org.springframework.zero.context.embedded.ConfigurableEmbeddedServletContainerFactory; import org.springframework.zero.context.embedded.EmbeddedServletContainerCustomizer; diff --git a/spring-zero-autoconfigure/src/test/java/org/springframework/zero/autoconfigure/web/ServerPropertiesAutoConfigurationTests.java b/spring-zero-autoconfigure/src/test/java/org/springframework/zero/autoconfigure/web/ServerPropertiesAutoConfigurationTests.java index 6fe70f501f..387372a89d 100644 --- a/spring-zero-autoconfigure/src/test/java/org/springframework/zero/autoconfigure/web/ServerPropertiesAutoConfigurationTests.java +++ b/spring-zero-autoconfigure/src/test/java/org/springframework/zero/autoconfigure/web/ServerPropertiesAutoConfigurationTests.java @@ -18,14 +18,13 @@ package org.springframework.zero.autoconfigure.web; import java.io.File; -import org.hamcrest.Matchers; import org.junit.After; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; import org.mockito.Mockito; -import org.springframework.beans.factory.NoUniqueBeanDefinitionException; +import org.springframework.beans.factory.BeanCreationException; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.zero.TestUtils; @@ -34,8 +33,8 @@ import org.springframework.zero.context.embedded.AnnotationConfigEmbeddedWebAppl import org.springframework.zero.context.embedded.ConfigurableEmbeddedServletContainerFactory; import org.springframework.zero.context.embedded.EmbeddedServletContainerCustomizerBeanPostProcessor; import org.springframework.zero.context.embedded.EmbeddedServletContainerFactory; +import org.springframework.zero.context.embedded.ServerProperties; import org.springframework.zero.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory; -import org.springframework.zero.properties.ServerProperties; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; @@ -100,8 +99,8 @@ public class ServerPropertiesAutoConfigurationTests { this.context.register(Config.class, MutiServerPropertiesBeanConfig.class, ServerPropertiesAutoConfiguration.class, PropertyPlaceholderAutoConfiguration.class); - this.thrown.expectCause(Matchers - . instanceOf(NoUniqueBeanDefinitionException.class)); + this.thrown.expect(BeanCreationException.class); + this.thrown.expectMessage("Multiple ServerProperties"); this.context.refresh(); } diff --git a/spring-zero-core/src/main/java/org/springframework/zero/context/annotation/AbstractOnBeanCondition.java b/spring-zero-core/src/main/java/org/springframework/zero/context/condition/AbstractOnBeanCondition.java similarity index 99% rename from spring-zero-core/src/main/java/org/springframework/zero/context/annotation/AbstractOnBeanCondition.java rename to spring-zero-core/src/main/java/org/springframework/zero/context/condition/AbstractOnBeanCondition.java index 995ce9d72d..0698a9772b 100644 --- a/spring-zero-core/src/main/java/org/springframework/zero/context/annotation/AbstractOnBeanCondition.java +++ b/spring-zero-core/src/main/java/org/springframework/zero/context/condition/AbstractOnBeanCondition.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.zero.context.annotation; +package org.springframework.zero.context.condition; import java.lang.reflect.Method; import java.util.ArrayList; diff --git a/spring-zero-core/src/main/java/org/springframework/zero/context/annotation/ConditionLogUtils.java b/spring-zero-core/src/main/java/org/springframework/zero/context/condition/ConditionLogUtils.java similarity index 96% rename from spring-zero-core/src/main/java/org/springframework/zero/context/annotation/ConditionLogUtils.java rename to spring-zero-core/src/main/java/org/springframework/zero/context/condition/ConditionLogUtils.java index 7d2ce8d32d..9fda8cf106 100644 --- a/spring-zero-core/src/main/java/org/springframework/zero/context/annotation/ConditionLogUtils.java +++ b/spring-zero-core/src/main/java/org/springframework/zero/context/condition/ConditionLogUtils.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.zero.context.annotation; +package org.springframework.zero.context.condition; import org.apache.commons.logging.Log; import org.springframework.core.type.AnnotatedTypeMetadata; diff --git a/spring-zero-core/src/main/java/org/springframework/zero/context/annotation/ConditionalOnBean.java b/spring-zero-core/src/main/java/org/springframework/zero/context/condition/ConditionalOnBean.java similarity index 97% rename from spring-zero-core/src/main/java/org/springframework/zero/context/annotation/ConditionalOnBean.java rename to spring-zero-core/src/main/java/org/springframework/zero/context/condition/ConditionalOnBean.java index d490628521..ab10b3d6e6 100644 --- a/spring-zero-core/src/main/java/org/springframework/zero/context/annotation/ConditionalOnBean.java +++ b/spring-zero-core/src/main/java/org/springframework/zero/context/condition/ConditionalOnBean.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.zero.context.annotation; +package org.springframework.zero.context.condition; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; diff --git a/spring-zero-core/src/main/java/org/springframework/zero/context/annotation/ConditionalOnClass.java b/spring-zero-core/src/main/java/org/springframework/zero/context/condition/ConditionalOnClass.java similarity index 96% rename from spring-zero-core/src/main/java/org/springframework/zero/context/annotation/ConditionalOnClass.java rename to spring-zero-core/src/main/java/org/springframework/zero/context/condition/ConditionalOnClass.java index 7660f7fb0a..c8e50cce82 100644 --- a/spring-zero-core/src/main/java/org/springframework/zero/context/annotation/ConditionalOnClass.java +++ b/spring-zero-core/src/main/java/org/springframework/zero/context/condition/ConditionalOnClass.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.zero.context.annotation; +package org.springframework.zero.context.condition; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; diff --git a/spring-zero-core/src/main/java/org/springframework/zero/context/annotation/ConditionalOnExpression.java b/spring-zero-core/src/main/java/org/springframework/zero/context/condition/ConditionalOnExpression.java similarity index 95% rename from spring-zero-core/src/main/java/org/springframework/zero/context/annotation/ConditionalOnExpression.java rename to spring-zero-core/src/main/java/org/springframework/zero/context/condition/ConditionalOnExpression.java index 67858c0300..5646716191 100644 --- a/spring-zero-core/src/main/java/org/springframework/zero/context/annotation/ConditionalOnExpression.java +++ b/spring-zero-core/src/main/java/org/springframework/zero/context/condition/ConditionalOnExpression.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.zero.context.annotation; +package org.springframework.zero.context.condition; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; diff --git a/spring-zero-core/src/main/java/org/springframework/zero/context/annotation/ConditionalOnMissingBean.java b/spring-zero-core/src/main/java/org/springframework/zero/context/condition/ConditionalOnMissingBean.java similarity index 97% rename from spring-zero-core/src/main/java/org/springframework/zero/context/annotation/ConditionalOnMissingBean.java rename to spring-zero-core/src/main/java/org/springframework/zero/context/condition/ConditionalOnMissingBean.java index a266dcb46f..d77074b636 100644 --- a/spring-zero-core/src/main/java/org/springframework/zero/context/annotation/ConditionalOnMissingBean.java +++ b/spring-zero-core/src/main/java/org/springframework/zero/context/condition/ConditionalOnMissingBean.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.zero.context.annotation; +package org.springframework.zero.context.condition; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; diff --git a/spring-zero-core/src/main/java/org/springframework/zero/context/annotation/ConditionalOnMissingClass.java b/spring-zero-core/src/main/java/org/springframework/zero/context/condition/ConditionalOnMissingClass.java similarity index 96% rename from spring-zero-core/src/main/java/org/springframework/zero/context/annotation/ConditionalOnMissingClass.java rename to spring-zero-core/src/main/java/org/springframework/zero/context/condition/ConditionalOnMissingClass.java index ed1c0c9e2e..e1014526a1 100644 --- a/spring-zero-core/src/main/java/org/springframework/zero/context/annotation/ConditionalOnMissingClass.java +++ b/spring-zero-core/src/main/java/org/springframework/zero/context/condition/ConditionalOnMissingClass.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.zero.context.annotation; +package org.springframework.zero.context.condition; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; diff --git a/spring-zero-core/src/main/java/org/springframework/zero/context/annotation/ConditionalOnNotWebApplication.java b/spring-zero-core/src/main/java/org/springframework/zero/context/condition/ConditionalOnNotWebApplication.java similarity index 95% rename from spring-zero-core/src/main/java/org/springframework/zero/context/annotation/ConditionalOnNotWebApplication.java rename to spring-zero-core/src/main/java/org/springframework/zero/context/condition/ConditionalOnNotWebApplication.java index 9207692647..fef457de67 100644 --- a/spring-zero-core/src/main/java/org/springframework/zero/context/annotation/ConditionalOnNotWebApplication.java +++ b/spring-zero-core/src/main/java/org/springframework/zero/context/condition/ConditionalOnNotWebApplication.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.zero.context.annotation; +package org.springframework.zero.context.condition; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; diff --git a/spring-zero-core/src/main/java/org/springframework/zero/context/annotation/ConditionalOnResource.java b/spring-zero-core/src/main/java/org/springframework/zero/context/condition/ConditionalOnResource.java similarity index 96% rename from spring-zero-core/src/main/java/org/springframework/zero/context/annotation/ConditionalOnResource.java rename to spring-zero-core/src/main/java/org/springframework/zero/context/condition/ConditionalOnResource.java index 4c804fb1bf..aae6b17f79 100644 --- a/spring-zero-core/src/main/java/org/springframework/zero/context/annotation/ConditionalOnResource.java +++ b/spring-zero-core/src/main/java/org/springframework/zero/context/condition/ConditionalOnResource.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.zero.context.annotation; +package org.springframework.zero.context.condition; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; diff --git a/spring-zero-core/src/main/java/org/springframework/zero/context/annotation/ConditionalOnWebApplication.java b/spring-zero-core/src/main/java/org/springframework/zero/context/condition/ConditionalOnWebApplication.java similarity index 95% rename from spring-zero-core/src/main/java/org/springframework/zero/context/annotation/ConditionalOnWebApplication.java rename to spring-zero-core/src/main/java/org/springframework/zero/context/condition/ConditionalOnWebApplication.java index 35d7d933a2..a13ae08b9a 100644 --- a/spring-zero-core/src/main/java/org/springframework/zero/context/annotation/ConditionalOnWebApplication.java +++ b/spring-zero-core/src/main/java/org/springframework/zero/context/condition/ConditionalOnWebApplication.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.zero.context.annotation; +package org.springframework.zero.context.condition; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; diff --git a/spring-zero-core/src/main/java/org/springframework/zero/context/annotation/OnBeanCondition.java b/spring-zero-core/src/main/java/org/springframework/zero/context/condition/OnBeanCondition.java similarity index 94% rename from spring-zero-core/src/main/java/org/springframework/zero/context/annotation/OnBeanCondition.java rename to spring-zero-core/src/main/java/org/springframework/zero/context/condition/OnBeanCondition.java index d56a404317..7da41e8f6a 100644 --- a/spring-zero-core/src/main/java/org/springframework/zero/context/annotation/OnBeanCondition.java +++ b/spring-zero-core/src/main/java/org/springframework/zero/context/condition/OnBeanCondition.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.zero.context.annotation; +package org.springframework.zero.context.condition; import org.springframework.context.annotation.Condition; diff --git a/spring-zero-core/src/main/java/org/springframework/zero/context/annotation/OnClassCondition.java b/spring-zero-core/src/main/java/org/springframework/zero/context/condition/OnClassCondition.java similarity index 98% rename from spring-zero-core/src/main/java/org/springframework/zero/context/annotation/OnClassCondition.java rename to spring-zero-core/src/main/java/org/springframework/zero/context/condition/OnClassCondition.java index 38b3afb26f..c3b16c0228 100644 --- a/spring-zero-core/src/main/java/org/springframework/zero/context/annotation/OnClassCondition.java +++ b/spring-zero-core/src/main/java/org/springframework/zero/context/condition/OnClassCondition.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.zero.context.annotation; +package org.springframework.zero.context.condition; import java.util.ArrayList; import java.util.List; diff --git a/spring-zero-core/src/main/java/org/springframework/zero/context/annotation/OnExpressionCondition.java b/spring-zero-core/src/main/java/org/springframework/zero/context/condition/OnExpressionCondition.java similarity index 98% rename from spring-zero-core/src/main/java/org/springframework/zero/context/annotation/OnExpressionCondition.java rename to spring-zero-core/src/main/java/org/springframework/zero/context/condition/OnExpressionCondition.java index 4426eec742..90d81e7753 100644 --- a/spring-zero-core/src/main/java/org/springframework/zero/context/annotation/OnExpressionCondition.java +++ b/spring-zero-core/src/main/java/org/springframework/zero/context/condition/OnExpressionCondition.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.zero.context.annotation; +package org.springframework.zero.context.condition; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; diff --git a/spring-zero-core/src/main/java/org/springframework/zero/context/annotation/OnMissingBeanCondition.java b/spring-zero-core/src/main/java/org/springframework/zero/context/condition/OnMissingBeanCondition.java similarity index 95% rename from spring-zero-core/src/main/java/org/springframework/zero/context/annotation/OnMissingBeanCondition.java rename to spring-zero-core/src/main/java/org/springframework/zero/context/condition/OnMissingBeanCondition.java index 71a49f540b..51480c35f6 100644 --- a/spring-zero-core/src/main/java/org/springframework/zero/context/annotation/OnMissingBeanCondition.java +++ b/spring-zero-core/src/main/java/org/springframework/zero/context/condition/OnMissingBeanCondition.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.zero.context.annotation; +package org.springframework.zero.context.condition; import java.util.List; diff --git a/spring-zero-core/src/main/java/org/springframework/zero/context/annotation/OnMissingClassCondition.java b/spring-zero-core/src/main/java/org/springframework/zero/context/condition/OnMissingClassCondition.java similarity index 98% rename from spring-zero-core/src/main/java/org/springframework/zero/context/annotation/OnMissingClassCondition.java rename to spring-zero-core/src/main/java/org/springframework/zero/context/condition/OnMissingClassCondition.java index 224fe06abd..f5e4062f68 100644 --- a/spring-zero-core/src/main/java/org/springframework/zero/context/annotation/OnMissingClassCondition.java +++ b/spring-zero-core/src/main/java/org/springframework/zero/context/condition/OnMissingClassCondition.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.zero.context.annotation; +package org.springframework.zero.context.condition; import java.util.ArrayList; import java.util.List; diff --git a/spring-zero-core/src/main/java/org/springframework/zero/context/annotation/OnNotWebApplicationCondition.java b/spring-zero-core/src/main/java/org/springframework/zero/context/condition/OnNotWebApplicationCondition.java similarity index 97% rename from spring-zero-core/src/main/java/org/springframework/zero/context/annotation/OnNotWebApplicationCondition.java rename to spring-zero-core/src/main/java/org/springframework/zero/context/condition/OnNotWebApplicationCondition.java index 0f814f576e..92d9cb8472 100644 --- a/spring-zero-core/src/main/java/org/springframework/zero/context/annotation/OnNotWebApplicationCondition.java +++ b/spring-zero-core/src/main/java/org/springframework/zero/context/condition/OnNotWebApplicationCondition.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.zero.context.annotation; +package org.springframework.zero.context.condition; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; diff --git a/spring-zero-core/src/main/java/org/springframework/zero/context/annotation/OnResourceCondition.java b/spring-zero-core/src/main/java/org/springframework/zero/context/condition/OnResourceCondition.java similarity index 98% rename from spring-zero-core/src/main/java/org/springframework/zero/context/annotation/OnResourceCondition.java rename to spring-zero-core/src/main/java/org/springframework/zero/context/condition/OnResourceCondition.java index d80d442f3f..81124c8002 100644 --- a/spring-zero-core/src/main/java/org/springframework/zero/context/annotation/OnResourceCondition.java +++ b/spring-zero-core/src/main/java/org/springframework/zero/context/condition/OnResourceCondition.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.zero.context.annotation; +package org.springframework.zero.context.condition; import java.util.ArrayList; import java.util.List; diff --git a/spring-zero-core/src/main/java/org/springframework/zero/context/annotation/OnWebApplicationCondition.java b/spring-zero-core/src/main/java/org/springframework/zero/context/condition/OnWebApplicationCondition.java similarity index 97% rename from spring-zero-core/src/main/java/org/springframework/zero/context/annotation/OnWebApplicationCondition.java rename to spring-zero-core/src/main/java/org/springframework/zero/context/condition/OnWebApplicationCondition.java index 1d4b642c42..5b7f738b18 100644 --- a/spring-zero-core/src/main/java/org/springframework/zero/context/annotation/OnWebApplicationCondition.java +++ b/spring-zero-core/src/main/java/org/springframework/zero/context/condition/OnWebApplicationCondition.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.zero.context.annotation; +package org.springframework.zero.context.condition; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; diff --git a/spring-zero-core/src/main/java/org/springframework/zero/properties/ServerProperties.java b/spring-zero-core/src/main/java/org/springframework/zero/context/embedded/ServerProperties.java similarity index 56% rename from spring-zero-core/src/main/java/org/springframework/zero/properties/ServerProperties.java rename to spring-zero-core/src/main/java/org/springframework/zero/context/embedded/ServerProperties.java index 93d9406401..c7b1fd7a4f 100644 --- a/spring-zero-core/src/main/java/org/springframework/zero/properties/ServerProperties.java +++ b/spring-zero-core/src/main/java/org/springframework/zero/context/embedded/ServerProperties.java @@ -14,22 +14,28 @@ * limitations under the License. */ -package org.springframework.zero.properties; +package org.springframework.zero.context.embedded; import java.io.File; import java.net.InetAddress; import javax.validation.constraints.NotNull; -import org.springframework.zero.context.annotation.ConfigurationProperties; +import org.apache.catalina.valves.AccessLogValve; +import org.apache.catalina.valves.RemoteIpValve; +import org.springframework.util.StringUtils; +import org.springframework.zero.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory; +import org.springframework.zero.context.properties.ConfigurationProperties; /** - * Properties for the web server (e.g. port and path settings). + * {@link ConfigurationProperties properties} for a web server (e.g. port and path + * settings). Will be used to customize an {@link EmbeddedServletContainerFactory} when an + * {@link EmbeddedServletContainerCustomizerBeanPostProcessor} is active. * * @author Dave Syer */ @ConfigurationProperties(name = "server", ignoreUnknownFields = false) -public class ServerProperties { +public class ServerProperties implements EmbeddedServletContainerCustomizer { private int port = 8080; @@ -68,8 +74,14 @@ public class ServerProperties { this.address = address; } - public void setLoader(String value) { - // no op + @Override + public void customize(ConfigurableEmbeddedServletContainerFactory factory) { + factory.setPort(getPort()); + factory.setAddress(getAddress()); + factory.setContextPath(getContextPath()); + if (factory instanceof TomcatEmbeddedServletContainerFactory) { + getTomcat().customizeTomcat((TomcatEmbeddedServletContainerFactory) factory); + } } public static class Tomcat { @@ -114,6 +126,30 @@ public class ServerProperties { this.remoteIpHeader = remoteIpHeader; } + void customizeTomcat(TomcatEmbeddedServletContainerFactory factory) { + if (getBasedir() != null) { + factory.setBaseDirectory(getBasedir()); + } + + String remoteIpHeader = getRemoteIpHeader(); + String protocolHeader = getProtocolHeader(); + if (StringUtils.hasText(remoteIpHeader) + || StringUtils.hasText(protocolHeader)) { + RemoteIpValve valve = new RemoteIpValve(); + valve.setRemoteIpHeader(remoteIpHeader); + valve.setProtocolHeader(protocolHeader); + factory.addContextValves(valve); + } + + String accessLogPattern = getAccessLogPattern(); + if (accessLogPattern != null) { + AccessLogValve valve = new AccessLogValve(); + valve.setPattern(accessLogPattern); + valve.setSuffix(".log"); + factory.addContextValves(valve); + } + } + } } diff --git a/spring-zero-core/src/main/java/org/springframework/zero/context/embedded/tomcat/TomcatEmbeddedServletContainerFactory.java b/spring-zero-core/src/main/java/org/springframework/zero/context/embedded/tomcat/TomcatEmbeddedServletContainerFactory.java index 18857f4865..7ecf598340 100644 --- a/spring-zero-core/src/main/java/org/springframework/zero/context/embedded/tomcat/TomcatEmbeddedServletContainerFactory.java +++ b/spring-zero-core/src/main/java/org/springframework/zero/context/embedded/tomcat/TomcatEmbeddedServletContainerFactory.java @@ -338,6 +338,8 @@ public class TomcatEmbeddedServletContainerFactory extends this.contextLifecycleListeners.addAll(Arrays.asList(contextLifecycleListeners)); } + // FIXME JavaDoc + // FIXME Is this still needed? public TomcatEmbeddedServletContainerFactory getChildContextFactory(final String name) { final Server server = this.tomcat.getServer(); diff --git a/spring-zero-core/src/main/java/org/springframework/zero/context/annotation/ConfigurationProperties.java b/spring-zero-core/src/main/java/org/springframework/zero/context/properties/ConfigurationProperties.java similarity index 95% rename from spring-zero-core/src/main/java/org/springframework/zero/context/annotation/ConfigurationProperties.java rename to spring-zero-core/src/main/java/org/springframework/zero/context/properties/ConfigurationProperties.java index 2176767ba7..e1e4fa2c96 100644 --- a/spring-zero-core/src/main/java/org/springframework/zero/context/annotation/ConfigurationProperties.java +++ b/spring-zero-core/src/main/java/org/springframework/zero/context/properties/ConfigurationProperties.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.zero.context.annotation; +package org.springframework.zero.context.properties; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; @@ -26,7 +26,7 @@ import java.lang.annotation.Target; * Annotation for externalized configuration. Add this to a class definition if you want * to bind and validate some external Properties (e.g. from a .properties file). * - * @see PropertySourcesBindingPostProcessor + * @see ConfigurationPropertiesBindingPostProcessor * * @author Dave Syer */ diff --git a/spring-zero-core/src/main/java/org/springframework/zero/context/annotation/ConfigurationPropertiesBindingConfiguration.java b/spring-zero-core/src/main/java/org/springframework/zero/context/properties/ConfigurationPropertiesBindingConfiguration.java similarity index 93% rename from spring-zero-core/src/main/java/org/springframework/zero/context/annotation/ConfigurationPropertiesBindingConfiguration.java rename to spring-zero-core/src/main/java/org/springframework/zero/context/properties/ConfigurationPropertiesBindingConfiguration.java index d55e12e20d..b47f15c2d1 100644 --- a/spring-zero-core/src/main/java/org/springframework/zero/context/annotation/ConfigurationPropertiesBindingConfiguration.java +++ b/spring-zero-core/src/main/java/org/springframework/zero/context/properties/ConfigurationPropertiesBindingConfiguration.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.zero.context.annotation; +package org.springframework.zero.context.properties; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; @@ -30,6 +30,8 @@ import org.springframework.core.env.PropertySource; import org.springframework.core.env.PropertySources; import org.springframework.validation.Validator; import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean; +import org.springframework.zero.context.condition.ConditionalOnClass; +import org.springframework.zero.context.condition.ConditionalOnMissingBean; /** * Configuration for binding externalized application properties to @@ -72,7 +74,7 @@ public class ConfigurationPropertiesBindingConfiguration { * @return a bean post processor to bind application properties */ @Bean - public PropertySourcesBindingPostProcessor propertySourcesBinder() { + public ConfigurationPropertiesBindingPostProcessor propertySourcesBinder() { PropertySources propertySources; if (this.configurer != null) { @@ -87,7 +89,7 @@ public class ConfigurationPropertiesBindingConfiguration { propertySources = new MutablePropertySources(); } - PropertySourcesBindingPostProcessor processor = new PropertySourcesBindingPostProcessor(); + ConfigurationPropertiesBindingPostProcessor processor = new ConfigurationPropertiesBindingPostProcessor(); processor.setValidator(this.validator); processor.setConversionService(this.conversionService); processor.setPropertySources(propertySources); diff --git a/spring-zero-core/src/main/java/org/springframework/zero/context/annotation/PropertySourcesBindingPostProcessor.java b/spring-zero-core/src/main/java/org/springframework/zero/context/properties/ConfigurationPropertiesBindingPostProcessor.java similarity index 95% rename from spring-zero-core/src/main/java/org/springframework/zero/context/annotation/PropertySourcesBindingPostProcessor.java rename to spring-zero-core/src/main/java/org/springframework/zero/context/properties/ConfigurationPropertiesBindingPostProcessor.java index 557dd2b3c6..ac66c68fca 100644 --- a/spring-zero-core/src/main/java/org/springframework/zero/context/annotation/PropertySourcesBindingPostProcessor.java +++ b/spring-zero-core/src/main/java/org/springframework/zero/context/properties/ConfigurationPropertiesBindingPostProcessor.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.zero.context.annotation; +package org.springframework.zero.context.properties; import org.springframework.beans.BeansException; import org.springframework.beans.factory.BeanCreationException; @@ -29,7 +29,7 @@ import org.springframework.core.convert.support.DefaultConversionService; import org.springframework.core.env.PropertySources; import org.springframework.validation.Validator; import org.springframework.zero.bind.PropertiesConfigurationFactory; -import org.springframework.zero.context.annotation.EnableConfigurationPropertiesImportSelector.ConfigurationPropertiesHolder; +import org.springframework.zero.context.properties.EnableConfigurationPropertiesImportSelector.ConfigurationPropertiesHolder; /** * {@link BeanPostProcessor} to bind {@link PropertySources} to beans annotated with @@ -37,7 +37,7 @@ import org.springframework.zero.context.annotation.EnableConfigurationProperties * * @author Dave Syer */ -public class PropertySourcesBindingPostProcessor implements BeanPostProcessor, +public class ConfigurationPropertiesBindingPostProcessor implements BeanPostProcessor, BeanFactoryAware { private PropertySources propertySources; diff --git a/spring-zero-core/src/main/java/org/springframework/zero/context/annotation/EnableConfigurationProperties.java b/spring-zero-core/src/main/java/org/springframework/zero/context/properties/EnableConfigurationProperties.java similarity index 96% rename from spring-zero-core/src/main/java/org/springframework/zero/context/annotation/EnableConfigurationProperties.java rename to spring-zero-core/src/main/java/org/springframework/zero/context/properties/EnableConfigurationProperties.java index 47824a6abb..d7c8402592 100644 --- a/spring-zero-core/src/main/java/org/springframework/zero/context/annotation/EnableConfigurationProperties.java +++ b/spring-zero-core/src/main/java/org/springframework/zero/context/properties/EnableConfigurationProperties.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.zero.context.annotation; +package org.springframework.zero.context.properties; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; diff --git a/spring-zero-core/src/main/java/org/springframework/zero/context/annotation/EnableConfigurationPropertiesImportSelector.java b/spring-zero-core/src/main/java/org/springframework/zero/context/properties/EnableConfigurationPropertiesImportSelector.java similarity index 96% rename from spring-zero-core/src/main/java/org/springframework/zero/context/annotation/EnableConfigurationPropertiesImportSelector.java rename to spring-zero-core/src/main/java/org/springframework/zero/context/properties/EnableConfigurationPropertiesImportSelector.java index 9564c62e5a..18be19e0c7 100644 --- a/spring-zero-core/src/main/java/org/springframework/zero/context/annotation/EnableConfigurationPropertiesImportSelector.java +++ b/spring-zero-core/src/main/java/org/springframework/zero/context/properties/EnableConfigurationPropertiesImportSelector.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.zero.context.annotation; +package org.springframework.zero.context.properties; import java.util.ArrayList; import java.util.List; @@ -39,7 +39,7 @@ import org.springframework.util.MultiValueMap; * * @author Dave Syer */ -public class EnableConfigurationPropertiesImportSelector implements ImportSelector { +class EnableConfigurationPropertiesImportSelector implements ImportSelector { @Override public String[] selectImports(AnnotationMetadata metadata) { diff --git a/spring-zero-core/src/test/java/org/springframework/zero/context/annotation/AssertMissingBean.java b/spring-zero-core/src/test/java/org/springframework/zero/context/condition/AssertMissingBean.java similarity index 93% rename from spring-zero-core/src/test/java/org/springframework/zero/context/annotation/AssertMissingBean.java rename to spring-zero-core/src/test/java/org/springframework/zero/context/condition/AssertMissingBean.java index 33bba730f8..b3ee08e0fd 100644 --- a/spring-zero-core/src/test/java/org/springframework/zero/context/annotation/AssertMissingBean.java +++ b/spring-zero-core/src/test/java/org/springframework/zero/context/condition/AssertMissingBean.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.zero.context.annotation; +package org.springframework.zero.context.condition; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; @@ -25,7 +25,7 @@ import java.lang.annotation.Target; import org.springframework.beans.factory.BeanFactory; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.Conditional; -import org.springframework.zero.context.annotation.ConditionalOnMissingBean; +import org.springframework.zero.context.condition.ConditionalOnMissingBean; /** * {@link Conditional} that only matches when the specified bean classes and/or names are diff --git a/spring-zero-core/src/test/java/org/springframework/zero/context/annotation/AssertMissingBeanCondition.java b/spring-zero-core/src/test/java/org/springframework/zero/context/condition/AssertMissingBeanCondition.java similarity index 92% rename from spring-zero-core/src/test/java/org/springframework/zero/context/annotation/AssertMissingBeanCondition.java rename to spring-zero-core/src/test/java/org/springframework/zero/context/condition/AssertMissingBeanCondition.java index 699f74271f..2286809315 100644 --- a/spring-zero-core/src/test/java/org/springframework/zero/context/annotation/AssertMissingBeanCondition.java +++ b/spring-zero-core/src/test/java/org/springframework/zero/context/condition/AssertMissingBeanCondition.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.zero.context.annotation; +package org.springframework.zero.context.condition; import java.util.List; @@ -22,7 +22,7 @@ import org.springframework.beans.factory.BeanCreationException; import org.springframework.context.annotation.Condition; import org.springframework.context.annotation.ConditionContext; import org.springframework.core.type.AnnotatedTypeMetadata; -import org.springframework.zero.context.annotation.OnMissingBeanCondition; +import org.springframework.zero.context.condition.OnMissingBeanCondition; /** * {@link Condition} that checks that specific beans are missing. diff --git a/spring-zero-core/src/test/java/org/springframework/zero/context/annotation/NotWebApplicationConditionTests.java b/spring-zero-core/src/test/java/org/springframework/zero/context/condition/NotWebApplicationConditionTests.java similarity index 89% rename from spring-zero-core/src/test/java/org/springframework/zero/context/annotation/NotWebApplicationConditionTests.java rename to spring-zero-core/src/test/java/org/springframework/zero/context/condition/NotWebApplicationConditionTests.java index fcdc446b46..7f8fc6f186 100644 --- a/spring-zero-core/src/test/java/org/springframework/zero/context/annotation/NotWebApplicationConditionTests.java +++ b/spring-zero-core/src/test/java/org/springframework/zero/context/condition/NotWebApplicationConditionTests.java @@ -14,14 +14,14 @@ * limitations under the License. */ -package org.springframework.zero.context.annotation; +package org.springframework.zero.context.condition; import org.junit.Test; import org.springframework.context.annotation.AnnotationConfigApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import org.springframework.zero.context.annotation.ConditionalOnNotWebApplication; -import org.springframework.zero.context.annotation.ConditionalOnWebApplication; +import org.springframework.zero.context.condition.ConditionalOnNotWebApplication; +import org.springframework.zero.context.condition.ConditionalOnWebApplication; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; diff --git a/spring-zero-core/src/test/java/org/springframework/zero/context/annotation/OnBeanConditionTests.java b/spring-zero-core/src/test/java/org/springframework/zero/context/condition/OnBeanConditionTests.java similarity index 96% rename from spring-zero-core/src/test/java/org/springframework/zero/context/annotation/OnBeanConditionTests.java rename to spring-zero-core/src/test/java/org/springframework/zero/context/condition/OnBeanConditionTests.java index b990226d62..724e396666 100644 --- a/spring-zero-core/src/test/java/org/springframework/zero/context/annotation/OnBeanConditionTests.java +++ b/spring-zero-core/src/test/java/org/springframework/zero/context/condition/OnBeanConditionTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.zero.context.annotation; +package org.springframework.zero.context.condition; import org.junit.Ignore; import org.junit.Test; @@ -23,6 +23,7 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; import org.springframework.context.annotation.ImportResource; +import org.springframework.zero.context.condition.ConditionalOnBean; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; diff --git a/spring-zero-core/src/test/java/org/springframework/zero/context/annotation/OnClassConditionTests.java b/spring-zero-core/src/test/java/org/springframework/zero/context/condition/OnClassConditionTests.java similarity index 93% rename from spring-zero-core/src/test/java/org/springframework/zero/context/annotation/OnClassConditionTests.java rename to spring-zero-core/src/test/java/org/springframework/zero/context/condition/OnClassConditionTests.java index d992a73541..e7f97ce9ee 100644 --- a/spring-zero-core/src/test/java/org/springframework/zero/context/annotation/OnClassConditionTests.java +++ b/spring-zero-core/src/test/java/org/springframework/zero/context/condition/OnClassConditionTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.zero.context.annotation; +package org.springframework.zero.context.condition; import org.junit.Test; import org.springframework.context.annotation.AnnotationConfigApplicationContext; @@ -93,13 +93,13 @@ public class OnClassConditionTests { } @Configuration - @ImportResource("org/springframework/zero/context/annotation/foo.xml") + @ImportResource("org/springframework/zero/context/foo.xml") protected static class XmlConfiguration { } @Configuration @Import(BasicConfiguration.class) - @ImportResource("org/springframework/zero/context/annotation/foo.xml") + @ImportResource("org/springframework/zero/context/foo.xml") protected static class CombinedXmlConfiguration { } } diff --git a/spring-zero-core/src/test/java/org/springframework/zero/context/annotation/OnExpressionConditionTests.java b/spring-zero-core/src/test/java/org/springframework/zero/context/condition/OnExpressionConditionTests.java similarity index 93% rename from spring-zero-core/src/test/java/org/springframework/zero/context/annotation/OnExpressionConditionTests.java rename to spring-zero-core/src/test/java/org/springframework/zero/context/condition/OnExpressionConditionTests.java index 60dd82ca6a..a9e5eae562 100644 --- a/spring-zero-core/src/test/java/org/springframework/zero/context/annotation/OnExpressionConditionTests.java +++ b/spring-zero-core/src/test/java/org/springframework/zero/context/condition/OnExpressionConditionTests.java @@ -14,13 +14,13 @@ * limitations under the License. */ -package org.springframework.zero.context.annotation; +package org.springframework.zero.context.condition; import org.junit.Test; import org.springframework.context.annotation.AnnotationConfigApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import org.springframework.zero.context.annotation.ConditionalOnExpression; +import org.springframework.zero.context.condition.ConditionalOnExpression; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; diff --git a/spring-zero-core/src/test/java/org/springframework/zero/context/annotation/OnMissingBeanConditionTests.java b/spring-zero-core/src/test/java/org/springframework/zero/context/condition/OnMissingBeanConditionTests.java similarity index 95% rename from spring-zero-core/src/test/java/org/springframework/zero/context/annotation/OnMissingBeanConditionTests.java rename to spring-zero-core/src/test/java/org/springframework/zero/context/condition/OnMissingBeanConditionTests.java index d253fb4fd8..ce88856359 100644 --- a/spring-zero-core/src/test/java/org/springframework/zero/context/annotation/OnMissingBeanConditionTests.java +++ b/spring-zero-core/src/test/java/org/springframework/zero/context/condition/OnMissingBeanConditionTests.java @@ -14,14 +14,14 @@ * limitations under the License. */ -package org.springframework.zero.context.annotation; +package org.springframework.zero.context.condition; import org.junit.Test; import org.springframework.context.annotation.AnnotationConfigApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import org.springframework.zero.context.annotation.ConditionalOnMissingBean; -import org.springframework.zero.context.annotation.OnMissingBeanCondition; +import org.springframework.zero.context.condition.ConditionalOnMissingBean; +import org.springframework.zero.context.condition.OnMissingBeanCondition; import static org.hamcrest.Matchers.equalTo; import static org.junit.Assert.assertEquals; diff --git a/spring-zero-core/src/test/java/org/springframework/zero/context/annotation/OnMissingClassConditionTests.java b/spring-zero-core/src/test/java/org/springframework/zero/context/condition/OnMissingClassConditionTests.java similarity index 92% rename from spring-zero-core/src/test/java/org/springframework/zero/context/annotation/OnMissingClassConditionTests.java rename to spring-zero-core/src/test/java/org/springframework/zero/context/condition/OnMissingClassConditionTests.java index a23d530a20..9b1622e660 100644 --- a/spring-zero-core/src/test/java/org/springframework/zero/context/annotation/OnMissingClassConditionTests.java +++ b/spring-zero-core/src/test/java/org/springframework/zero/context/condition/OnMissingClassConditionTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.zero.context.annotation; +package org.springframework.zero.context.condition; import org.junit.Test; import org.springframework.context.annotation.AnnotationConfigApplicationContext; @@ -49,7 +49,7 @@ public class OnMissingClassConditionTests { } @Configuration - @ConditionalOnMissingClass("org.springframework.zero.context.annotation.OnMissingClassConditionTests") + @ConditionalOnMissingClass("org.springframework.zero.context.condition.OnMissingClassConditionTests") protected static class BasicConfiguration { @Bean public String bar() { diff --git a/spring-zero-core/src/test/java/org/springframework/zero/context/annotation/OnResourceConditionTests.java b/spring-zero-core/src/test/java/org/springframework/zero/context/condition/OnResourceConditionTests.java similarity index 93% rename from spring-zero-core/src/test/java/org/springframework/zero/context/annotation/OnResourceConditionTests.java rename to spring-zero-core/src/test/java/org/springframework/zero/context/condition/OnResourceConditionTests.java index 6c168c93ee..d83a15fa7f 100644 --- a/spring-zero-core/src/test/java/org/springframework/zero/context/annotation/OnResourceConditionTests.java +++ b/spring-zero-core/src/test/java/org/springframework/zero/context/condition/OnResourceConditionTests.java @@ -14,13 +14,13 @@ * limitations under the License. */ -package org.springframework.zero.context.annotation; +package org.springframework.zero.context.condition; import org.junit.Test; import org.springframework.context.annotation.AnnotationConfigApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import org.springframework.zero.context.annotation.ConditionalOnResource; +import org.springframework.zero.context.condition.ConditionalOnResource; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; diff --git a/spring-zero-core/src/test/java/org/springframework/zero/context/annotation/WebApplicationConditionTests.java b/spring-zero-core/src/test/java/org/springframework/zero/context/condition/WebApplicationConditionTests.java similarity index 90% rename from spring-zero-core/src/test/java/org/springframework/zero/context/annotation/WebApplicationConditionTests.java rename to spring-zero-core/src/test/java/org/springframework/zero/context/condition/WebApplicationConditionTests.java index c6bfa800ce..4ac8d68774 100644 --- a/spring-zero-core/src/test/java/org/springframework/zero/context/annotation/WebApplicationConditionTests.java +++ b/spring-zero-core/src/test/java/org/springframework/zero/context/condition/WebApplicationConditionTests.java @@ -14,15 +14,15 @@ * limitations under the License. */ -package org.springframework.zero.context.annotation; +package org.springframework.zero.context.condition; import org.junit.Test; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.mock.web.MockServletContext; import org.springframework.web.context.support.AnnotationConfigWebApplicationContext; -import org.springframework.zero.context.annotation.ConditionalOnNotWebApplication; -import org.springframework.zero.context.annotation.ConditionalOnWebApplication; +import org.springframework.zero.context.condition.ConditionalOnNotWebApplication; +import org.springframework.zero.context.condition.ConditionalOnWebApplication; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; diff --git a/spring-zero-core/src/test/java/org/springframework/zero/properties/ServerPropertiesTests.java b/spring-zero-core/src/test/java/org/springframework/zero/context/embedded/ServerPropertiesTests.java similarity index 93% rename from spring-zero-core/src/test/java/org/springframework/zero/properties/ServerPropertiesTests.java rename to spring-zero-core/src/test/java/org/springframework/zero/context/embedded/ServerPropertiesTests.java index cf63d1afcf..1e975c9189 100644 --- a/spring-zero-core/src/test/java/org/springframework/zero/properties/ServerPropertiesTests.java +++ b/spring-zero-core/src/test/java/org/springframework/zero/context/embedded/ServerPropertiesTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.zero.properties; +package org.springframework.zero.context.embedded; import java.net.InetAddress; import java.util.Collections; @@ -24,13 +24,12 @@ import java.util.Map; import org.junit.Test; import org.springframework.beans.MutablePropertyValues; import org.springframework.zero.bind.RelaxedDataBinder; -import org.springframework.zero.properties.ServerProperties; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; /** - * Externalized configuration for server properties + * Tests for {@link ServerProperties}. * * @author Dave Syer */ @@ -69,4 +68,6 @@ public class ServerPropertiesTests { .getProtocolHeader()); } + // FIXME test customize + } diff --git a/spring-zero-core/src/test/java/org/springframework/zero/context/annotation/EnableConfigurationPropertiesTests.java b/spring-zero-core/src/test/java/org/springframework/zero/context/properties/EnableConfigurationPropertiesTests.java similarity index 96% rename from spring-zero-core/src/test/java/org/springframework/zero/context/annotation/EnableConfigurationPropertiesTests.java rename to spring-zero-core/src/test/java/org/springframework/zero/context/properties/EnableConfigurationPropertiesTests.java index ce94e2b162..f4bb2e2379 100644 --- a/spring-zero-core/src/test/java/org/springframework/zero/context/annotation/EnableConfigurationPropertiesTests.java +++ b/spring-zero-core/src/test/java/org/springframework/zero/context/properties/EnableConfigurationPropertiesTests.java @@ -13,7 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.zero.context.annotation; + +package org.springframework.zero.context.properties; import java.util.Arrays; @@ -28,11 +29,15 @@ import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.ImportResource; import org.springframework.stereotype.Component; import org.springframework.zero.TestUtils; +import org.springframework.zero.context.condition.AssertMissingBean; +import org.springframework.zero.context.condition.ConditionalOnMissingBean; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; /** + * Tests for {@link EnableConfigurationProperties}. + * * @author Dave Syer */ public class EnableConfigurationPropertiesTests { @@ -168,7 +173,7 @@ public class EnableConfigurationPropertiesTests { } @Configuration - @ImportResource("org/springframework/zero/context/annotation/testProperties.xml") + @ImportResource("org/springframework/zero/context/properties/testProperties.xml") protected static class DefaultXmlConfiguration { } diff --git a/spring-zero-core/src/test/java/org/springframework/zero/context/test/EnableConfigurationPropertiesTests.java b/spring-zero-core/src/test/java/org/springframework/zero/context/test/EnableConfigurationPropertiesTests.java index 0bb5ff9b3d..52232c9307 100644 --- a/spring-zero-core/src/test/java/org/springframework/zero/context/test/EnableConfigurationPropertiesTests.java +++ b/spring-zero-core/src/test/java/org/springframework/zero/context/test/EnableConfigurationPropertiesTests.java @@ -27,8 +27,8 @@ import org.springframework.context.annotation.Configuration; import org.springframework.core.env.PropertiesPropertySource; import org.springframework.core.io.ByteArrayResource; import org.springframework.core.io.support.PropertiesLoaderUtils; -import org.springframework.zero.context.annotation.ConfigurationProperties; -import org.springframework.zero.context.annotation.EnableConfigurationProperties; +import org.springframework.zero.context.properties.ConfigurationProperties; +import org.springframework.zero.context.properties.EnableConfigurationProperties; import static org.junit.Assert.assertEquals; diff --git a/spring-zero-core/src/test/resources/org/springframework/zero/context/annotation/foo.xml b/spring-zero-core/src/test/resources/org/springframework/zero/context/foo.xml similarity index 100% rename from spring-zero-core/src/test/resources/org/springframework/zero/context/annotation/foo.xml rename to spring-zero-core/src/test/resources/org/springframework/zero/context/foo.xml diff --git a/spring-zero-core/src/test/resources/org/springframework/zero/context/annotation/testProperties.xml b/spring-zero-core/src/test/resources/org/springframework/zero/context/properties/testProperties.xml similarity index 76% rename from spring-zero-core/src/test/resources/org/springframework/zero/context/annotation/testProperties.xml rename to spring-zero-core/src/test/resources/org/springframework/zero/context/properties/testProperties.xml index 20e28fe928..6784fc206b 100644 --- a/spring-zero-core/src/test/resources/org/springframework/zero/context/annotation/testProperties.xml +++ b/spring-zero-core/src/test/resources/org/springframework/zero/context/properties/testProperties.xml @@ -4,8 +4,8 @@ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> + id="org.springframework.zero.context.properties.EnableConfigurationPropertiesTests$TestProperties" + class="org.springframework.zero.context.properties.EnableConfigurationPropertiesTests$TestProperties"> diff --git a/spring-zero-samples/spring-zero-sample-actuator/src/main/java/org/springframework/zero/sample/actuator/SampleActuatorApplication.java b/spring-zero-samples/spring-zero-sample-actuator/src/main/java/org/springframework/zero/sample/actuator/SampleActuatorApplication.java index 92ef72bf02..6fcebb6e6e 100644 --- a/spring-zero-samples/spring-zero-sample-actuator/src/main/java/org/springframework/zero/sample/actuator/SampleActuatorApplication.java +++ b/spring-zero-samples/spring-zero-sample-actuator/src/main/java/org/springframework/zero/sample/actuator/SampleActuatorApplication.java @@ -20,7 +20,7 @@ import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.zero.SpringApplication; import org.springframework.zero.context.annotation.EnableAutoConfiguration; -import org.springframework.zero.context.annotation.EnableConfigurationProperties; +import org.springframework.zero.context.properties.EnableConfigurationProperties; @Configuration @EnableAutoConfiguration diff --git a/spring-zero-samples/spring-zero-sample-actuator/src/main/java/org/springframework/zero/sample/actuator/ServiceProperties.java b/spring-zero-samples/spring-zero-sample-actuator/src/main/java/org/springframework/zero/sample/actuator/ServiceProperties.java index ec8782bf18..7c2c18b292 100644 --- a/spring-zero-samples/spring-zero-sample-actuator/src/main/java/org/springframework/zero/sample/actuator/ServiceProperties.java +++ b/spring-zero-samples/spring-zero-sample-actuator/src/main/java/org/springframework/zero/sample/actuator/ServiceProperties.java @@ -17,7 +17,7 @@ package org.springframework.zero.sample.actuator; import org.springframework.stereotype.Component; -import org.springframework.zero.context.annotation.ConfigurationProperties; +import org.springframework.zero.context.properties.ConfigurationProperties; @ConfigurationProperties(name = "service", ignoreUnknownFields = false) @Component diff --git a/spring-zero-samples/spring-zero-sample-integration/src/main/java/org/springframework/zero/sample/integration/SampleIntegrationApplication.java b/spring-zero-samples/spring-zero-sample-integration/src/main/java/org/springframework/zero/sample/integration/SampleIntegrationApplication.java index 9886939734..5b4cb80d4a 100644 --- a/spring-zero-samples/spring-zero-sample-integration/src/main/java/org/springframework/zero/sample/integration/SampleIntegrationApplication.java +++ b/spring-zero-samples/spring-zero-sample-integration/src/main/java/org/springframework/zero/sample/integration/SampleIntegrationApplication.java @@ -21,7 +21,7 @@ import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.ImportResource; import org.springframework.zero.SpringApplication; import org.springframework.zero.context.annotation.EnableAutoConfiguration; -import org.springframework.zero.context.annotation.EnableConfigurationProperties; +import org.springframework.zero.context.properties.EnableConfigurationProperties; @Configuration @EnableAutoConfiguration diff --git a/spring-zero-samples/spring-zero-sample-integration/src/main/java/org/springframework/zero/sample/integration/ServiceProperties.java b/spring-zero-samples/spring-zero-sample-integration/src/main/java/org/springframework/zero/sample/integration/ServiceProperties.java index c703c3f122..570d15d2dc 100644 --- a/spring-zero-samples/spring-zero-sample-integration/src/main/java/org/springframework/zero/sample/integration/ServiceProperties.java +++ b/spring-zero-samples/spring-zero-sample-integration/src/main/java/org/springframework/zero/sample/integration/ServiceProperties.java @@ -16,7 +16,7 @@ package org.springframework.zero.sample.integration; -import org.springframework.zero.context.annotation.ConfigurationProperties; +import org.springframework.zero.context.properties.ConfigurationProperties; @ConfigurationProperties(name = "service", ignoreUnknownFields = false) public class ServiceProperties {