类 ServletWebServerInitializedEvent
- java.lang.Object
- java.util.EventObject
- org.springframework.context.ApplicationEvent
- org.springframework.boot.web.context.WebServerInitializedEvent
- org.springframework.boot.web.servlet.context.ServletWebServerInitializedEvent
- 所有已实现的接口:
Serializable
public class ServletWebServerInitializedEvent extends WebServerInitializedEvent
Event to be published after theServletWebServerApplicationContext
is refreshed and theWebServer
is ready. Useful for obtaining the local port of a running server.Normally it will have been started, but listeners are free to inspect the server and stop and start it if they want to.
- 另请参阅:
- 序列化表格
字段概要
从类继承的字段 java.util.EventObject
source
构造器概要
构造器 构造器 说明 ServletWebServerInitializedEvent(WebServer webServer, ServletWebServerApplicationContext applicationContext)
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 ServletWebServerApplicationContext
getApplicationContext()
Access the application context that the server was created in.从类继承的方法 org.springframework.boot.web.context.WebServerInitializedEvent
getSource, getWebServer
从类继承的方法 java.util.EventObject
toString
构造器详细资料
ServletWebServerInitializedEvent
public ServletWebServerInitializedEvent(WebServer webServer, ServletWebServerApplicationContext applicationContext)
方法详细资料
getApplicationContext
public ServletWebServerApplicationContext getApplicationContext()
Access the application context that the server was created in. Sometimes it is prudent to check that this matches expectations (like being equal to the current context) before acting on the server itself.- 指定者:
getApplicationContext
在类中WebServerInitializedEvent
- 返回:
- the applicationContext that the server was created from