title: JAVA: how to call a method when the process has been stopped (is it even possible?)
body: <p>I want it so when my users start my program from the command line and then kill the process (ctrl+c, for example) the program will shutdown gracefully by closing all its connections.  Is this even possible?  I can't just have it call a method upon closing like a GUI can?  This program has no GUI.</p>
  
  <p>Please let me know.</p>