bmani77
neo
Joined: 01/29/2010 04:17:51
Messages: 2
Offline
|
I can schedule a job using the following code, this work fine if the job is scheduled for future date and time. In case if am trying to execute previous day job or now job then control is not coming out from this function “scheduleJob “ until the job finished by the Quartz scheduler.
public void scheduleJob(String jobReference, Date timeStamp ) throws Exception
{
sched.scheduleJob(new JobDetail(jobReference, jobReference , MyJob.class,
new SimpleTrigger(jobReference, jobReference, timeStamp));
System.out.println("Job Scheduled and executing");
}
|
jhouse
seraphim
Joined: 11/06/2009 15:29:56
Messages: 1703
Offline
|
As soon as the data is in the scheduler, the scheduler's threads will start acting on it -- if the fire time has already arrived, there will be no delay.
That means those threads may execute the job before the thread that called scheduleJob() is able to get CPU time to move on and execute your system.out.println statement.
Nothing weird going on, just standard multi-threaded behavior.
|