Class ReactiveWebServerApplicationContext
java.lang.Object
org.springframework.core.io.DefaultResourceLoader
org.springframework.context.support.AbstractApplicationContext
org.springframework.context.support.GenericApplicationContext
org.springframework.boot.web.reactive.context.GenericReactiveWebApplicationContext
org.springframework.boot.web.reactive.context.ReactiveWebServerApplicationContext
- All Implemented Interfaces:
Closeable
,AutoCloseable
,BeanFactory
,HierarchicalBeanFactory
,ListableBeanFactory
,BeanDefinitionRegistry
,ConfigurableWebServerApplicationContext
,WebServerApplicationContext
,ConfigurableReactiveWebApplicationContext
,ReactiveWebApplicationContext
,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:
- 2.0.0
- Author:
- Brian Clozel
-
Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.core.io.DefaultResourceLoader
DefaultResourceLoader.ClassPathContextResource
-
Field Summary
Fields inherited from class org.springframework.context.support.AbstractApplicationContext
APPLICATION_EVENT_MULTICASTER_BEAN_NAME, LIFECYCLE_PROCESSOR_BEAN_NAME, logger, MESSAGE_SOURCE_BEAN_NAME
Fields inherited from interface org.springframework.beans.factory.BeanFactory
FACTORY_BEAN_PREFIX
Fields inherited from interface org.springframework.context.ConfigurableApplicationContext
APPLICATION_STARTUP_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_NAME
Fields inherited from interface org.springframework.core.io.ResourceLoader
CLASSPATH_URL_PREFIX
Fields inherited from interface org.springframework.core.io.support.ResourcePatternResolver
CLASSPATH_ALL_URL_PREFIX
-
Constructor Summary
ConstructorDescriptionCreate a newReactiveWebServerApplicationContext
.Create a newReactiveWebServerApplicationContext
with the givenDefaultListableBeanFactory
. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
doClose()
protected HttpHandler
Return theHttpHandler
that should be used to process the reactive web server.Returns the namespace of the web server application context ornull
if no namespace has been set.Returns theWebServer
that was created by the context ornull
if the server has not yet been created.protected ReactiveWebServerFactory
getWebServerFactory
(String factoryBeanName) protected String
protected void
final void
refresh()
void
setServerNamespace
(String serverNamespace) Set the server namespace of the context.Methods inherited from class org.springframework.boot.web.reactive.context.GenericReactiveWebApplicationContext
createEnvironment, getResourceByPath
Methods inherited from class org.springframework.context.support.GenericApplicationContext
cancelRefresh, closeBeanFactory, getAutowireCapableBeanFactory, getBeanDefinition, getBeanFactory, getClassLoader, getDefaultListableBeanFactory, getResource, getResources, isAlias, isBeanNameInUse, refreshBeanFactory, refreshForAotProcessing, registerAlias, registerBean, registerBean, registerBean, registerBean, registerBean, registerBean, registerBeanDefinition, removeAlias, removeBeanDefinition, setAllowBeanDefinitionOverriding, setAllowCircularReferences, setApplicationStartup, setClassLoader, setParent, setResourceLoader
Methods inherited from class org.springframework.context.support.AbstractApplicationContext
addApplicationListener, addBeanFactoryPostProcessor, assertBeanFactoryActive, close, containsBean, containsBeanDefinition, containsLocalBean, destroyBeans, 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, getBeansOfType, getBeansOfType, getBeansWithAnnotation, getDisplayName, getEnvironment, getId, getInternalParentBeanFactory, getInternalParentMessageSource, getMessage, getMessage, getMessage, getParent, getParentBeanFactory, getResourcePatternResolver, getStartupDate, getType, getType, initApplicationEventMulticaster, initLifecycleProcessor, initMessageSource, initPropertySources, invokeBeanFactoryPostProcessors, isActive, isPrototype, isRunning, isSingleton, isTypeMatch, isTypeMatch, obtainFreshBeanFactory, onClose, postProcessBeanFactory, prepareBeanFactory, prepareRefresh, publishEvent, publishEvent, publishEvent, registerBeanPostProcessors, registerListeners, registerShutdownHook, removeApplicationListener, resetCommonCaches, setDisplayName, setEnvironment, setId, start, stop, toString
Methods inherited from class org.springframework.core.io.DefaultResourceLoader
addProtocolResolver, clearResourceCaches, getProtocolResolvers, getResourceCache
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.core.AliasRegistry
getAliases
Methods inherited from interface org.springframework.context.ApplicationContext
getApplicationName, getAutowireCapableBeanFactory, getDisplayName, getId, getParent, getStartupDate
Methods inherited from interface org.springframework.context.ApplicationEventPublisher
publishEvent, publishEvent
Methods inherited from interface org.springframework.beans.factory.support.BeanDefinitionRegistry
containsBeanDefinition, getBeanDefinitionCount, getBeanDefinitionNames
Methods inherited from interface org.springframework.beans.factory.BeanFactory
containsBean, getAliases, getBean, getBean, getBean, getBean, getBean, getBeanProvider, getBeanProvider, getType, getType, isPrototype, isSingleton, isTypeMatch, isTypeMatch
Methods inherited from interface org.springframework.context.ConfigurableApplicationContext
addApplicationListener, addBeanFactoryPostProcessor, addProtocolResolver, close, getApplicationStartup, getBeanFactory, getEnvironment, isActive, registerShutdownHook, removeApplicationListener, setApplicationStartup, setClassLoader, setEnvironment, setId, setParent
Methods inherited from interface org.springframework.beans.factory.HierarchicalBeanFactory
containsLocalBean, getParentBeanFactory
Methods inherited from interface org.springframework.beans.factory.ListableBeanFactory
containsBeanDefinition, findAnnotationOnBean, findAnnotationOnBean, getBeanDefinitionCount, getBeanDefinitionNames, getBeanNamesForAnnotation, getBeanNamesForType, getBeanNamesForType, getBeanNamesForType, getBeanNamesForType, getBeanProvider, getBeanProvider, getBeansOfType, getBeansOfType, getBeansWithAnnotation
Methods inherited from interface org.springframework.context.MessageSource
getMessage, getMessage, getMessage
Methods inherited from interface org.springframework.core.io.ResourceLoader
getClassLoader, getResource
Methods inherited from interface org.springframework.core.io.support.ResourcePatternResolver
getResources
-
Constructor Details
-
ReactiveWebServerApplicationContext
public ReactiveWebServerApplicationContext()Create a newReactiveWebServerApplicationContext
. -
ReactiveWebServerApplicationContext
Create a newReactiveWebServerApplicationContext
with the givenDefaultListableBeanFactory
.- Parameters:
beanFactory
- the DefaultListableBeanFactory instance to use for this context
-
-
Method Details
-
refresh
- Specified by:
refresh
in interfaceConfigurableApplicationContext
- Overrides:
refresh
in classAbstractApplicationContext
- Throws:
BeansException
IllegalStateException
-
onRefresh
protected void onRefresh()- Overrides:
onRefresh
in classAbstractApplicationContext
-
getWebServerFactoryBeanName
-
getWebServerFactory
-
getHttpHandler
Return theHttpHandler
that 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:
doClose
in classAbstractApplicationContext
-
getWebServer
Returns theWebServer
that was created by the context ornull
if the server has not yet been created.- Specified by:
getWebServer
in interfaceWebServerApplicationContext
- Returns:
- the web server
-
getServerNamespace
Description copied from interface:WebServerApplicationContext
Returns the namespace of the web server application context ornull
if 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:
getServerNamespace
in interfaceWebServerApplicationContext
- Returns:
- the server namespace
-
setServerNamespace
Description copied from interface:ConfigurableWebServerApplicationContext
Set the server namespace of the context.- Specified by:
setServerNamespace
in interfaceConfigurableWebServerApplicationContext
- Parameters:
serverNamespace
- the server namespace- See Also:
-