Package play.jobs

Class JobsPlugin

  • All Implemented Interfaces:
    java.lang.Comparable<PlayPlugin>

    public class JobsPlugin
    extends PlayPlugin
    • Field Detail

      • executor

        public static java.util.concurrent.ScheduledThreadPoolExecutor executor
      • scheduledJobs

        public static java.util.List<Job<?>> scheduledJobs
    • Constructor Detail

      • JobsPlugin

        public JobsPlugin()
    • Method Detail

      • getStatus

        public java.lang.String getStatus()
        Description copied from class: PlayPlugin
        Return the plugin status
        Overrides:
        getStatus in class PlayPlugin
        Returns:
        the plugin status
      • onApplicationStart

        public void onApplicationStart()
        Description copied from class: PlayPlugin
        Called at application start (and at each reloading) Time to start stateful things.
        Overrides:
        onApplicationStart in class PlayPlugin
      • scheduleForCRON

        public static <V> void scheduleForCRON​(Job<V> job)
      • onApplicationStop

        public void onApplicationStop()
        Description copied from class: PlayPlugin
        Called at application stop (and before each reloading) Time to shutdown stateful things.
        Overrides:
        onApplicationStop in class PlayPlugin
      • extractUnderlyingCallable

        public java.lang.Object extractUnderlyingCallable​(java.util.concurrent.FutureTask<?> futureTask)
        Try to discover what is hidden under a FutureTask (hack)

        Field sync first, if not present will try field callable

        Parameters:
        futureTask - The given tack
        Returns:
        Field sync first, if not present will try field callable
      • runScheduledJobOnceNow

        public static java.util.concurrent.Future<?> runScheduledJobOnceNow​(Job<?> job)