implement the apache commons daemon http://commons.apache.org/daemon/
the daemons purpose is that it properly handles shutdown signals and cleans everything proerly before exiting -> there should be no active database calls and the users should get a notification
and create init.d scripts for the server, so a reboot will restart the server.