So, do you want the application to be able to kill/stop itself or should an outside tool do it? If you are creating a server that relies on jServer (looks like you are) you could create a handler that, given the right parameter, stops the server (therefore can stop itself). You could also install the server as a service and then use whatever operating system tools to start/stop the service (therefore allowing external tools to stop the server).
I still think you should have started a new thread, since I'm pretty sure you are going outside of the bounds of the original question of this thread.