com.atlassian.sal.core.scheduling
Class ExecutorPluginScheduler

java.lang.Object
  extended by com.atlassian.sal.core.scheduling.ExecutorPluginScheduler
All Implemented Interfaces:
PluginScheduler

public class ExecutorPluginScheduler
extends Object
implements PluginScheduler

Plugin scheduler that uses java.util.concurrent.Executor.


Field Summary
static int DEFAULT_POOL_SIZE
           
 
Constructor Summary
ExecutorPluginScheduler()
           
ExecutorPluginScheduler(ScheduledExecutorService executor)
           
 
Method Summary
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_POOL_SIZE

public static final int DEFAULT_POOL_SIZE
See Also:
Constant Field Values
Constructor Detail

ExecutorPluginScheduler

public ExecutorPluginScheduler()

ExecutorPluginScheduler

public ExecutorPluginScheduler(ScheduledExecutorService executor)
Method Detail

scheduleJob

public void scheduleJob(String jobKey,
                        Class<? extends PluginJob> jobClass,
                        Map<String,Object> jobDataMap,
                        Date startTime,
                        long repeatInterval)
Description copied from interface: PluginScheduler
Schedule the given job.

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()

Specified by:
scheduleJob in interface PluginScheduler
Parameters:
jobKey - A unique key of the job
jobClass - The class for the job
jobDataMap - 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 implementations

unscheduleJob

public void unscheduleJob(String jobKey)
Description copied from interface: PluginScheduler
Unschedule the given job. If the job doesn't exist then IllegalArgumentException will be thrown.

Specified by:
unscheduleJob in interface PluginScheduler
Parameters:
jobKey - The job key to unschedule

cancelJob

protected void cancelJob(Future<?> job)


Copyright © 2015 Atlassian. All rights reserved.