|
|
Possible to link quartz jobs?
I have several quartz jobs set up via Spring that run in succession. Currently I have the times set based on when I think one job will end, and the next should start, with some buffer time added for safety. Is it possible to configure a quot;chainquot; where the next job will just automatically start when the prior job is finished?
You could create the chain yourself. As soon as a task finishes, it can create a new task that can run next. And when that task finished, it can create a new task.
You can use the TaskExecutor from Spring or java.util.concurrent.Executor (ThreadPoolExector). There also is a backport of the concurrency library for java 1.4.
pseudocode
Code:
class FirstJob implements Runnable{ public void run(){ ..do some heavy stuff secondExecutor.execute(new SecondJob()); }
}
class SecondJob implements Runnable{ public void run(){ thirdExecutor.execute(new ThirdJob()); }
}
class ThirdJob implements ....Thanks. It seems like you should be able to do this in the config, much in the way you configure a filter chain. I have one quartz job that's dependant on another, so if the first one fails, I don't want to proceed with the second.
(I haven't released any sources, but I have used it in a few projects). The site hasn't been updated in quite some time, but I'm planning to get the project up and running this time. The channels projects allows you to chain processes, but personally I think the abstraction for being usable as an out of the box workflow engine is too low. |
|