Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-14562

Manually init for Scheduled

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: Waiting for Triage
    • Component/s: Core
    • Labels:
      None
    • Last commented by a User:
      true

      Description

      It is possible to launch a @Scheduled task with initialDelay, Cron and fixedRate. Sometimes, could be useful to have a manually initialization for Spring @Scheduled tasks. The Job could be waiting until the programmer sends the manual init.

      @Component
      class Service {
          @Scheduled(initMode=MANUAL/AUTO
          public void task(){}
      }
      

      myService.task() will invoke the @Scheduled job. At this moment, this could be done by reflection but I think it could be improved.

        Attachments

          Activity

            People

            Assignee:
            juergen.hoeller Juergen Hoeller
            Reporter:
            crm86 Carlos Rivas
            Last updater:
            Spring Issuemaster
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Days since last comment:
              1 year, 36 weeks, 4 days ago