I use the Grails Quartz plugin and want to schedule my tasks using a software-generated trigger. I do not know in advance what the execution interval will be. I want the task to be carried out endlessly.
The docs provide some examples on how to schedule / run tasks:
== Dynamic work planning ==
Starting with version 0.4.1, you have the ability to dynamically schedule tasks.
The following methods are available:
MyJob.schedule(String cronExpression, Map params?) Creates a cron trigger;MyJob.schedule(Long repeatInterval, Integer repeatCount?, Map params?) Creates a simple trigger: repeats the task repeatCount + 1 times with a delay of repeatInterval milliseconds;MyJob.schedule(Date scheduleDate, Map params?) one task to a specific date;MyJob.schedule(Trigger trigger) schedules the task using a custom trigger;MyJob.triggerNow(Map params?) job.
Each method (except one for a custom trigger) takes an optional argument "params". You can use it to transfer some data to your work, and then access it from the job.
Print Version Grails 1.3.7 Quartz Plugin version 0.4.2
So why does MyJob.schedule(Trigger trigger) not accept parameters? And how can I achieve what I want using a custom trigger and map or options for the job?
David source share