public class ExecutorPluginScheduler extends Object implements PluginScheduler
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_POOL_SIZE |
| Constructor and Description |
|---|
ExecutorPluginScheduler() |
ExecutorPluginScheduler(ScheduledExecutorService executor) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
cancelJob(Future<?> job) |
void |
scheduleJob(String jobKey,
Class<? extends PluginJob> jobClass,
Map<String,Object> jobDataMap,
Date startTime,
long repeatInterval)
Schedule the given job.
|
void |
unscheduleJob(String jobKey)
Unschedule the given job.
|
public static final int DEFAULT_POOL_SIZE
public ExecutorPluginScheduler()
public ExecutorPluginScheduler(ScheduledExecutorService executor)
public void scheduleJob(String jobKey, Class<? extends PluginJob> jobClass, Map<String,Object> jobDataMap, Date startTime, long repeatInterval)
PluginScheduler WARNING: it is very important not to try to call this method until the underlying application
is fully started. You should implement LifecycleAware and call scheduleJob()
only on LifecycleAware.onStart()
scheduleJob in interface PluginSchedulerjobKey - A unique key of the jobjobClass - The class for the jobjobDataMap - Any data that needs to be passed to the job. This map instance will always be the same
instance that is given to the job when it executes.startTime - The time the job is to start.repeatInterval - How long the interval between repeats, in milliseconds. Note, some implementationspublic void unscheduleJob(String jobKey)
PluginSchedulerunscheduleJob in interface PluginSchedulerjobKey - The job key to unscheduleprotected void cancelJob(Future<?> job)
Copyright © 2015 Atlassian. All rights reserved.