I need to create task on the fly in my app. How can I do that? I can get scheduler with @autowired
annotation, but scheduler takes Runnable
objects. I need to give Spring objects, so that my tasks can use @autowired
annotation too.
@Autowired private TaskScheduler taskScheduler;
See Question&Answers more detail:os