接口 WebServerApplicationContext

所有超级接口:
ApplicationContext, ApplicationEventPublisher, BeanFactory, EnvironmentCapable, HierarchicalBeanFactory, ListableBeanFactory, MessageSource, ResourceLoader, ResourcePatternResolver
所有已知子接口:
ConfigurableWebServerApplicationContext
所有已知实现类:
AnnotationConfigReactiveWebServerApplicationContext, AnnotationConfigServletWebServerApplicationContext, ReactiveWebServerApplicationContext, ServletWebServerApplicationContext, XmlServletWebServerApplicationContext

public interface WebServerApplicationContext extends ApplicationContext
Interface to be implemented by application contexts that create and manage the lifecycle of an embedded WebServer.
从以下版本开始:
2.0.0
作者:
Phillip Webb
  • 方法详细资料

    • getWebServer

      WebServer getWebServer()
      Returns the WebServer that was created by the context or null if the server has not yet been created.
      返回:
      the web server
    • getServerNamespace

      String getServerNamespace()
      Returns the namespace of the web server application context or null 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).
      返回:
      the server namespace
    • hasServerNamespace

      static boolean hasServerNamespace(ApplicationContext context, String serverNamespace)
      Returns true if the specified context is a WebServerApplicationContext with a matching server namespace.
      参数:
      context - the context to check
      serverNamespace - the server namespace to match against
      返回:
      true if the server namespace of the context matches
      从以下版本开始:
      2.1.8
    • getServerNamespace

      static String getServerNamespace(ApplicationContext context)
      Returns the server namespace if the specified context is a WebServerApplicationContext.
      参数:
      context - the context
      返回:
      the server namespace or null if the context is not a WebServerApplicationContext
      从以下版本开始:
      2.6.0