Spring @Scheduled Timer Task dynamically modifies cron parameters

Source: Internet
Author: User
  1. Add @enablescheduling annotations to the timed task class and implement the Schedulingconfigurer interface. (It is worth noting that the @EnableScheduling to the spring version requirements are relatively high, the beginning of the 3.2.6 version has not been successful, and later changed to 4.2.5 version is available)
  2. Set a static variable cron to hold the task execution cycle parameters.
  3. Another thread is used to simulate the external causes of the actual business to modify the task execution cycle.
  4. Set the task trigger to trigger the task execution, in which you can modify the task's execution cycle.

La La la

Spring @Scheduled Timer Task dynamically modifies cron parameters

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.