Annotation Interface Deadline


@Retention(RUNTIME) @Target(METHOD) public @interface Deadline
Declares one desired, one-shot deadline on a Model. A pure instance method returns Schedule, a payload when annotation timing is configured, or null to cancel. Parameters may be typed Model ancestors or Graph views. Cron selects the next match without enabling periodic execution. Both sides of a change use the same reference clock; unchanged declarations retain their recorded original time. Once that time has arrived, changed timing, payload, application metadata or schedule ID cannot recreate the deadline. Return null and later a payload to start a new cycle. Runtime rechecks the original time at transaction acceptance in scheduler milliseconds; an expired replacement rebuilds deadline effects and Model metadata without reexecuting applies or handlers. External cancellation is neither queried nor recorded by deadline planning. Both evaluations use current configuration, so a property change alone does not reconcile an existing deadline.

Comparison includes time, payload, application metadata and explicitly supplied schedule IDs. Generated IDs, message timestamps and reserved metadata (keys starting with $) are ignored. The SDK retains category metadata under $fluxzero.deadline.* in existing Model storage; Graph.deadlines() exposes it for the exact revision. These values describe planned work, not successful execution. Reads and replay never schedule work. Commands execute as the configured system user. Concrete scheduler changes share the Model commit. All writers of the Model or its injected context must run the same declarations. Stateful handlers are not supported.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    A property-resolvable cron value that disables the declaration.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
    Cancels the last committed schedule on logical Model deletion, including cascades.
    boolean
    Whether the payload is dispatched as a command.
    Cron expression selecting the next deadline, with the same syntax and property substitution as Periodic.
    long
    Delay from the change that creates or changes the payload.
    Unit of delay().
    Time zone for cron evaluation.
    Stable category within the Model.
  • Field Details

    • DISABLED

      static final String DISABLED
      A property-resolvable cron value that disables the declaration.
      See Also:
  • Element Details

    • cron

      String cron
      Cron expression selecting the next deadline, with the same syntax and property substitution as Periodic. For example "${reminder.cron}". DISABLED disables scheduling. Takes precedence over delay. A returned Schedule supplies its own time.
      Default:
      ""
    • timeZone

      String timeZone
      Time zone for cron evaluation.
      Default:
      "UTC"
    • delay

      long delay
      Delay from the change that creates or changes the payload. Required for plain payloads without cron.
      Default:
      -1L
    • timeUnit

      TimeUnit timeUnit
      Unit of delay().
      Default:
      MILLISECONDS
    • value

      String value
      Stable category within the Model. Declare distinct names when a Model has multiple deadlines.
      Default:
      "default"
    • command

      boolean command
      Whether the payload is dispatched as a command. False selects ordinary HandleSchedule handling.
      Default:
      true
    • cancelOnDeletion

      boolean cancelOnDeletion
      Cancels the last committed schedule on logical Model deletion, including cascades.
      Default:
      true