Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.quartz.listeners
Class FilterAndBroadcastTriggerListener

    java.lang.Object
      org.quartz.listeners.FilterAndBroadcastTriggerListener

All Implemented Interfaces:
  TriggerListener

    public class FilterAndBroadcastTriggerListener

extends Object
implements TriggerListener

Holds a List of references to TriggerListener 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 Trigger, 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 trigger who's name/group matches one or more of the patterns.

Author:
  James House (jhouse AT revolition DOT net)
See Also:
  `addListener(org.quartz.TriggerListener)`, `removeListener(org.quartz.TriggerListener)`, `removeListener(String)`, `addTriggerNamePattern(String)`, `addTriggerGroupPattern(String)`

Constructor Summary
`FilterAndBroadcastTriggerListener(String name)` Construct an instance with the given name.
`FilterAndBroadcastTriggerListener(String name, List listeners)` Construct an instance with the given name, and List of listeners.

Method Summary
`void` | `addListener(TriggerListener listener)`
`void` | `addTriggerGroupPattern(String regularExpression)` If one or more group patterns are specified, only events relating to triggers who's group matches the given regular expression pattern will be dispatched to the delegate listeners.
`void` | `addTriggerNamePattern(String regularExpression)` If one or more name patterns are specified, only events relating to triggers who's name matches the given regular expression pattern will be dispatched to the delegate listeners.
`List` | `getListeners()`
`String` | `getName()` Get the name of the `TriggerListener`.
`List` | `getTriggerGroupPatterns()`
`List` | `getTriggerNamePatterns()`
`boolean` | `removeListener(String listenerName)`
`boolean` | `removeListener(TriggerListener listener)`
`protected boolean` | `shouldDispatch(Trigger trigger)`
`void` | `triggerComplete(Trigger trigger, JobExecutionContext context, int triggerInstructionCode)` Called by the ``Scheduler`` when a ``Trigger`` has fired, it's associated ``JobDetail`` has been executed, and it's `triggered(xx)` method has been called.
`void` | `triggerFired(Trigger trigger, JobExecutionContext context)` Called by the ``Scheduler`` when a ``Trigger`` has fired, and it's associated ``JobDetail`` is about to be executed.
`void` | `triggerMisfired(Trigger trigger)` Called by the ``Scheduler`` when a ``Trigger`` has misfired.
`boolean` | `vetoJobExecution(Trigger trigger, JobExecutionContext context)` Called by the ``Scheduler`` when a ``Trigger`` has fired, and it's associated ``JobDetail`` 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

### FilterAndBroadcastTriggerListener

    public FilterAndBroadcastTriggerListener(String name)

  Construct an instance with the given name. (Remember to add some delegate listeners!)

  Parameters:
    `name` - the name of this instance

### FilterAndBroadcastTriggerListener

    public FilterAndBroadcastTriggerListener(String name,
                                             List listeners)

  Construct an instance with the given name, and List of listeners.

  Parameters:
    `name` - the name of this instance
    `listeners` - the initial List of TriggerListeners to broadcast to.

Method Detail

### getName

    public String getName()

  Description copied from interface: `TriggerListener`

  Get the name of the `TriggerListener`.

  Specified by:
    `getName` in interface `TriggerListener`

### addListener

    public void addListener(TriggerListener listener)

### removeListener

    public boolean removeListener(TriggerListener listener)

### removeListener

    public boolean removeListener(String listenerName)

### getListeners

    public List getListeners()

### addTriggerNamePattern

    public void addTriggerNamePattern(String regularExpression)

  If one or more name patterns are specified, only events relating to triggers who's name matches the given regular expression pattern will be dispatched to the delegate listeners.

  Parameters:
    `regularExpression` -

### getTriggerNamePatterns

    public List getTriggerNamePatterns()

### addTriggerGroupPattern

    public void addTriggerGroupPattern(String regularExpression)

  If one or more group patterns are specified, only events relating to triggers who's group matches the given regular expression pattern will be dispatched to the delegate listeners.

  Parameters:
    `regularExpression` -

### getTriggerGroupPatterns

    public List getTriggerGroupPatterns()

### shouldDispatch

    protected boolean shouldDispatch(Trigger trigger)

### triggerFired

    public void triggerFired(Trigger trigger,
                             JobExecutionContext context)

  Description copied from interface: `TriggerListener`

  Called by the ``Scheduler`` when a ``Trigger`` has fired, and it's associated ``JobDetail`` is about to be executed.

  It is called before the `vetoJobExecution(..)` method of this interface.

  Specified by:
    `triggerFired` in interface `TriggerListener`
  Parameters:
    `trigger` - The `Trigger` that has fired.
    `context` - The `JobExecutionContext` that will be passed to the `Job`'s`execute(xx)` method.

### vetoJobExecution

    public boolean vetoJobExecution(Trigger trigger,
                                    JobExecutionContext context)

  Description copied from interface: `TriggerListener`

  Called by the ``Scheduler`` when a ``Trigger`` has fired, and it's associated ``JobDetail`` is about to be executed.

  It is called after the `triggerFired(..)` method of this interface.

  Specified by:
    `vetoJobExecution` in interface `TriggerListener`
  Parameters:
    `trigger` - The `Trigger` that has fired.
    `context` - The `JobExecutionContext` that will be passed to the `Job`'s`execute(xx)` method.

### triggerMisfired

    public void triggerMisfired(Trigger trigger)

  Description copied from interface: `TriggerListener`

  Called by the ``Scheduler`` when a ``Trigger`` has misfired.

  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.

  Specified by:
    `triggerMisfired` in interface `TriggerListener`
  Parameters:
    `trigger` - The `Trigger` that has misfired.

### triggerComplete

    public void triggerComplete(Trigger trigger,
                                JobExecutionContext context,
                                int triggerInstructionCode)

  Description copied from interface: `TriggerListener`

  Called by the ``Scheduler`` when a ``Trigger`` has fired, it's associated ``JobDetail`` has been executed, and it's `triggered(xx)` method has been called.

  Specified by:
    `triggerComplete` in interface `TriggerListener`
  Parameters:
    `trigger` - The `Trigger` that was fired.
    `context` - The `JobExecutionContext` that was passed to the `Job`'s`execute(xx)` method.
    `triggerInstructionCode` - the result of the call on the `Trigger`'s`triggered(xx)` method.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright 2001-2012, Terracotta, Inc.