title: How to tie the Lifecycle for a Spring Bean to the webapps' lifecycle?
body: <p>I want to create a bean that has <code>start()</code> and <code>stop()</code> methods. 
  When the webapp's context is active, <code>start()</code> is called during Spring's runtime bootup. When the webapp is undeployed or stopped, the <code>stop()</code> method is invoked.</p>
  
  <p>Is this correct: I annotate my <code>start()</code> method with <code>@PostConstruct</code> and the <code>stop()</code> method with <code>@PreDestroy</code> ?</p>
  
  <p>Normally in the servlet world, I write a ServletContextListener.
  Would I be able to access the ApplicationContext from the ServletContextListener ?</p>