I am still playing around with quartz scheduler.I created the below job using
grails create-job ,what i am trying to do here is simple, that is create a
trigger and try to run the execute method.once this basic code runs i want to
create multiple triggers each with different cron schedule value, inside a for
loop(multiple triggers with different execution time) and run the execute
method and do sched.scheduleJob(triggerName)
over list of these triggers
import org.quartz.*
import org.quartz.Trigger
import static org.quartz.JobBuilder.*;
import static org.quartz.CronScheduleBuilder.*;
import static org.quartz.TriggerBuilder.*;
public class TrialJob
{
public static void main(String[] args)
{
JobDetail job = JobBuilder.newJob(TestJob.class).withIdentity("dummyJobName1","group11").build();
CronTrigger trigger = newTrigger().withIdentity("trigger","group1").withSchedule(cronSchedule("0 55 15 * * ?")).build();
Scheduler scheduler = new StdSchedulerFactory().getScheduler();
scheduler.scheduleJob(job,trigger);
scheduler.start();
//while(true){};
}
public static class TestJob implements Job
{
public void execute(JobExecutionContext context) throws JobExecutionException
{
println "inside execute "
}
}
}