Class AbstractReactiveWebInitializer
java.lang.Object
org.springframework.web.server.adapter.AbstractReactiveWebInitializer
- All Implemented Interfaces:
- WebApplicationInitializer
public abstract class AbstractReactiveWebInitializer
extends Object
implements WebApplicationInitializer
Base class for a 
WebApplicationInitializer
 that installs a Spring Reactive Web Application on a Servlet container.
 Spring configuration is loaded and given to
 WebHttpHandlerBuilder
 which scans the context looking for specific beans and creates a reactive
 HttpHandler. The resulting handler is installed as a Servlet through
 the ServletHttpHandlerAdapter.
- Since:
- 5.0.2
- Author:
- Rossen Stoyanchev, Sam Brannen
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected ApplicationContextReturn the Spring configuration that contains application beans including the ones detected byWebHttpHandlerBuilder.applicationContext.protected abstract Class<?>[]Specify@Configurationand/or@Componentclasses that make up the application configuration.protected StringReturn the Servlet mapping to use.protected StringReturn the name to use to register theServletHttpHandlerAdapter.voidonStartup(ServletContext servletContext) Configure the givenServletContextwith any servlets, filters, listeners context-params and attributes necessary for initializing this web application.protected voidRefresh the given application context, if necessary.protected voidregisterCloseListener(ServletContext servletContext, ApplicationContext applicationContext) Register aServletContextListenerthat closes the given application context when the servlet context is destroyed.
- 
Field Details- 
DEFAULT_SERVLET_NAMEThe default servlet name to use. SeegetServletName().- See Also:
 
 
- 
- 
Constructor Details- 
AbstractReactiveWebInitializerpublic AbstractReactiveWebInitializer()
 
- 
- 
Method Details- 
onStartupDescription copied from interface:WebApplicationInitializerConfigure the givenServletContextwith any servlets, filters, listeners context-params and attributes necessary for initializing this web application. See examples above.- Specified by:
- onStartupin interface- WebApplicationInitializer
- Parameters:
- servletContext- the- ServletContextto initialize
- Throws:
- ServletException- if any call against the given- ServletContextthrows a- ServletException
 
- 
getServletNameReturn the name to use to register theServletHttpHandlerAdapter.By default this is DEFAULT_SERVLET_NAME.
- 
createApplicationContextReturn the Spring configuration that contains application beans including the ones detected byWebHttpHandlerBuilder.applicationContext.
- 
getConfigClassesSpecify@Configurationand/or@Componentclasses that make up the application configuration. The config classes are given to createApplicationContext().
- 
refreshApplicationContextRefresh the given application context, if necessary.
- 
registerCloseListenerprotected void registerCloseListener(ServletContext servletContext, ApplicationContext applicationContext) Register aServletContextListenerthat closes the given application context when the servlet context is destroyed.- Parameters:
- servletContext- the servlet context to listen to
- applicationContext- the application context that is to be closed when- servletContextis destroyed
 
- 
getServletMappingReturn the Servlet mapping to use. Only the default Servlet mapping '/' and path-based Servlet mappings such as '/api/*' are supported.By default this is set to '/'. 
 
-