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, FACTORY_BEAN_PREFIX_CHARFields inherited from interface org.springframework.core.io.ResourceLoader
CLASSPATH_URL_PREFIXFields 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 ornullif no namespace has been set.static StringgetServerNamespace(ApplicationContext context) Returns the server namespace if the specified context is aWebServerApplicationContext.Returns theWebServerthat was created by the context ornullif the server has not yet been created.static booleanhasServerNamespace(ApplicationContext context, String serverNamespace) Returnstrueif the specified context is aWebServerApplicationContextwith a matching server namespace.Methods inherited from interface org.springframework.context.ApplicationContext
getApplicationName, getAutowireCapableBeanFactory, getDisplayName, getId, getParent, getStartupDateMethods inherited from interface org.springframework.context.ApplicationEventPublisher
publishEvent, publishEventMethods inherited from interface org.springframework.beans.factory.BeanFactory
containsBean, getAliases, getBean, getBean, getBean, getBean, getBean, getBeanProvider, getBeanProvider, getType, getType, isPrototype, isSingleton, isTypeMatch, isTypeMatchMethods inherited from interface org.springframework.core.env.EnvironmentCapable
getEnvironmentMethods inherited from interface org.springframework.beans.factory.HierarchicalBeanFactory
containsLocalBean, getParentBeanFactoryMethods inherited from interface org.springframework.beans.factory.ListableBeanFactory
containsBeanDefinition, findAllAnnotationsOnBean, findAnnotationOnBean, findAnnotationOnBean, getBeanDefinitionCount, getBeanDefinitionNames, getBeanNamesForAnnotation, getBeanNamesForType, getBeanNamesForType, getBeanNamesForType, getBeanNamesForType, getBeanProvider, getBeanProvider, getBeansOfType, getBeansOfType, getBeansWithAnnotationMethods inherited from interface org.springframework.context.MessageSource
getMessage, getMessage, getMessageMethods inherited from interface org.springframework.core.io.ResourceLoader
getClassLoader, getResourceMethods inherited from interface org.springframework.core.io.support.ResourcePatternResolver
getResources
-
Method Details
-
getWebServer
WebServer getWebServer()Returns theWebServerthat was created by the context ornullif the server has not yet been created.- Returns:
- the web server
-
getServerNamespace
String getServerNamespace()Returns 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).- Returns:
- the server namespace
-
hasServerNamespace
Returnstrueif the specified context is aWebServerApplicationContextwith a matching server namespace.- Parameters:
context- the context to checkserverNamespace- the server namespace to match against- Returns:
trueif 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
nullif the context is not aWebServerApplicationContext - Since:
- 2.6.0
-