title: Spring ThreadPoolTaskExecutor shutdown with Async task
body: <p>I'm excuting an <code>Async</code> task using <a href="http://docs.spring.io/spring/docs/current/spring-framework-reference/html/scheduling.html" rel="nofollow">spring task execution framework</a>.
  Doing so I annotated my method with the <em>@Async</em> annotation and added the following to my <code>XML</code> based application context:</p>
  
  <pre><code>&lt;!-- async support --&gt;
  &lt;task:annotation-driven executor="myAsyncExecutor" /&gt;
  &lt;task:executor id="myAsyncExecutor" pool-size="5-10" queue-capacity="100" /&gt;
  </code></pre>
  
  <p>Wondered in this case - how does the shutdown method of this executor gets invoked? I would like to make sure my app doesn't wait forever for this threadPool.</p>
  
  <p>I could (instead of using the task namespace) define my executor as a bean and then set its destroy-method to "shutdown" but wondered regarding the task namespace definition style.</p>
  
  <p>Any ideas?</p>