类 WebServerInitializedEvent
- java.lang.Object
- java.util.EventObject
- org.springframework.context.ApplicationEvent
- org.springframework.boot.web.context.WebServerInitializedEvent
- 所有已实现的接口:
Serializable
public abstract class WebServerInitializedEvent extends org.springframework.context.ApplicationEvent
Event to be published after the application context is refreshed and theWebServer
is ready. Useful for obtaining the local port of a running server.- 从以下版本开始:
- 2.0.0
- 另请参阅:
- 序列化表格
字段概要
从类继承的字段 java.util.EventObject
source
构造器概要
构造器 限定符 构造器 说明 protected
WebServerInitializedEvent(WebServer webServer)
方法概要
所有方法 实例方法 抽象方法 具体方法 修饰符和类型 方法 说明 abstract WebServerApplicationContext
getApplicationContext()
Access the application context that the server was created in.WebServer
getSource()
Access the source of the event (anWebServer
).WebServer
getWebServer()
Access theWebServer
.从类继承的方法 java.util.EventObject
toString
构造器详细资料
WebServerInitializedEvent
protected WebServerInitializedEvent(WebServer webServer)
方法详细资料
getWebServer
public WebServer getWebServer()
Access theWebServer
.- 返回:
- the embedded web server
getApplicationContext
public abstract WebServerApplicationContext 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.- 返回:
- the applicationContext that the server was created from
getSource
public WebServer getSource()
Access the source of the event (anWebServer
).- 覆盖:
getSource
在类中EventObject
- 返回:
- the embedded web server