ServerPortInfoApplicationContextInitializer

ApplicationContextInitializer that sets Environment properties for the ports that WebServer servers are actually listening on. The property "local.server.port" can be injected directly into tests using @Value or obtained through the Environment.

If the WebServerInitializedEvent has a server namespace, it will be used to construct the property name. For example, the "management" actuator context will have the property name "local.management.port".

Properties are automatically propagated up to any parent context.

Author

Dave Syer

Phillip Webb

Since

2.0.0

Constructors

constructor()

Functions

Link copied to clipboard
Link copied to clipboard
open fun initialize(applicationContext: ConfigurableApplicationContext)
Link copied to clipboard
Link copied to clipboard