Quartz - associating JobDataMap with trigger
I'm a new Spring user so please forgive my ignorance if what I ask may be trivial or basic. In my applicationContext.xml, I would like to define one job and associate multiple triggers with that job. The motivation behind this is to define custom attributes for triggers and at the same time using common metadata defined at the job level. The following syntax is more than likely incorrect, but really illustrates what I need.
<bean name="hfsIndexJob" class="org.springframework.scheduling.quartz.JobDe tailBean">
<property name="jobClass" value="com.haydrian.mgmt.struts.util.HfsIndexingJo b"/>
<entry key="timeToLive" value="3600000"/>
<bean id="cronTriggerHfsIndex" class="org.springframework.scheduling.quartz.CronT riggerBean">
<property name="jobDetail" ref="hfsIndexJob"/>
<!-- run every night at 9:15 PM -->
<property name="cronExpression" value="0 15 21 * * ?"/>
<!-- I want to be able to extend the JobDataMap so that the trigger sees these additional properties. I don't think this is the correct syntax though -->
<entry key="dailyIndexingScript" value="/svt/apps/hfs/daily_reindex.sh"/>
<entry key="weeklyIndexingScript" value="/svt/apps/hfs/weekly_reindex.sh"/>
<entry key="dayOfWeekToRunWeeklyJob" value="7"/>
More JobDetailBeans needed
Create a new JobDetailBean (or two, three ....) with same JobClass and create a new Crontrigger for this bean. In this new JobDetailBean you can give more values in JobDataMap. So you have two Triggers with different JobData using same JobClass.
JobDetailBean will be triggered through a Crontrigger --> JobDetailBean creates new Instance of configured JobClass and puts JobData in this created instance (so you has to have setter-methods for this values).
After that, execute the Job.
Quartz trigger - setting up run-time params - THANKS!!
Thanks very much for your help. I apologize for taking so long to respond. This did work very well.