|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.quartz.listeners.BroadcastTriggerListener
public class BroadcastTriggerListener
Holds a List of references to TriggerListener 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.
addListener(org.quartz.TriggerListener)
,
removeListener(org.quartz.TriggerListener)
,
removeListener(String)
Constructor Summary | |
---|---|
BroadcastTriggerListener(String name)
Construct an instance with the given name. |
|
BroadcastTriggerListener(String name,
List<TriggerListener> listeners)
Construct an instance with the given name, and List of listeners. |
Method Summary | |
---|---|
void |
addListener(TriggerListener listener)
|
List<TriggerListener> |
getListeners()
|
String |
getName()
Get the name of the TriggerListener . |
boolean |
removeListener(String listenerName)
|
boolean |
removeListener(TriggerListener listener)
|
void |
triggerComplete(Trigger trigger,
JobExecutionContext context,
Trigger.CompletedExecutionInstruction 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(Trigger trigger,
JobExecutionContext context)
Called by the when a
has fired, and it's associated
is about to be executed. |
void |
triggerMisfired(Trigger trigger)
Called by the when a
has misfired. |
boolean |
vetoJobExecution(Trigger trigger,
JobExecutionContext context)
Called by the when a
has fired, and it's associated
is about to be executed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BroadcastTriggerListener(String name)
name
- the name of this instancepublic BroadcastTriggerListener(String name, List<TriggerListener> listeners)
name
- the name of this instancelisteners
- the initial List of TriggerListeners to broadcast to.Method Detail |
---|
public String getName()
TriggerListener
Get the name of the TriggerListener
.
getName
in interface TriggerListener
public void addListener(TriggerListener listener)
public boolean removeListener(TriggerListener listener)
public boolean removeListener(String listenerName)
public List<TriggerListener> getListeners()
public void triggerFired(Trigger trigger, JobExecutionContext context)
TriggerListener
Called by the
when a Scheduler
has fired, and it's associated Trigger
is about to be executed.
JobDetail
It is called before the vetoJobExecution(..)
method of this
interface.
triggerFired
in interface TriggerListener
trigger
- The Trigger
that has fired.context
- The JobExecutionContext
that will be passed to
the Job
'sexecute(xx)
method.public boolean vetoJobExecution(Trigger trigger, JobExecutionContext context)
TriggerListener
Called by the
when a Scheduler
has fired, and it's associated Trigger
is about to be executed. If the implementation vetos the execution (via
returning JobDetail
true
), the job's execute method will not be called.
It is called after the triggerFired(..)
method of this
interface.
vetoJobExecution
in interface TriggerListener
trigger
- The Trigger
that has fired.context
- The JobExecutionContext
that will be passed to
the Job
'sexecute(xx)
method.public void triggerMisfired(Trigger trigger)
TriggerListener
Called by the
when a Scheduler
has misfired.
Trigger
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 TriggerListener
trigger
- The Trigger
that has misfired.public void triggerComplete(Trigger trigger, JobExecutionContext context, Trigger.CompletedExecutionInstruction triggerInstructionCode)
TriggerListener
Called by the
when a Scheduler
has fired, it's associated Trigger
has been executed, and it's JobDetail
triggered(xx)
method has been
called.
triggerComplete
in interface TriggerListener
trigger
- 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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |