public class BroadcastJobListener extends Object implements JobListener
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(org.quartz.JobListener)
,
removeListener(org.quartz.JobListener)
,
removeListener(String)
Constructor and Description |
---|
BroadcastJobListener(String name)
Construct an instance with the given name.
|
BroadcastJobListener(String name,
List<JobListener> listeners)
Construct an instance with the given name, and List of listeners.
|
Modifier and Type | Method and Description |
---|---|
void |
addListener(JobListener listener) |
List<JobListener> |
getListeners() |
String |
getName()
Get the name of the
JobListener . |
void |
jobExecutionVetoed(JobExecutionContext context)
Called by the
when a
was about to be executed (an associated
has occurred), but a vetoed it's
execution. |
void |
jobToBeExecuted(JobExecutionContext context)
|
void |
jobWasExecuted(JobExecutionContext context,
JobExecutionException jobException)
|
boolean |
removeListener(JobListener listener) |
boolean |
removeListener(String listenerName) |
public BroadcastJobListener(String name)
name
- the name of this instancepublic BroadcastJobListener(String name, List<JobListener> listeners)
name
- the name of this instancelisteners
- the initial List of JobListeners to broadcast to.public String getName()
JobListener
Get the name of the JobListener
.
getName
in interface JobListener
public void addListener(JobListener listener)
public boolean removeListener(JobListener listener)
public boolean removeListener(String listenerName)
public List<JobListener> getListeners()
public void jobToBeExecuted(JobExecutionContext context)
JobListener
Called by the
when a Scheduler
is about to be executed (an associated JobDetail
has occurred).
Trigger
This method will not be invoked if the execution of the Job was vetoed
by a
.
TriggerListener
jobToBeExecuted
in interface JobListener
JobListener.jobExecutionVetoed(JobExecutionContext)
public void jobExecutionVetoed(JobExecutionContext context)
JobListener
Called by the
when a Scheduler
was about to be executed (an associated JobDetail
has occurred), but a Trigger
vetoed it's
execution.
TriggerListener
jobExecutionVetoed
in interface JobListener
JobListener.jobToBeExecuted(JobExecutionContext)
public void jobWasExecuted(JobExecutionContext context, JobExecutionException jobException)
JobListener
Called by the
after a Scheduler
has been executed, and be for the associated JobDetail
Trigger
's
triggered(xx)
method has been called.
jobWasExecuted
in interface JobListener
Copyright 2001-2019, Terracotta, Inc.