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 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…