From ba501791c94dcccfe1eb81acbe257e6462724b3a Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Fri, 5 May 2017 14:21:01 +0200 Subject: [PATCH] Consistent use of WebFlux terminology over Web Reactive --- .../org/springframework/ui/ConcurrentModel.java | 16 +++++++++------- .../support/BindingAwareConcurrentModel.java | 14 +++++++------- .../web/reactive/config/EnableWebFlux.java | 11 ++++------- .../config/WebFluxConfigurationSupport.java | 7 ++++--- .../web/reactive/config/WebFluxConfigurer.java | 6 ++---- .../web/reactive/config/package-info.java | 2 +- .../web/reactive/support/package-info.java | 2 +- 7 files changed, 28 insertions(+), 30 deletions(-) diff --git a/spring-context/src/main/java/org/springframework/ui/ConcurrentModel.java b/spring-context/src/main/java/org/springframework/ui/ConcurrentModel.java index aaccfd5232..553120af44 100644 --- a/spring-context/src/main/java/org/springframework/ui/ConcurrentModel.java +++ b/spring-context/src/main/java/org/springframework/ui/ConcurrentModel.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 the original author or authors. + * Copyright 2002-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.springframework.ui; import java.util.Collection; @@ -23,12 +24,13 @@ import org.springframework.core.Conventions; import org.springframework.util.Assert; /** - * Implementation of {@link Model} based on a {@link ConcurrentHashMap} for use - * in concurrent scenarios. Exposed to handler methods by Spring Web Reactive - * typically via a declaration of the {@link Model} interface. There is typically - * no need to create it within user code. If necessary a controller method can - * return a regular {@code java.util.Map}, or more likely a - * {@code java.util.ConcurrentMap}. + * Implementation of the {@link Model} interface based on a {@link ConcurrentHashMap} + * for use in concurrent scenarios. + * + *

Exposed to handler methods by Spring WebFlux, typically via a declaration of the + * {@link Model} interface. There is typically no need to create it within user code. + * If necessary a handler method can return a regular {@code java.util.Map}, + * likely a {@code java.util.ConcurrentMap}, for a pre-determined model. * * @author Rossen Stoyanchev * @since 5.0 diff --git a/spring-context/src/main/java/org/springframework/validation/support/BindingAwareConcurrentModel.java b/spring-context/src/main/java/org/springframework/validation/support/BindingAwareConcurrentModel.java index 201160c86c..c0de3cd080 100644 --- a/spring-context/src/main/java/org/springframework/validation/support/BindingAwareConcurrentModel.java +++ b/spring-context/src/main/java/org/springframework/validation/support/BindingAwareConcurrentModel.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2015 the original author or authors. + * Copyright 2002-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,16 +22,16 @@ import org.springframework.ui.ConcurrentModel; import org.springframework.validation.BindingResult; /** - * Sub-class of {@link ConcurrentModel} that automatically removes + * Subclass of {@link ConcurrentModel} that automatically removes * the {@link BindingResult} object when its corresponding * target attribute is replaced through regular {@link Map} operations. * - *

This is the class exposed to controller methods by Spring Web Reactive, + *

This is the class exposed to handler methods by Spring WebFlux, * typically consumed through a declaration of the - * {@link org.springframework.ui.Model} interface. There is typically - * no need to create it within user code. If necessary a controller method can - * return a regular {@code java.util.Map}, or more likely a - * {@code java.util.ConcurrentMap}. + * {@link org.springframework.ui.Model} interface as a parameter type. + * There is typically no need to create it within user code. + * If necessary a handler method can return a regular {@code java.util.Map}, + * likely a {@code java.util.ConcurrentMap}, for a pre-determined model. * * @author Rossen Stoyanchev * @since 5.0 diff --git a/spring-webflux/src/main/java/org/springframework/web/reactive/config/EnableWebFlux.java b/spring-webflux/src/main/java/org/springframework/web/reactive/config/EnableWebFlux.java index 915d577a3f..c1b8391314 100644 --- a/spring-webflux/src/main/java/org/springframework/web/reactive/config/EnableWebFlux.java +++ b/spring-webflux/src/main/java/org/springframework/web/reactive/config/EnableWebFlux.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 the original author or authors. + * Copyright 2002-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,7 +33,6 @@ import org.springframework.context.annotation.Import; * @EnableWebFlux * @ComponentScan(basePackageClasses = MyConfiguration.class) * public class MyConfiguration { - * * } * * @@ -55,15 +54,13 @@ import org.springframework.context.annotation.Import; * public void configureMessageWriters(List<HttpMessageWriter<?>> messageWriters) { * messageWriters.add(new MyHttpMessageWriter()); * } - * * } * * *

Note: only one {@code @Configuration} class may have the - * {@code @EnableWebFlux} annotation to import the Spring Web Reactive - * configuration. There can however be multiple {@code @Configuration} classes - * implementing {@code WebFluxConfigurer} in order to customize the provided - * configuration. + * {@code @EnableWebFlux} annotation to import the Spring WebFlux configuration. + * There can however be multiple {@code @Configuration} classes implementing + * {@code WebFluxConfigurer} in order to customize the provided configuration. * *

If {@link WebFluxConfigurer} does not expose some more advanced setting * that needs to be configured consider removing the {@code @EnableWebFlux} diff --git a/spring-webflux/src/main/java/org/springframework/web/reactive/config/WebFluxConfigurationSupport.java b/spring-webflux/src/main/java/org/springframework/web/reactive/config/WebFluxConfigurationSupport.java index 76861084e2..6424406f60 100644 --- a/spring-webflux/src/main/java/org/springframework/web/reactive/config/WebFluxConfigurationSupport.java +++ b/spring-webflux/src/main/java/org/springframework/web/reactive/config/WebFluxConfigurationSupport.java @@ -61,7 +61,7 @@ import org.springframework.web.server.WebExceptionHandler; import org.springframework.web.server.handler.ResponseStatusExceptionHandler; /** - * The main class for Spring Web Reactive configuration. + * The main class for Spring WebFlux configuration. * *

Import directly or extend and override protected methods to customize. * @@ -73,8 +73,8 @@ public class WebFluxConfigurationSupport implements ApplicationContextAware { static final boolean jackson2Present = ClassUtils.isPresent("com.fasterxml.jackson.databind.ObjectMapper", WebFluxConfigurationSupport.class.getClassLoader()) && - ClassUtils.isPresent("com.fasterxml.jackson.core.JsonGenerator", - WebFluxConfigurationSupport.class.getClassLoader()); + ClassUtils.isPresent("com.fasterxml.jackson.core.JsonGenerator", + WebFluxConfigurationSupport.class.getClassLoader()); private Map corsConfigurations; @@ -408,6 +408,7 @@ public class WebFluxConfigurationSupport implements ApplicationContextAware { } } + private static final class NoOpValidator implements Validator { @Override diff --git a/spring-webflux/src/main/java/org/springframework/web/reactive/config/WebFluxConfigurer.java b/spring-webflux/src/main/java/org/springframework/web/reactive/config/WebFluxConfigurer.java index 392e8431b7..abae19f7fc 100644 --- a/spring-webflux/src/main/java/org/springframework/web/reactive/config/WebFluxConfigurer.java +++ b/spring-webflux/src/main/java/org/springframework/web/reactive/config/WebFluxConfigurer.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 the original author or authors. + * Copyright 2002-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ package org.springframework.web.reactive.config; -import java.util.List; import java.util.Optional; import org.springframework.core.convert.converter.Converter; @@ -28,11 +27,10 @@ import org.springframework.validation.Validator; import org.springframework.web.reactive.accept.CompositeContentTypeResolver; import org.springframework.web.reactive.accept.RequestedContentTypeResolver; import org.springframework.web.reactive.accept.RequestedContentTypeResolverBuilder; -import org.springframework.web.reactive.result.method.HandlerMethodArgumentResolver; import org.springframework.web.reactive.result.method.annotation.ArgumentResolverConfigurer; /** - * Defines callback methods to customize the configuration for Web Reactive + * Defines callback methods to customize the configuration for WebFlux * applications enabled via {@code @EnableWebFlux}. * *

{@code @EnableWebFlux}-annotated configuration classes may implement diff --git a/spring-webflux/src/main/java/org/springframework/web/reactive/config/package-info.java b/spring-webflux/src/main/java/org/springframework/web/reactive/config/package-info.java index 8ada9a8cd4..0f0516b227 100644 --- a/spring-webflux/src/main/java/org/springframework/web/reactive/config/package-info.java +++ b/spring-webflux/src/main/java/org/springframework/web/reactive/config/package-info.java @@ -1,4 +1,4 @@ /** - * Defines Spring Web Reactive configuration. + * Spring WebFlux configuration infrastructure. */ package org.springframework.web.reactive.config; diff --git a/spring-webflux/src/main/java/org/springframework/web/reactive/support/package-info.java b/spring-webflux/src/main/java/org/springframework/web/reactive/support/package-info.java index a8ee25fdfd..09bf03bcf5 100644 --- a/spring-webflux/src/main/java/org/springframework/web/reactive/support/package-info.java +++ b/spring-webflux/src/main/java/org/springframework/web/reactive/support/package-info.java @@ -1,4 +1,4 @@ /** - * Support classes for Spring Web Reactive. + * Support classes for Spring WebFlux setup. */ package org.springframework.web.reactive.support; \ No newline at end of file -- GitLab