title: Best way for a Grails Service class to detect application shutdown?
body: <p>I have a Grails service class that needs to do some cleanup when my Tomcat application server is shut down.</p>
  
  <p>I don't see anything in the Grails docs about a service.stop() or destroy() method, or a way to implement any sort of application lifecycle listener.</p>
  
  <p>What's the best way to do this?</p>
  
  <p>Thanks!</p>