public class JobChainingJobListener extends Object implements IJobListener
Generally an instance of this listener would be registered as a global job listener, rather than being registered directly to a given job.
If for some reason there is a failure creating the trigger for the follow-up job (which would generally only be caused by a rare serious failure in the system, or the non-existence of the follow-up job), an error messsage is logged, but no other action is taken. If you need more rigorous handling of the error, consider scheduling the triggering of the flow-up job within your job itself.
| Constructor and Description |
|---|
JobChainingJobListener(String name)
Construct an instance with the given name.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addJobChainLink(JobKey firstJob,
JobKey secondJob)
Add a chain mapping - when the Job identified by the first key completes
the job identified by the second key will be triggered.
|
String |
getName()
Get the name of the
JobListener. |
void |
jobWasExecuted(IJobExecutionContext context,
JobExecutionException jobException)
Called by the
after a
has been executed, and be
for the associated Trigger's triggered(xx) method
has been called. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitjobExecutionVetoed, jobToBeExecuted@Nonnull public String getName()
IJobListener
Get the name of the JobListener.
getName in interface IJobListenerpublic void addJobChainLink(JobKey firstJob, JobKey secondJob)
firstJob - a JobKey with the name and group of the first jobsecondJob - a JobKey with the name and group of the follow-up jobpublic void jobWasExecuted(@Nonnull IJobExecutionContext context, JobExecutionException jobException)
IJobListener
Called by the after a
IScheduler has been executed, and be
for the associated IJobDetailTrigger's triggered(xx) method
has been called.
jobWasExecuted in interface IJobListenerCopyright © 2016–2021 Philip Helger. All rights reserved.