Add AbstractReactiveWebInitializer

This commit introduces a new AbstractReactiveWebInitializer in
spring-web that relies on WebHttpHandlerBuilder to detect request
processing infrastructure beans from an ApplicationContext.

This eliminates the need to create a DispatcherHandler, since it is
expected to be a Spring bean, and as a result the initializers in
spring-webflux have been deprecated.

Issue: SPR-16144
This commit is contained in:
Rossen Stoyanchev
2017-11-02 14:57:06 -04:00
parent 1611ce7180
commit aa653b23bc
5 changed files with 111 additions and 16 deletions

View File

@@ -26,13 +26,12 @@ import org.springframework.util.ObjectUtils;
* to register a {@code DispatcherHandler}, wrapping it in a
* {@link ServletHttpHandlerAdapter}, and use Java-based Spring configuration.
*
* <p>Concrete implementations are required to implement {@link #getConfigClasses()}.
* Further template and customization methods are provided by
* {@link AbstractDispatcherHandlerInitializer}.
*
* @author Arjen Poutsma
* @since 5.0
* @deprecated in favor of
* {@link org.springframework.web.server.adapter.AbstractReactiveWebInitializer
* AbstractReactiveWebInitializer}
*/
@Deprecated
public abstract class AbstractAnnotationConfigDispatcherHandlerInitializer
extends AbstractDispatcherHandlerInitializer {

View File

@@ -37,13 +37,13 @@ import org.springframework.web.server.adapter.HttpWebHandlerAdapter;
* implementations that register a {@link DispatcherHandler} in the servlet
* context, wrapping it in a {@link ServletHttpHandlerAdapter}.
*
* <p>Most applications should consider extending the Spring Java config, sub-class
* {@link AbstractAnnotationConfigDispatcherHandlerInitializer}.
*
* @author Arjen Poutsma
* @since 5.0
* @see AbstractServletHttpHandlerAdapterInitializer
* @deprecated in favor of
* {@link org.springframework.web.server.adapter.AbstractReactiveWebInitializer
* AbstractReactiveWebInitializer}
*/
@Deprecated
public abstract class AbstractDispatcherHandlerInitializer implements WebApplicationInitializer {
/**

View File

@@ -30,13 +30,13 @@ import org.springframework.web.WebApplicationInitializer;
* implementations that register a {@link ServletHttpHandlerAdapter} in the
* servlet context.
*
* <p>See {@link AbstractDispatcherHandlerInitializer} if registering a
* {@link org.springframework.web.reactive.DispatcherHandler DispatcherHandler}.
*
* @author Arjen Poutsma
* @since 5.0
* @see AbstractDispatcherHandlerInitializer
* @deprecated in favor of
* {@link org.springframework.web.server.adapter.AbstractReactiveWebInitializer
* AbstractReactiveWebInitializer}
*/
@Deprecated
public abstract class AbstractServletHttpHandlerAdapterInitializer implements WebApplicationInitializer {
/**