Reputation: 1959
Example of how to enable an shutdownhandler
for Embedded Jetty
when I try to use it with a newer Jetty Version
I get deprecated warnings.
What would be the proper way to Implement a shutdown handler for the latest Jetty version ?
[Edit]
tried to add shutdown functionality with. ShutdownHandler shutdownHandler = new ShutdownHandler("switchoff", true, true);
but got 404 with http://localhost:22279/shutdown?token="switchoff"
Welcome Page does work with http://localhost:22279/
Upvotes: 0
Views: 217
Reputation: 49462
DebugHandler
is not necessary for shutdown.
If you are using embedded jetty, you can just keep a reference to the Server
object and call Server.stop()
when you want it to shut down.
otherwise ...
The ShutdownHandler
can still be used, it has not been disabled or deprecated.
org/eclipse/jetty/server/handler/ShutdownHandler.java
The javadoc even has a snippet that shows its use.
API Docs: org.eclipse.jetty.server.handler.ShutdownHandler
Upvotes: 1