Is the embedded Jetty Server "ready to go" when calling Server.start ()?

I'm having trouble finding any information about whether the embedded Jetty server is guaranteed to be fully initialized and ready to receive requests when returning a Server.start () call.

I also could not find anything convincing when debugging.

If the server is still initializing when the call returns, is there a way to register the callback so that I can be notified when it is really ready for action?

+3
source share
2 answers

Yes, when you return from the Server.start()server is ready.

LifeCycle.Listener Server.addLifeCycleListener(listener), . Server.start(), , Listener.lifeCycleStarted() .

+5

, , , , ?

+1

Source: https://habr.com/ru/post/1781121/


All Articles