我有一个java应用程序,它嵌入了jetty服务器来提供http服务。
如果我通过网址访问它:
http://localhost:8080/doStop
Run Code Online (Sandbox Code Playgroud)
它将停止码头服务器并自行终止。
我有两个选择:
1. calls `myserver.stop()`, which `myserver` is an instance of `org.mortbay.jetty.Server`, and had set `.setStopAtShutdown(true)`
2. just invoke `System.exit()`
Run Code Online (Sandbox Code Playgroud)
System.exit()我想知道仅调用来停止整个应用程序是否安全?