类 WebServerInitializedEvent
java.lang.Object
java.util.EventObject
org.springframework.context.ApplicationEvent
org.springframework.boot.web.context.WebServerInitializedEvent
- 所有已实现的接口:
Serializable
Event to be published when the
WebServer
is ready. Useful for obtaining the
local port of a running server.- 从以下版本开始:
- 2.0.0
- 作者:
- Brian Clozel, Stephane Nicoll
- 另请参阅:
-
字段概要
从类继承的字段 java.util.EventObject
source
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明abstract WebServerApplicationContext
Access the application context that the server was created in.Access the source of the event (anWebServer
).Access theWebServer
.从类继承的方法 org.springframework.context.ApplicationEvent
getTimestamp
从类继承的方法 java.util.EventObject
toString
-
构造器详细资料
-
WebServerInitializedEvent
-
-
方法详细资料
-
getWebServer
Access theWebServer
.- 返回:
- the embedded web server
-
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
Access the source of the event (anWebServer
).- 覆盖:
getSource
在类中EventObject
- 返回:
- the embedded web server
-