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:
- 4.0.0
- Author:
- Phillip Webb
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intSmartLifecycle phasein which graceful shutdown of the web server is performed.static final intSmartLifecycle phasein which starting and stopping of the web server is performed.Fields inherited from interface BeanFactory
FACTORY_BEAN_PREFIX, FACTORY_BEAN_PREFIX_CHARFields inherited from interface ResourceLoader
CLASSPATH_URL_PREFIXFields inherited from interface ResourcePatternResolver
CLASSPATH_ALL_URL_PREFIX -
Method Summary
Modifier and TypeMethodDescription@Nullable StringReturns the namespace of the web server application context ornullif no namespace has been set.static @Nullable StringgetServerNamespace(@Nullable ApplicationContext context) Returns the server namespace if the specified context is aWebServerApplicationContext.@Nullable WebServerReturns theWebServerthat was created by the context ornullif the server has not yet been created.static booleanhasServerNamespace(@Nullable ApplicationContext context, String serverNamespace) Returnstrueif the specified context is aWebServerApplicationContextwith a matching server namespace.Methods inherited from interface ApplicationContext
getApplicationName, getAutowireCapableBeanFactory, getDisplayName, getId, getParent, getStartupDateMethods inherited from interface ApplicationEventPublisher
publishEvent, publishEventMethods inherited from interface BeanFactory
containsBean, getAliases, getBean, getBean, getBean, getBean, getBean, getBeanProvider, getBeanProvider, getBeanProvider, getType, getType, isPrototype, isSingleton, isTypeMatch, isTypeMatchMethods inherited from interface EnvironmentCapable
getEnvironmentMethods 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
-
Field Details
-
GRACEFUL_SHUTDOWN_PHASE
static final int GRACEFUL_SHUTDOWN_PHASESmartLifecycle phasein which graceful shutdown of the web server is performed.- Since:
- 4.0.0
- See Also:
-
START_STOP_LIFECYCLE_PHASE
static final int START_STOP_LIFECYCLE_PHASESmartLifecycle phasein which starting and stopping of the web server is performed.- See Also:
-
-
Method Details
-
getWebServer
-
getServerNamespace
@Nullable 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
-
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
-