title: Spring 3.2 @Async task with return type of Future
body: <p>I am trying to implement a spring @Async task which has a return type of Future,
  but I can't really figure out how to do it properly.</p>
  
  <ol>
  <li>What will I gain by doing so ? will I now have a controll over my task so I can stop it and run it ?</li>
  <li>Is there any reference implementation on how I can do it ? springsource does not provide any.</li>
  </ol>
  
  <p><strong>EDIT</strong></p>
  
  <p>From spring source and spring refrence manual :</p>
  
  <blockquote>
    <p>Even methods that return a value can be invoked asynchronously. However, such methods are required
    to have a Future typed return value. This still provides the benefit of asynchronous execution so that
    the caller can perform other tasks prior to calling get() on that Future.</p>
  </blockquote>
  
  <p>and the it gives an example like so :</p>
  
  <pre><code>@Async
  Future&lt;String&gt; returnSomething(int i) {
  // this will be executed asynchronously
  }
  </code></pre>
  
  <p>How to implement this correctly ?</p>