Class ReactiveWebServerApplicationContext
java.lang.Object
org.springframework.core.io.DefaultResourceLoader
org.springframework.context.support.AbstractApplicationContext
org.springframework.context.support.GenericApplicationContext
org.springframework.boot.web.context.reactive.GenericReactiveWebApplicationContext
org.springframework.boot.web.server.reactive.context.ReactiveWebServerApplicationContext
- All Implemented Interfaces:
Closeable, AutoCloseable, BeanFactory, HierarchicalBeanFactory, ListableBeanFactory, BeanDefinitionRegistry, ConfigurableReactiveWebApplicationContext, ReactiveWebApplicationContext, ConfigurableWebServerApplicationContext, WebServerApplicationContext, ApplicationContext, ApplicationEventPublisher, ConfigurableApplicationContext, Lifecycle, MessageSource, AliasRegistry, EnvironmentCapable, ResourceLoader, ResourcePatternResolver
- Direct Known Subclasses:
AnnotationConfigReactiveWebServerApplicationContext
public class ReactiveWebServerApplicationContext
extends GenericReactiveWebApplicationContext
implements ConfigurableWebServerApplicationContext
A
GenericReactiveWebApplicationContext that can be used to bootstrap itself
from a contained ReactiveWebServerFactory bean.- Since:
- 4.0.0
- Author:
- Brian Clozel
-
Nested Class Summary
Nested classes/interfaces inherited from class DefaultResourceLoader
DefaultResourceLoader.ClassPathContextResource -
Field Summary
Fields inherited from class AbstractApplicationContext
APPLICATION_EVENT_MULTICASTER_BEAN_NAME, LIFECYCLE_PROCESSOR_BEAN_NAME, logger, MESSAGE_SOURCE_BEAN_NAMEFields inherited from interface BeanFactory
FACTORY_BEAN_PREFIX, FACTORY_BEAN_PREFIX_CHARFields inherited from interface ConfigurableApplicationContext
APPLICATION_STARTUP_BEAN_NAME, BOOTSTRAP_EXECUTOR_BEAN_NAME, CONFIG_LOCATION_DELIMITERS, CONVERSION_SERVICE_BEAN_NAME, ENVIRONMENT_BEAN_NAME, LOAD_TIME_WEAVER_BEAN_NAME, SHUTDOWN_HOOK_THREAD_NAME, SYSTEM_ENVIRONMENT_BEAN_NAME, SYSTEM_PROPERTIES_BEAN_NAMEFields inherited from interface ResourceLoader
CLASSPATH_URL_PREFIXFields inherited from interface ResourcePatternResolver
CLASSPATH_ALL_URL_PREFIXFields inherited from interface WebServerApplicationContext
GRACEFUL_SHUTDOWN_PHASE, START_STOP_LIFECYCLE_PHASE -
Constructor Summary
ConstructorsConstructorDescriptionCreate a newReactiveWebServerApplicationContext.Create a newReactiveWebServerApplicationContextwith the givenDefaultListableBeanFactory. -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoClose()protected HttpHandlerReturn theHttpHandlerthat should be used to process the reactive web server.@Nullable StringReturns the namespace of the web server application context ornullif no namespace has been set.@Nullable WebServerReturns theWebServerthat was created by the context ornullif the server has not yet been created.protected ReactiveWebServerFactorygetWebServerFactory(String factoryBeanName) protected Stringprotected voidfinal voidrefresh()voidsetServerNamespace(@Nullable String serverNamespace) Set the server namespace of the context.Methods inherited from class GenericReactiveWebApplicationContext
createEnvironment, getResourceByPathMethods inherited from class GenericApplicationContext
cancelRefresh, closeBeanFactory, getAutowireCapableBeanFactory, getBeanDefinition, getBeanFactory, getClassLoader, getDefaultListableBeanFactory, getResource, getResources, isAlias, isBeanDefinitionOverridable, isBeanNameInUse, refreshBeanFactory, refreshForAotProcessing, register, registerAlias, registerBean, registerBean, registerBean, registerBean, registerBean, registerBean, registerBeanDefinition, removeAlias, removeBeanDefinition, setAllowBeanDefinitionOverriding, setAllowCircularReferences, setApplicationStartup, setClassLoader, setParent, setResourceLoaderMethods inherited from class AbstractApplicationContext
addApplicationListener, addBeanFactoryPostProcessor, assertBeanFactoryActive, clearResourceCaches, close, containsBean, containsBeanDefinition, containsLocalBean, destroyBeans, findAllAnnotationsOnBean, findAnnotationOnBean, findAnnotationOnBean, finishBeanFactoryInitialization, finishRefresh, getAliases, getApplicationListeners, getApplicationName, getApplicationStartup, getBean, getBean, getBean, getBean, getBean, getBeanDefinitionCount, getBeanDefinitionNames, getBeanFactoryPostProcessors, getBeanNamesForAnnotation, getBeanNamesForType, getBeanNamesForType, getBeanNamesForType, getBeanNamesForType, getBeanProvider, getBeanProvider, getBeanProvider, getBeanProvider, getBeanProvider, getBeansOfType, getBeansOfType, getBeansWithAnnotation, getDisplayName, getEnvironment, getId, getInternalParentBeanFactory, getInternalParentMessageSource, getMessage, getMessage, getMessage, getParent, getParentBeanFactory, getResourcePatternResolver, getStartupDate, getType, getType, initApplicationEventMulticaster, initLifecycleProcessor, initMessageSource, initPropertySources, invokeBeanFactoryPostProcessors, isActive, isClosed, isPrototype, isRunning, isSingleton, isTypeMatch, isTypeMatch, obtainFreshBeanFactory, onClose, pause, postProcessBeanFactory, prepareBeanFactory, prepareRefresh, publishEvent, publishEvent, publishEvent, registerBeanPostProcessors, registerListeners, registerShutdownHook, removeApplicationListener, resetCommonCaches, restart, setDisplayName, setEnvironment, setId, start, stop, toStringMethods inherited from class DefaultResourceLoader
addProtocolResolver, getProtocolResolvers, getResourceCacheMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface AliasRegistry
getAliasesMethods inherited from interface ApplicationContext
getApplicationName, getAutowireCapableBeanFactory, getDisplayName, getId, getParent, getStartupDateMethods inherited from interface ApplicationEventPublisher
publishEvent, publishEventMethods inherited from interface BeanDefinitionRegistry
containsBeanDefinition, getBeanDefinitionCount, getBeanDefinitionNamesMethods inherited from interface BeanFactory
containsBean, getAliases, getBean, getBean, getBean, getBean, getBean, getBeanProvider, getBeanProvider, getBeanProvider, getType, getType, isPrototype, isSingleton, isTypeMatch, isTypeMatchMethods inherited from interface ConfigurableApplicationContext
addApplicationListener, addBeanFactoryPostProcessor, addProtocolResolver, close, getApplicationStartup, getBeanFactory, getEnvironment, isActive, isClosed, pause, registerShutdownHook, removeApplicationListener, restart, setApplicationStartup, setClassLoader, setEnvironment, setId, setParentMethods inherited from interface HierarchicalBeanFactory
containsLocalBean, getParentBeanFactoryMethods inherited from interface ListableBeanFactory
containsBeanDefinition, findAllAnnotationsOnBean, findAnnotationOnBean, findAnnotationOnBean, getBeanDefinitionCount, getBeanDefinitionNames, getBeanNamesForAnnotation, getBeanNamesForType, getBeanNamesForType, getBeanNamesForType, getBeanNamesForType, getBeanProvider, getBeanProvider, getBeansOfType, getBeansOfType, getBeansWithAnnotationMethods inherited from interface MessageSource
getMessage, getMessage, getMessageMethods inherited from interface ResourceLoader
getClassLoader, getResourceMethods inherited from interface ResourcePatternResolver
getResources
-
Constructor Details
-
ReactiveWebServerApplicationContext
public ReactiveWebServerApplicationContext()Create a newReactiveWebServerApplicationContext. -
ReactiveWebServerApplicationContext
Create a newReactiveWebServerApplicationContextwith the givenDefaultListableBeanFactory.- Parameters:
beanFactory- the DefaultListableBeanFactory instance to use for this context
-
-
Method Details
-
refresh
- Specified by:
refreshin interfaceConfigurableApplicationContext- Overrides:
refreshin classAbstractApplicationContext- Throws:
BeansExceptionIllegalStateException
-
onRefresh
protected void onRefresh()- Overrides:
onRefreshin classAbstractApplicationContext
-
getWebServerFactoryBeanName
-
getWebServerFactory
-
getHttpHandler
Return theHttpHandlerthat should be used to process the reactive web server. By default this method searches for a suitable bean in the context itself.- Returns:
- a
HttpHandler(nevernull
-
doClose
protected void doClose()- Overrides:
doClosein classAbstractApplicationContext
-
getWebServer
Returns theWebServerthat was created by the context ornullif the server has not yet been created.- Specified by:
getWebServerin interfaceWebServerApplicationContext- Returns:
- the web server
-
getServerNamespace
Description copied from interface:WebServerApplicationContextReturns the namespace of the web server application context ornullif no namespace has been set. Used for disambiguation when multiple web servers are running in the same application (for example a management context running on a different port).- Specified by:
getServerNamespacein interfaceWebServerApplicationContext- Returns:
- the server namespace
-
setServerNamespace
Description copied from interface:ConfigurableWebServerApplicationContextSet the server namespace of the context.- Specified by:
setServerNamespacein interfaceConfigurableWebServerApplicationContext- Parameters:
serverNamespace- the server namespace- See Also:
-