Open
Description
The (servlet and reactive) WebServerStartStopLifecycle.getPhase()
method is currently hardcoded as:
@Override
public int getPhase() {
return WebServerGracefulShutdownLifecycle.SMART_LIFECYCLE_PHASE - 1024;
}
It would be nice if this phase was declared as a public constant. This would make it easier to start a custom SmartLifecycle
before an application starts accepting HTTP requests.
Currently we declare our own constant for this, but there is no guarantee the WebServerStartStopLifecycle
phase will never change.
It is also not possible to depend on the webServerStartStop
bean in order to obtain its phase, since dependency relationships take precedence over phases. That is, if Bean A depends on the webServerStartStop
bean, it will be started after the webServerStartStop
bean, regardless of Bean A's phase.