There are several questions about shuting down Jetty here on SO but they are almost 10 years old and do not fully cover my question.
I have an embedded Jetty server in my application and want to shutdown the server from inside of the application. So far, I figured out several ways to do this:
ShutdownHandler shutdownHandler = new ShutdownHandler("shutdownToken");
server.setHandler(new HandlerList(shutdownHandler));
shutdownHandler.sendShutdown();
server.stop();
What is the difference between these thow approaches? I could not find a suitable answer in the Jetty documentation.