This content has been marked as final.
Show 3 replies
-
1. Re: Quartz scheduler - how stop jobs firing concurrently
kapitanpetko Oct 14, 2009 2:40 PM (in response to bedek_bedkowski)QuartzTriggerHandle pauses/resumes the job's trigger, shouldn't matter what the Job is. Check out the source, it is quite simple, just
a thin wrapper around Quartz methods.HTH
-
2. Re: Quartz scheduler - how stop jobs firing concurrently
bedek_bedkowski Oct 14, 2009 4:33 PM (in response to bedek_bedkowski)Hi,
I assume that this peace of code which needs to be changes (marked: change to StatefulJob):public static class QuartzJob implements Job /* change to StatefulJob */ { private Asynchronous async; public QuartzJob() { } public void execute(JobExecutionContext context) throws JobExecutionException { JobDataMap dataMap = context.getJobDetail().getJobDataMap(); async = (Asynchronous)dataMap.get("async"); QuartzTriggerHandle handle = new QuartzTriggerHandle(context.getTrigger().getName()); try { async.execute(handle); } catch (Exception e) { async.handleException(e, handle); } } }
-
3. Re: Quartz scheduler - how stop jobs firing concurrently
kapitanpetko Oct 15, 2009 3:28 AM (in response to bedek_bedkowski)Something like that. If you are OK with all your jobs being stateful, you could override Seam's QuartzDispatcher and use StaefulJob
for ever async method. Not sure what impact on performance etc. this will have. Or, you could schedule your jobs using the Quartz API directly,
without using @Asynchronous.