I would like to create a generic job class which takes some arguments instead of creating job class before hand?
All the settings are stored in a db so we could just call "refresh" which drops all the jobs and re-registers them from the database.
I would like to create a generic job class which takes some arguments instead of creating job class before hand?
All the settings are stored in a db so we could just call "refresh" which drops all the jobs and re-registers them from the database.
You can specify arguments for your job in the JobExecutionContext
, e.g. injected by spring.
The "Spring Recipes" book has a very simple example for demonstrating using Quartz. I recommend taking a look.
You can reuse the logic (job) and parametrize it by using JobDataMap. You can have as many triggers and jobs as you want. Just remember the rule that one job can have many triggers but not vice versa.