In my application I have 2 beans which have methods annotated with @Scheduled annotation. Sometimes I need to schedule both the methods, and sometimes I need to schedule either one of them, based on the input arguments to the application. How can I disable the @Scheduled method after it has been loaded? I am using Spring 3.1 .
In my application I have 2 beans which have methods annotated with @Scheduled annotation.
Share
i would suggest instead of using @Schedule you should use TaskScheduler to schedule your job based on user input, this way you will have more control over execution, different implementation is provided by spring refer to javadoc and scheduling doc