Class BroadcastJobListener
- java.lang.Object
-
- org.quartz.listeners.BroadcastJobListener
-
- All Implemented Interfaces:
JobListener
public class BroadcastJobListener extends java.lang.Object implements JobListener
Holds a List of references to JobListener instances and broadcasts all events to them (in order).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.
- Author:
- James House (jhouse AT revolition DOT net)
- See Also:
addListener(org.quartz.JobListener),removeListener(org.quartz.JobListener),removeListener(String)
-
-
Constructor Summary
Constructors Constructor Description BroadcastJobListener(java.lang.String name)Construct an instance with the given name.BroadcastJobListener(java.lang.String name, java.util.List<JobListener> listeners)Construct an instance with the given name, and List of listeners.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddListener(JobListener listener)java.util.List<JobListener>getListeners()java.lang.StringgetName()Get the name of theJobListener.voidjobExecutionVetoed(JobExecutionContext context)Called by thewhen aSchedulerwas about to be executed (an associatedJobDetailhas occurred), but aTriggervetoed it's execution.TriggerListenervoidjobToBeExecuted(JobExecutionContext context)voidjobWasExecuted(JobExecutionContext context, JobExecutionException jobException)booleanremoveListener(java.lang.String listenerName)booleanremoveListener(JobListener listener)
-
-
-
Constructor Detail
-
BroadcastJobListener
public BroadcastJobListener(java.lang.String name)
Construct an instance with the given name. (Remember to add some delegate listeners!)- Parameters:
name- the name of this instance
-
BroadcastJobListener
public BroadcastJobListener(java.lang.String name, java.util.List<JobListener> listeners)Construct an instance with the given name, and List of listeners.- Parameters:
name- the name of this instancelisteners- the initial List of JobListeners to broadcast to.
-
-
Method Detail
-
getName
public java.lang.String getName()
Description copied from interface:JobListenerGet the name of the
JobListener.- Specified by:
getNamein interfaceJobListener
-
addListener
public void addListener(JobListener listener)
-
removeListener
public boolean removeListener(JobListener listener)
-
removeListener
public boolean removeListener(java.lang.String listenerName)
-
getListeners
public java.util.List<JobListener> getListeners()
-
jobToBeExecuted
public void jobToBeExecuted(JobExecutionContext context)
Description copied from interface:JobListenerCalled by the
when aScheduleris about to be executed (an associatedJobDetailhas occurred).TriggerThis method will not be invoked if the execution of the Job was vetoed by a
.TriggerListener- Specified by:
jobToBeExecutedin interfaceJobListener- See Also:
JobListener.jobExecutionVetoed(JobExecutionContext)
-
jobExecutionVetoed
public void jobExecutionVetoed(JobExecutionContext context)
Description copied from interface:JobListenerCalled by the
when aSchedulerwas about to be executed (an associatedJobDetailhas occurred), but aTriggervetoed it's execution.TriggerListener- Specified by:
jobExecutionVetoedin interfaceJobListener- See Also:
JobListener.jobToBeExecuted(JobExecutionContext)
-
jobWasExecuted
public void jobWasExecuted(JobExecutionContext context, JobExecutionException jobException)
Description copied from interface:JobListenerCalled by the
after aSchedulerhas been executed, and be for the associatedJobDetailTrigger'striggered(xx)method has been called.- Specified by:
jobWasExecutedin interfaceJobListener
-
-