public class BroadcastTriggerListener extends Object implements ITriggerListener
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.ITriggerListener),
removeListener(com.helger.quartz.ITriggerListener)| Constructor and Description |
|---|
BroadcastTriggerListener(String name)
Construct an instance with the given name.
|
BroadcastTriggerListener(String name,
Iterable<? extends ITriggerListener> listeners)
Construct an instance with the given name, and List of listeners.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(ITriggerListener listener) |
com.helger.commons.collection.impl.ICommonsList<ITriggerListener> |
getListeners() |
String |
getName()
Get the name of the
TriggerListener. |
boolean |
removeListener(ITriggerListener listener) |
void |
triggerComplete(ITrigger trigger,
IJobExecutionContext context,
ITrigger.ECompletedExecutionInstruction triggerInstructionCode)
Called by the
when a
has fired, it's associated
has been executed, and
it's triggered(xx) method has been called. |
void |
triggerFired(ITrigger trigger,
IJobExecutionContext context)
Called by the
when a
has fired, and it's associated
is about to be executed. |
void |
triggerMisfired(ITrigger trigger)
Called by the
when a
has misfired. |
boolean |
vetoJobExecution(ITrigger trigger,
IJobExecutionContext context)
Called by the
when a
has fired, and it's associated
is about to be executed. |
public BroadcastTriggerListener(@Nonnull String name)
name - the name of this instancepublic BroadcastTriggerListener(@Nonnull String name, Iterable<? extends ITriggerListener> listeners)
name - the name of this instancelisteners - the initial List of TriggerListeners to broadcast to.@Nonnull public String getName()
ITriggerListenerTriggerListener.getName in interface ITriggerListenerpublic void addListener(@Nonnull ITriggerListener listener)
public boolean removeListener(ITriggerListener listener)
@Nonnull @ReturnsMutableCopy public com.helger.commons.collection.impl.ICommonsList<ITriggerListener> getListeners()
public void triggerFired(ITrigger trigger, IJobExecutionContext context)
ITriggerListener
Called by the when a
IScheduler has fired, and it's associated
ITrigger is about to be executed.
IJobDetail
It is called before the vetoJobExecution(..) method of this
interface.
triggerFired in interface ITriggerListenertrigger - The Trigger that has fired.context - The JobExecutionContext that will be passed to the
Job'sexecute(xx) method.public boolean vetoJobExecution(ITrigger trigger, IJobExecutionContext context)
ITriggerListener
Called by the when a
IScheduler has fired, and it's associated
ITrigger is about to be executed.
If the implementation vetos the execution (via returning
IJobDetailtrue), the job's execute method will not be called.
It is called after the triggerFired(..) method of this
interface.
vetoJobExecution in interface ITriggerListenertrigger - The Trigger that has fired.context - The JobExecutionContext that will be passed to the
Job'sexecute(xx) method.public void triggerMisfired(ITrigger trigger)
ITriggerListener
Called by the when a
IScheduler has misfired.
ITrigger
Consideration should be given to how much time is spent in this method, as it will affect all triggers that are misfiring. If you have lots of triggers misfiring at once, it could be an issue it this method does a lot.
triggerMisfired in interface ITriggerListenertrigger - The Trigger that has misfired.public void triggerComplete(ITrigger trigger, IJobExecutionContext context, ITrigger.ECompletedExecutionInstruction triggerInstructionCode)
ITriggerListener
Called by the when a
IScheduler has fired, it's associated
ITrigger has been executed, and
it's IJobDetailtriggered(xx) method has been called.
triggerComplete in interface ITriggerListenertrigger - The Trigger that was fired.context - The JobExecutionContext that was passed to the
Job'sexecute(xx) method.triggerInstructionCode - the result of the call on the
Trigger'striggered(xx) method.Copyright © 2016–2021 Philip Helger. All rights reserved.