Annotation TinyTasker

  • All Implemented Interfaces:
    java.lang.annotation.Annotation

    @Target(value = {ElementType.METHOD})@Retention(value = RetentionPolicy.RUNTIME) 
    public @interface TinyTasker
    
                        
    A config file is recommended for all properties except `value`!
    
    Marks the execution method of the Task Bean. Note the following.
    - Methods without parameters can be registered and executed automatically.
    - Methods with parameters can only be registered and executed manually.
    - Polymorphism is not allowed, methods are located by name only
      (for simplicity and readability), and parameter lists are not used.
    - If there is a parameter, it must be of a specific type, stateless,
      and serializable (json by default).
    
    Annotation has a lower priority than property and a higher priority than default.
    The merged config is eventually saved to database, which manages the task with the id
    
    Since:

    2022-12-01

    Author:

    trydofor

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      public @interface TinyTasker.Auto

      Adding to a SpringBean can be auto config by Wings at startup.

    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract String value() `propkey`, the key of the property, which defaults to `Class#method`.
      abstract String zone() timingZone, scheduling timezone in ZoneId format, default system time zone.
      abstract String cron() timingCron, scheduling expression, highest priority, affected by timingType, default spring cron format (seconds minutes hours days months weeks).
      abstract int idle() timingIdle, fixed idle between (seconds), priority second to timingCron,equivalent to fixedDelay.
      abstract int rate() timingRate, fixed frequency start (seconds), priority second to timingIdle, equivalent to fixedRate.
      • Methods inherited from class java.lang.annotation.Annotation

        annotationType, equals, hashCode, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • value

         abstract String value()

        `propkey`, the key of the property, which defaults to `Class#method`. Its property type is Map[String,TaskerConf], located under the prefix `wings.tiny.task.define` e.g. `wings.tiny.task.define[pro.fessional.wings.tiny.task.schedule.TaskerTest#test].enable=false`

      • zone

         abstract String zone()

        timingZone, scheduling timezone in ZoneId format, default system time zone. Use the `Default` config if null or empty.

      • cron

         abstract String cron()

        timingCron, scheduling expression, highest priority, affected by timingType, default spring cron format (seconds minutes hours days months weeks). Not use the `Default` config

      • idle

         abstract int idle()

        timingIdle, fixed idle between (seconds), priority second to timingCron,equivalent to fixedDelay. end to start, 0 is invalid, Not use the `Default` config

      • rate

         abstract int rate()

        timingRate, fixed frequency start (seconds), priority second to timingIdle, equivalent to fixedRate. start to start, 0 is invalid, Not use the `Default` config