Package play.jobs
Class JobsPlugin
- java.lang.Object
-
- play.PlayPlugin
-
- play.jobs.JobsPlugin
-
- All Implemented Interfaces:
java.lang.Comparable<PlayPlugin>
public class JobsPlugin extends PlayPlugin
-
-
Field Summary
Fields Modifier and Type Field Description static java.util.concurrent.ScheduledThreadPoolExecutorexecutorstatic java.util.List<Job<?>>scheduledJobs-
Fields inherited from class play.PlayPlugin
index
-
-
Constructor Summary
Constructors Constructor Description JobsPlugin()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterApplicationStart()Called after the application start.java.lang.ObjectextractUnderlyingCallable(java.util.concurrent.FutureTask<?> futureTask)Try to discover what is hidden under a FutureTask (hack)java.lang.StringgetStatus()Return the plugin statusvoidonApplicationStart()Called at application start (and at each reloading) Time to start stateful things.voidonApplicationStop()Called at application stop (and before each reloading) Time to shutdown stateful things.static java.util.concurrent.Future<?>runScheduledJobOnceNow(Job<?> job)static <V> voidscheduleForCRON(Job<V> job)-
Methods inherited from class play.PlayPlugin
afterActionInvocation, afterInvocation, beforeActionInvocation, beforeInvocation, bind, compareTo, detectChange, disable, getJsonStatus, getMessage, isEnabled, loadTemplate, onActionInvocationException, onActionInvocationFinally, onActionInvocationResult, onActionInvocationResult, onConfigurationRead, onInvocationSuccess, onJobInvocationException, onJobInvocationFinally, onLoad, rawInvocation, routeRequest
-
-
-
-
Field Detail
-
executor
public static java.util.concurrent.ScheduledThreadPoolExecutor executor
-
scheduledJobs
public static java.util.List<Job<?>> scheduledJobs
-
-
Method Detail
-
getStatus
public java.lang.String getStatus()
Description copied from class:PlayPluginReturn the plugin status- Overrides:
getStatusin classPlayPlugin- Returns:
- the plugin status
-
afterApplicationStart
public void afterApplicationStart()
Description copied from class:PlayPluginCalled after the application start.- Overrides:
afterApplicationStartin classPlayPlugin
-
onApplicationStart
public void onApplicationStart()
Description copied from class:PlayPluginCalled at application start (and at each reloading) Time to start stateful things.- Overrides:
onApplicationStartin classPlayPlugin
-
scheduleForCRON
public static <V> void scheduleForCRON(Job<V> job)
-
onApplicationStop
public void onApplicationStop()
Description copied from class:PlayPluginCalled at application stop (and before each reloading) Time to shutdown stateful things.- Overrides:
onApplicationStopin classPlayPlugin
-
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)
-
-