Interface WebServerApplicationContext
- All Superinterfaces:
ApplicationContext
,ApplicationEventPublisher
,BeanFactory
,EnvironmentCapable
,HierarchicalBeanFactory
,ListableBeanFactory
,MessageSource
,ResourceLoader
,ResourcePatternResolver
- All Known Subinterfaces:
ConfigurableWebServerApplicationContext
- All Known Implementing Classes:
AnnotationConfigReactiveWebServerApplicationContext
,AnnotationConfigServletWebServerApplicationContext
,ReactiveWebServerApplicationContext
,ServletWebServerApplicationContext
,XmlServletWebServerApplicationContext
Interface to be implemented by
application contexts
that
create and manage the lifecycle of an embedded WebServer
.- Since:
- 2.0.0
- Author:
- Phillip Webb
-
Field Summary
Fields inherited from interface org.springframework.beans.factory.BeanFactory
FACTORY_BEAN_PREFIX
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
-
Method Summary
Modifier and TypeMethodDescriptionReturns the namespace of the web server application context ornull
if no namespace has been set.static String
getServerNamespace
(ApplicationContext context) Returns the server namespace if the specified context is aWebServerApplicationContext
.Returns theWebServer
that was created by the context ornull
if the server has not yet been created.static boolean
hasServerNamespace
(ApplicationContext context, String serverNamespace) Returnstrue
if the specified context is aWebServerApplicationContext
with a matching server namespace.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.BeanFactory
containsBean, getAliases, getBean, getBean, getBean, getBean, getBean, getBeanProvider, getBeanProvider, getType, getType, isPrototype, isSingleton, isTypeMatch, isTypeMatch
Methods inherited from interface org.springframework.core.env.EnvironmentCapable
getEnvironment
Methods inherited from interface org.springframework.beans.factory.HierarchicalBeanFactory
containsLocalBean, getParentBeanFactory
Methods inherited from interface org.springframework.beans.factory.ListableBeanFactory
containsBeanDefinition, findAllAnnotationsOnBean, 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
-
Method Details
-
getWebServer
WebServer getWebServer()Returns theWebServer
that was created by the context ornull
if the server has not yet been created.- Returns:
- the web server
-
getServerNamespace
String getServerNamespace()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).- Returns:
- the server namespace
-
hasServerNamespace
Returnstrue
if the specified context is aWebServerApplicationContext
with a matching server namespace.- Parameters:
context
- the context to checkserverNamespace
- the server namespace to match against- Returns:
true
if the server namespace of the context matches- Since:
- 2.1.8
-
getServerNamespace
Returns the server namespace if the specified context is aWebServerApplicationContext
.- Parameters:
context
- the context- Returns:
- the server namespace or
null
if the context is not aWebServerApplicationContext
- Since:
- 2.6.0
-