org.qi4j.library.scheduler.schedule

## Interface Schedule

- All Superinterfaces:
    Identity
  All Known Subinterfaces:
    CronSchedule, OnceSchedule
  All Known Implementing Classes:
    CronSchedule.CronScheduleMixin, OnceSchedule.OnceScheduleMixin, TimelineForScheduleConcern

      public interface Schedule
      extends Identity

  Represent the scheduling of a `Task`.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.qi4j.api.entity.Identity

      `Identity.IdentityMixin`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `isTaskRunning()`
    `long` | `nextRun(long from)` Compute the next time this schedule is to be run.
    `String` | `presentationString()` Return a representation of the Schedule in a human understandable format.
    `Property<DateTime>` | `start()` The first run of this Schedule.
    `Association<Task>` | `task()`
    `void` | `taskCompletedSuccessfully()` Called directly after the `Runnable.run()` method has been completed and returned from the method normally.
    `void` | `taskCompletedWithException(RuntimeException ex)` Called directly after the `Runnable.run()` method has been completed but threw a RuntimeException.
    `void` | `taskStarting()` Called just before the `Runnable.run()` method is called.

    - ### Methods inherited from interface org.qi4j.api.entity.Identity

      `identity`

- - ### Method Detail

    - #### task

          Association<Task> task()

      Returns:
        The Association to the Task to be executed when it is time.

    - #### start

          @Immutable
          Property<DateTime> start()

      The first run of this Schedule.
      Returns:
        The property containing the first time this Schedule will be run.

    - #### taskStarting

          void taskStarting()

      Called just before the `Runnable.run()` method is called.

    - #### taskCompletedSuccessfully

          void taskCompletedSuccessfully()

      Called directly after the `Runnable.run()` method has been completed and returned from the method normally.

    - #### taskCompletedWithException

          void taskCompletedWithException(RuntimeException ex)

      Called directly after the `Runnable.run()` method has been completed but threw a RuntimeException.
      Parameters:
        `ex` -

    - #### isTaskRunning

          boolean isTaskRunning()

      Returns:
        True if the associated `Task` is currently running, false otherwise

    - #### nextRun

          long nextRun(long from)

      Compute the next time this schedule is to be run.
      Parameters:
        `from` - The starting time when to look for the next time it will run.
      Returns:
        The exact absolute time when this Schedule is to be run next time, or -1 if never

    - #### presentationString

          String presentationString()

      Return a representation of the Schedule in a human understandable format.
      Returns:
        A String representing this schedule.