Annotation Type Recurring


  • @Target(METHOD)
    @Retention(RUNTIME)
    @Inherited
    @Documented
    public @interface Recurring
    Allows to recurrently schedule a method from a Spring Service bean using JobRunr. Note that methods annotated with the @Recurring annotation may not have any parameters.
    An example:
          public class MyService {
    
              @Recurring(id = "my-recurring-job", cron = "**/5 * * * *")
              @Job(name = "Doing some work")
              public void doWork() {
                  // some long running task
              }
          }
     
    • Field Summary

      Fields 
      Modifier and Type Fields Description
      static java.lang.String CRON_DISABLED
      A special cron expression value that indicates a disabled trigger: "-".
    • Required Element Summary

      Required Elements 
      Modifier and Type Required Element Description
      java.lang.String cron
      The cron expression defining when to run this recurring job.
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      java.lang.String id  
      java.lang.String zoneId  
    • Field Detail

      • CRON_DISABLED

        static final java.lang.String CRON_DISABLED
        A special cron expression value that indicates a disabled trigger: "-".

        This is primarily meant for use with ${...} placeholders, allowing for external disabling of corresponding recurring methods.

        This mechanism was borrowed from @Scheduled in Spring Framework.

    • Element Detail

      • cron

        java.lang.String cron
        The cron expression defining when to run this recurring job.

        The special value "-" indicates a disabled cron trigger, primarily meant for externally specified values resolved by a ${...} placeholder.

        Returns:
        An expression that can be parsed to a cron schedule.
      • id

        java.lang.String id
        Returns:
        The id of this recurring job which can be used to alter or delete it.
        Default:
        ""
      • zoneId

        java.lang.String zoneId
        Returns:
        The zoneId (timezone) of when to run this recurring job.
        Default:
        ""