[Logo] Terracotta Discussion Forums (LEGACY READ-ONLY ARCHIVE)
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
[Expert]
Stop the trigger1 before trigger2 going to start  XML
Forum Index -> Quartz
Author Message
icearul

neo

Joined: 01/19/2010 02:45:41
Messages: 1
Offline

Quartz Scheduler is configured to run every one hour. At 10 am thread1 starts and it is processing. At 11 am, thread2 starts but thread1 is not yet complete. Is there a possibility to identify that thread1 is not complete? After identifying we should be able to do either of these options
a. Do not start thread2 and leave thread1 to continue.
b. Kill thread1 and let thread2 to start.

Can anyone help me...

How can I achieve this

jhouse

seraphim
[Avatar]
Joined: 11/06/2009 15:29:56
Messages: 1703
Offline


If thread1 and thread2 can be the same job type, then making that job a StatefulJob would achieve option "a".

Otherwise you'll have to program some "smarts" to achieve the behavior.


There are a few different approaches to take, but you probably want to implement a component that is a both a TriggerListener and a JobListener (and possibly is a scheduler plugin as well), that keeps track of your particular job of interest (it will be notified when it starts, and when it ends) - and it will have the opportunity to stop the second execution via the "vetoJobExecution" method.


james
 
Forum Index -> Quartz
Go to:   
Powered by JForum 2.1.7 © JForum Team