|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.quartz.listeners.FilterAndBroadcastJobListener
public class FilterAndBroadcastJobListener
Holds a List of references to JobListener instances and broadcasts all events to them (in order) - if the event is not excluded via filtering (read on).
The broadcasting behavior of this listener to delegate listeners may be more convenient than registering all of the listeners directly with the Job, and provides the flexibility of easily changing which listeners get notified.
You may also register a number of Regular Expression patterns to match the events against. If one or more patterns are registered, the broadcast will only take place if the event applies to a job who's name/group matches one or more of the patterns.
addListener(org.quartz.JobListener)
,
removeListener(org.quartz.JobListener)
,
removeListener(String)
,
addJobNamePattern(String)
,
addJobGroupPattern(String)
Constructor Summary | |
---|---|
FilterAndBroadcastJobListener(java.lang.String name)
Construct an instance with the given name. |
|
FilterAndBroadcastJobListener(java.lang.String name,
java.util.List listeners)
Construct an instance with the given name, and List of listeners. |
Method Summary | |
---|---|
void |
addJobGroupPattern(java.lang.String regularExpression)
If one or more group patterns are specified, only events relating to jobs who's group matches the given regular expression pattern will be dispatched to the delegate listeners. |
void |
addJobNamePattern(java.lang.String regularExpression)
If one or more name patterns are specified, only events relating to jobs who's name matches the given regular expression pattern will be dispatched to the delegate listeners. |
void |
addListener(JobListener listener)
|
java.util.List |
getJobGroupPatterns()
|
java.util.List |
getJobNamePatterns()
|
java.util.List |
getListeners()
|
java.lang.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)
Called by the when a
is about to be executed (an associated
has occurred). |
void |
jobWasExecuted(JobExecutionContext 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(JobListener listener)
|
boolean |
removeListener(java.lang.String listenerName)
|
protected boolean |
shouldDispatch(JobExecutionContext context)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FilterAndBroadcastJobListener(java.lang.String name)
name
- the name of this instancepublic FilterAndBroadcastJobListener(java.lang.String name, java.util.List listeners)
name
- the name of this instancelisteners
- the initial List of JobListeners to broadcast to.Method Detail |
---|
public java.lang.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(java.lang.String listenerName)
public java.util.List getListeners()
public void addJobNamePattern(java.lang.String regularExpression)
regularExpression
- public java.util.List getJobNamePatterns()
public void addJobGroupPattern(java.lang.String regularExpression)
regularExpression
- public java.util.List getJobGroupPatterns()
protected boolean shouldDispatch(JobExecutionContext context)
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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |