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 void
addListener(JobListener listener)
java.util.List<JobListener>
getListeners()
java.lang.String
getName()
Get the name of theJobListener
.void
jobExecutionVetoed(JobExecutionContext context)
Called by the
when aScheduler
was about to be executed (an associatedJobDetail
has occurred), but aTrigger
vetoed it's execution.TriggerListener
void
jobToBeExecuted(JobExecutionContext context)
void
jobWasExecuted(JobExecutionContext context, JobExecutionException jobException)
boolean
removeListener(java.lang.String listenerName)
boolean
removeListener(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:JobListener
Get the name of the
JobListener
.- Specified by:
getName
in 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:JobListener
Called by the
when aScheduler
is about to be executed (an associatedJobDetail
has occurred).Trigger
This method will not be invoked if the execution of the Job was vetoed by a
.TriggerListener
- Specified by:
jobToBeExecuted
in interfaceJobListener
- See Also:
JobListener.jobExecutionVetoed(JobExecutionContext)
-
jobExecutionVetoed
public void jobExecutionVetoed(JobExecutionContext context)
Description copied from interface:JobListener
Called by the
when aScheduler
was about to be executed (an associatedJobDetail
has occurred), but aTrigger
vetoed it's execution.TriggerListener
- Specified by:
jobExecutionVetoed
in interfaceJobListener
- See Also:
JobListener.jobToBeExecuted(JobExecutionContext)
-
jobWasExecuted
public void jobWasExecuted(JobExecutionContext context, JobExecutionException jobException)
Description copied from interface:JobListener
Called by the
after aScheduler
has been executed, and be for the associatedJobDetail
Trigger
'striggered(xx)
method has been called.- Specified by:
jobWasExecuted
in interfaceJobListener
-
-