I have implemented a sample spring scheduled task execution application, with an applicationContext as follows,
...
<task:annotation-driven scheduler="myScheduler" executor="myExecuter" />
<task:scheduler id="myScheduler" pool-size="1" />
<task:executor id="myExecuter" pool-size="10" keep-alive="5" />
...
and I have the following Service for scheduling;
@Service
public class DataMartListenerJob {
....
@Scheduled(fixedDelay = 20000)
public void listenStagingArea() {
....
}
@Scheduled(fixedDelay = 20000)
public void listenEULArea() {
....
}
}
Now my question is; How can I monitor and manage those two scheduled methods, I mean I want to pause and resume those scheduled methods, on certain circumstances. how can I do this.