Using the Scheduler Control

The Scheduler Control provides a single interface com.bea.powertoys.scheduler.Scheduler with only one method.
void schedule(java.util.Date startTime, java.util.Date endTime, int repeatCount, long repeatInterval, java.lang.Class jobClass, java.util.Map contextMap) throws org.quartz.SchedulerException;

Input parameters

java.util.Date startTime Scheduler will start executing job(s) at this time. If 'startTime' is earlier than the current execution time, then the later value becomes the 'startTime'.
java.util.Date endTime Scheduler will stop executing job(s) at this time (if provided). This can also be null. If endTime isearlier than the 'startTime', then 'endTime' is set to null.
int repeatCount Defines, how many times the job should be repeated. Number of times  job executed would be repeatCount + 1. If 'endTime' is provided then 'repeatCount' is ignored.
long repeatInterval Defines, the time interval (in ms) between job executions.
java.lang.Class jobClass Class object of your job class. Instance of this job gets executed by the schduler. Your job must be a instance of org.quartz.Job interface.
java.util.Map contextMap Defines, key-value pair for org.quartz.JobDataMap.

For detailed description please refer here


Invoking the control

The scheduler control method is invoked as follows:
java.util.Date startDate = new Date();
java.util.Date endDate = null;
int repeatCount = 10;
long repeatInterval = 2000;
Class jobClass = MyJob.class;
java.util.Map contextMap = new HashMap();
contextMap.put("key" , "value");

control.schedule(startDate, endDate,repeatCount,repeatInterval,jobClass,contextMap);

Note

The Scheduler control only provides basic functionality of Quartz job scheduling system. To learn more about Quartz, please refer here.

Also, scheduler control uses org.quartz.SimpleTrigger

The Java Page Flow sample that accompanies the Scheduler Control demonstrates how to use the control.