
|
If you were logged in you would be able to see more operations.
|
|
|
|
Environment:
|
WebSphere v5.0
|
|
|
Previously it was possible to schedule a cron job to start immediately, or at some specified time today, but now it seems Quartz ignores the startTime parameter and always calculates the first fire time as 00:00:00 the next day. Here is a sample trace output from the test excerpt below:
[2/09/04 15:58:33:718 EST] SchedulerHelper testJobGroup.testJob will run at: Fri Sep 03 00:00:00 EST 2004 & repeat using expression: 0/10 0 0 * * ?
To add to the mystery the job initialiser plug-in seems able to schedule cron jobs with an immediate start time!
public void testQuartzSchedulerCronJob() throws Exception
{
JobDataMap map = new JobDataMap();
map.put("testKey", "testValue");
long startMillis = System.currentTimeMillis();
SchedulerHelper schedulerHelper = new SchedulerHelper();
JobDetail job = new JobDetail("testJob", "testJobGroup", DummyJob1.class, false, true, true);
job.setJobDataMap(map);
CronTrigger cronTrigger = new CronTrigger("testTrigger", "testTriggerGroup", "testJob", "testJobGroup", "0/10 0 0 * * ?");
// Also unsuccessfully tried the following:
//CronTrigger cronTrigger = new CronTrigger("test2Trigger", "test2TriggerGroup", "test2Job", "test2JobGroup", new Date(), null, "0/10 0 0 ? * *");
//CronTrigger cronTrigger = new CronTrigger("test2Trigger", "test2TriggerGroup", "test2Job", "test2JobGroup", new Date(System.currentTimeMillis() + 10000), null, "0/10 0 0 ? * *");
scheduleTestTrigger(cronTrigger, monitor);
Date date = SchedulerHelper.getScheduler().scheduleJob(job, cronTrigger);
logger.info(job.getFullName() + " will run at: " + date + " & repeat using expression: " + cronTrigger.getCronExpression());
}
|
|
Description
|
Previously it was possible to schedule a cron job to start immediately, or at some specified time today, but now it seems Quartz ignores the startTime parameter and always calculates the first fire time as 00:00:00 the next day. Here is a sample trace output from the test excerpt below:
[2/09/04 15:58:33:718 EST] SchedulerHelper testJobGroup.testJob will run at: Fri Sep 03 00:00:00 EST 2004 & repeat using expression: 0/10 0 0 * * ?
To add to the mystery the job initialiser plug-in seems able to schedule cron jobs with an immediate start time!
public void testQuartzSchedulerCronJob() throws Exception
{
JobDataMap map = new JobDataMap();
map.put("testKey", "testValue");
long startMillis = System.currentTimeMillis();
SchedulerHelper schedulerHelper = new SchedulerHelper();
JobDetail job = new JobDetail("testJob", "testJobGroup", DummyJob1.class, false, true, true);
job.setJobDataMap(map);
CronTrigger cronTrigger = new CronTrigger("testTrigger", "testTriggerGroup", "testJob", "testJobGroup", "0/10 0 0 * * ?");
// Also unsuccessfully tried the following:
//CronTrigger cronTrigger = new CronTrigger("test2Trigger", "test2TriggerGroup", "test2Job", "test2JobGroup", new Date(), null, "0/10 0 0 ? * *");
//CronTrigger cronTrigger = new CronTrigger("test2Trigger", "test2TriggerGroup", "test2Job", "test2JobGroup", new Date(System.currentTimeMillis() + 10000), null, "0/10 0 0 ? * *");
scheduleTestTrigger(cronTrigger, monitor);
Date date = SchedulerHelper.getScheduler().scheduleJob(job, cronTrigger);
logger.info(job.getFullName() + " will run at: " + date + " & repeat using expression: " + cronTrigger.getCronExpression());
}
|
Show » |
|