public class BroadcastJobListener extends Object implements IJobListener
The broadcasting behavior of this listener to delegate listeners may be more convenient than registering all of the listeners directly with the Scheduler, and provides the flexibility of easily changing which listeners get notified.
addListener(com.helger.quartz.IJobListener),
removeListener(com.helger.quartz.IJobListener)| Constructor and Description |
|---|
BroadcastJobListener(String name)
Construct an instance with the given name.
|
BroadcastJobListener(String name,
List<IJobListener> listeners)
Construct an instance with the given name, and List of listeners.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(IJobListener listener) |
com.helger.commons.collection.impl.ICommonsList<IJobListener> |
getListeners() |
String |
getName()
Get the name of the
JobListener. |
void |
jobExecutionVetoed(IJobExecutionContext context)
Called by the
when a
was about to be executed
(an associated has occurred), but a
vetoed it's execution. |
void |
jobToBeExecuted(IJobExecutionContext context)
Called by the
when a
is about to be executed
(an associated has occurred). |
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. |
boolean |
removeListener(IJobListener listener) |
public BroadcastJobListener(@Nonnull String name)
name - the name of this instancepublic BroadcastJobListener(@Nonnull String name, List<IJobListener> listeners)
name - the name of this instancelisteners - the initial List of JobListeners to broadcast to.@Nonnull public String getName()
IJobListener
Get the name of the JobListener.
getName in interface IJobListenerpublic void addListener(IJobListener listener)
public boolean removeListener(IJobListener listener)
@Nonnull @ReturnsMutableCopy public com.helger.commons.collection.impl.ICommonsList<IJobListener> getListeners()
public void jobToBeExecuted(IJobExecutionContext context)
IJobListener
Called by the when a
IScheduler is about to be executed
(an associated IJobDetail has occurred).
ITrigger
This method will not be invoked if the execution of the Job was vetoed by a
.
ITriggerListener
jobToBeExecuted in interface IJobListenerIJobListener.jobExecutionVetoed(IJobExecutionContext)public void jobExecutionVetoed(IJobExecutionContext context)
IJobListener
Called by the when a
IScheduler was about to be executed
(an associated IJobDetail has occurred), but a
ITrigger vetoed it's execution.
ITriggerListener
jobExecutionVetoed in interface IJobListenerIJobListener.jobToBeExecuted(IJobExecutionContext)public void jobWasExecuted(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.