org.qi4j.library.scheduler

## Class SchedulerMixin

- java.lang.Object
- - org.qi4j.library.scheduler.SchedulerMixin

- All Implemented Interfaces:
    ServiceActivation, Scheduler

      public class SchedulerMixin
      extends Object
      implements Scheduler, ServiceActivation

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `SchedulerMixin.ScheduleRunner` Handle `Task`'s `UnitOfWork` and `TimelineRecord`s creation.

    - ### Nested classes/interfaces inherited from interface org.qi4j.api.service.ServiceActivation

      `ServiceActivation.ServiceActivator`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SchedulerMixin()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `activateService()` Called after ServiceComposite Activation.
    `static String` | `getSchedulesIdentity(SchedulerService service)`
    `void` | `passivateService()` Called before ServiceComposite Passivation.
    `Schedule` | `scheduleCron(Task task, String cronExpression, boolean durable)` Schedule a Task using a CronExpression.
    `Schedule` | `scheduleCron(Task task, String cronExpression, DateTime start, boolean durable)` Schedule a Task using a CronExpression starting at a given date.
    `Schedule` | `scheduleCron(Task task, String cronExpression, long initialDelay, boolean durable)` Schedule a Task using a CronExpression with a given initial delay in milliseconds.
    `Schedule` | `scheduleOnce(Task task, DateTime runAt, boolean durable)` Schedule a Task to be run after a given initial delay in seconds.
    `Schedule` | `scheduleOnce(Task task, int initialSecondsDelay, boolean durable)` Schedule a Task to be run after a given initial delay in seconds.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### SchedulerMixin

          public SchedulerMixin()

  - ### Method Detail

    - #### scheduleOnce

          public Schedule scheduleOnce(Task task,
                              int initialSecondsDelay,
                              boolean durable)

      Description copied from interface: `Scheduler`
      Schedule a Task to be run after a given initial delay in seconds.
      Specified by:
        `scheduleOnce` in interface `Scheduler`
      Parameters:
        `task` - Task to be scheduled once
        `initialSecondsDelay` - Initial delay the Task will be run after, in seconds
        `durable` - true if this Schedule should survive a restart.
      Returns:
        The newly created Schedule

    - #### scheduleOnce

          public Schedule scheduleOnce(Task task,
                              DateTime runAt,
                              boolean durable)

      Description copied from interface: `Scheduler`
      Schedule a Task to be run after a given initial delay in seconds.
      Specified by:
        `scheduleOnce` in interface `Scheduler`
      Parameters:
        `task` - Task to be scheduled once
        `runAt` - The future point in time when the Schedule will be run.
        `durable` - true if this Schedule should survive a restart.
      Returns:
        The newly created Schedule

    - #### scheduleCron

          public Schedule scheduleCron(Task task,
                              String cronExpression,
                              boolean durable)

      Description copied from interface: `Scheduler`
      Schedule a Task using a CronExpression.
      Specified by:
        `scheduleCron` in interface `Scheduler`
      Parameters:
        `task` - Task to be scheduled once
        `cronExpression` - CronExpression for creating the Schedule for the given Task
        `durable` - true if this Schedule should survive a restart.
      Returns:
        The newly created Schedule

    - #### scheduleCron

          public Schedule scheduleCron(Task task,
                              String cronExpression,
                              DateTime start,
                              boolean durable)

      Description copied from interface: `Scheduler`
      Schedule a Task using a CronExpression starting at a given date.
      Specified by:
        `scheduleCron` in interface `Scheduler`
      Parameters:
        `task` - Task to be scheduled once
        `cronExpression` - CronExpression for creating the Schedule for the given Task
        `start` - Date from which the Schedule will become active
        `durable` - true if this Schedule should survive a restart.
      Returns:
        The newly created Schedule

    - #### scheduleCron

          public Schedule scheduleCron(Task task,
                              String cronExpression,
                              long initialDelay,
                              boolean durable)

      Description copied from interface: `Scheduler`
      Schedule a Task using a CronExpression with a given initial delay in milliseconds.
      Specified by:
        `scheduleCron` in interface `Scheduler`
      Parameters:
        `task` - Task to be scheduled once
        `cronExpression` - CronExpression for creating the Schedule for the given Task
        `initialDelay` - Initial delay the Schedule will be active after, in milliseconds
        `durable` - true if this Schedule should survive a restart.
      Returns:
        The newly created Schedule

    - #### activateService

          public void activateService()
                               throws Exception

      Description copied from interface: `ServiceActivation`
      Called after ServiceComposite Activation.
      Specified by:
        `activateService` in interface `ServiceActivation`
      Throws:
        `Exception`

    - #### getSchedulesIdentity

          public static String getSchedulesIdentity(SchedulerService service)

    - #### passivateService

          public void passivateService()
                                throws Exception

      Description copied from interface: `ServiceActivation`
      Called before ServiceComposite Passivation.
      Specified by:
        `passivateService` in interface `ServiceActivation`
      Throws:
        `Exception`