title: Creating Spring Framework task programmatically?
body: <p>I need to create task on the fly in my app. How can I do that? I can get scheduler with <code>@autowired</code> annotation, but scheduler takes <code>Runnable</code> objects. I need to give Spring objects, so that my tasks can use <code>@autowired</code> annotation too.</p>
  
  <pre><code>@Autowired private TaskScheduler taskScheduler;
  </code></pre>