Package org.quartz
Interface ListenerManager
-
- All Known Implementing Classes:
ListenerManagerImpl
public interface ListenerManager
Client programs may be interested in the 'listener' interfaces that are available from Quartz. The
interface provides notifications ofJobListener
Job
executions. The
interface provides notifications ofTriggerListener
Trigger
firings. The
interface provides notifications ofSchedulerListener
Scheduler
events and errors. Listeners can be associated with local schedulers through theListenerManager
interface.Listener registration order is preserved, and hence notification of listeners will be in the order in which they were registered.
- Since:
- 2.0 - previously listeners were managed directly on the Scheduler interface.
- Author:
- jhouse
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addJobListener(JobListener jobListener)
Add the given
to theJobListener
Scheduler
, and register it to receive events for all Jobs.void
addJobListener(JobListener jobListener, java.util.List<Matcher<JobKey>> matchers)
Add the given
to theJobListener
Scheduler
, and register it to receive events for Jobs that are matched by ANY of the given Matchers.void
addJobListener(JobListener jobListener, Matcher<JobKey> matcher)
Add the given
to theJobListener
Scheduler
, and register it to receive events for Jobs that are matched by the given Matcher.void
addJobListener(JobListener jobListener, Matcher<JobKey>... matchers)
Add the given
to theJobListener
Scheduler
, and register it to receive events for Jobs that are matched by ANY of the given Matchers.boolean
addJobListenerMatcher(java.lang.String listenerName, Matcher<JobKey> matcher)
Add the given Matcher to the set of matchers for which the listener will receive events if ANY of the matchers match.void
addSchedulerListener(SchedulerListener schedulerListener)
Register the given
with theSchedulerListener
Scheduler
.void
addTriggerListener(TriggerListener triggerListener)
Add the given
to theTriggerListener
Scheduler
, and register it to receive events for all Triggers.void
addTriggerListener(TriggerListener triggerListener, java.util.List<Matcher<TriggerKey>> matchers)
Add the given
to theTriggerListener
Scheduler
, and register it to receive events for Triggers that are matched by ANY of the given Matchers.void
addTriggerListener(TriggerListener triggerListener, Matcher<TriggerKey> matcher)
Add the given
to theTriggerListener
Scheduler
, and register it to receive events for Triggers that are matched by the given Matcher.void
addTriggerListener(TriggerListener triggerListener, Matcher<TriggerKey>... matchers)
Add the given
to theTriggerListener
Scheduler
, and register it to receive events for Triggers that are matched by ANY of the given Matchers.boolean
addTriggerListenerMatcher(java.lang.String listenerName, Matcher<TriggerKey> matcher)
Add the given Matcher to the set of matchers for which the listener will receive events if ANY of the matchers match.JobListener
getJobListener(java.lang.String name)
Get the
that has the given name.JobListener
java.util.List<Matcher<JobKey>>
getJobListenerMatchers(java.lang.String listenerName)
Get the set of Matchers for which the listener will receive events if ANY of the matchers match.java.util.List<JobListener>
getJobListeners()
Get a List containing all of the
s in theJobListener
Scheduler
, in the order in which they were registered.java.util.List<SchedulerListener>
getSchedulerListeners()
Get a List containing all of the
s registered with theSchedulerListener
Scheduler
, in the order in which they were registered.TriggerListener
getTriggerListener(java.lang.String name)
Get the
that has the given name.TriggerListener
java.util.List<Matcher<TriggerKey>>
getTriggerListenerMatchers(java.lang.String listenerName)
Get the set of Matchers for which the listener will receive events if ANY of the matchers match.java.util.List<TriggerListener>
getTriggerListeners()
Get a List containing all of the
s in theTriggerListener
Scheduler
, in the order in which they were registered.boolean
removeJobListener(java.lang.String name)
Remove the identified
from theJobListener
Scheduler
.boolean
removeJobListenerMatcher(java.lang.String listenerName, Matcher<JobKey> matcher)
Remove the given Matcher to the set of matchers for which the listener will receive events if ANY of the matchers match.boolean
removeSchedulerListener(SchedulerListener schedulerListener)
Remove the given
from theSchedulerListener
Scheduler
.boolean
removeTriggerListener(java.lang.String name)
Remove the identified
from theTriggerListener
Scheduler
.boolean
removeTriggerListenerMatcher(java.lang.String listenerName, Matcher<TriggerKey> matcher)
Remove the given Matcher to the set of matchers for which the listener will receive events if ANY of the matchers match.boolean
setJobListenerMatchers(java.lang.String listenerName, java.util.List<Matcher<JobKey>> matchers)
Set the set of Matchers for which the listener will receive events if ANY of the matchers match.boolean
setTriggerListenerMatchers(java.lang.String listenerName, java.util.List<Matcher<TriggerKey>> matchers)
Set the set of Matchers for which the listener will receive events if ANY of the matchers match.
-
-
-
Method Detail
-
addJobListener
void addJobListener(JobListener jobListener)
Add the given
to theJobListener
Scheduler
, and register it to receive events for all Jobs. Because no matchers are provided, theEverythingMatcher
will be used.- See Also:
Matcher
,EverythingMatcher
-
addJobListener
void addJobListener(JobListener jobListener, Matcher<JobKey> matcher)
Add the given
to theJobListener
Scheduler
, and register it to receive events for Jobs that are matched by the given Matcher. If no matchers are provided, theEverythingMatcher
will be used.- See Also:
Matcher
,EverythingMatcher
-
addJobListener
void addJobListener(JobListener jobListener, Matcher<JobKey>... matchers)
Add the given
to theJobListener
Scheduler
, and register it to receive events for Jobs that are matched by ANY of the given Matchers. If no matchers are provided, theEverythingMatcher
will be used.- See Also:
Matcher
,EverythingMatcher
-
addJobListener
void addJobListener(JobListener jobListener, java.util.List<Matcher<JobKey>> matchers)
Add the given
to theJobListener
Scheduler
, and register it to receive events for Jobs that are matched by ANY of the given Matchers. If no matchers are provided, theEverythingMatcher
will be used.- See Also:
Matcher
,EverythingMatcher
-
addJobListenerMatcher
boolean addJobListenerMatcher(java.lang.String listenerName, Matcher<JobKey> matcher)
Add the given Matcher to the set of matchers for which the listener will receive events if ANY of the matchers match.- Parameters:
listenerName
- the name of the listener to add the matcher tomatcher
- the additional matcher to apply for selecting events- Returns:
- true if the identified listener was found and updated
-
removeJobListenerMatcher
boolean removeJobListenerMatcher(java.lang.String listenerName, Matcher<JobKey> matcher)
Remove the given Matcher to the set of matchers for which the listener will receive events if ANY of the matchers match.- Parameters:
listenerName
- the name of the listener to add the matcher tomatcher
- the additional matcher to apply for selecting events- Returns:
- true if the given matcher was found and removed from the listener's list of matchers
-
setJobListenerMatchers
boolean setJobListenerMatchers(java.lang.String listenerName, java.util.List<Matcher<JobKey>> matchers)
Set the set of Matchers for which the listener will receive events if ANY of the matchers match.Removes any existing matchers for the identified listener!
- Parameters:
listenerName
- the name of the listener to add the matcher tomatchers
- the matchers to apply for selecting events- Returns:
- true if the given matcher was found and removed from the listener's list of matchers
-
getJobListenerMatchers
java.util.List<Matcher<JobKey>> getJobListenerMatchers(java.lang.String listenerName)
Get the set of Matchers for which the listener will receive events if ANY of the matchers match.- Parameters:
listenerName
- the name of the listener to add the matcher to- Returns:
- the matchers registered for selecting events for the identified listener
-
removeJobListener
boolean removeJobListener(java.lang.String name)
Remove the identified
from theJobListener
Scheduler
.- Returns:
- true if the identified listener was found in the list, and removed.
-
getJobListeners
java.util.List<JobListener> getJobListeners()
Get a List containing all of the
s in theJobListener
Scheduler
, in the order in which they were registered.
-
getJobListener
JobListener getJobListener(java.lang.String name)
Get the
that has the given name.JobListener
-
addTriggerListener
void addTriggerListener(TriggerListener triggerListener)
Add the given
to theTriggerListener
Scheduler
, and register it to receive events for all Triggers. Because no matcher is provided, theEverythingMatcher
will be used.- See Also:
Matcher
,EverythingMatcher
-
addTriggerListener
void addTriggerListener(TriggerListener triggerListener, Matcher<TriggerKey> matcher)
Add the given
to theTriggerListener
Scheduler
, and register it to receive events for Triggers that are matched by the given Matcher. If no matcher is provided, theEverythingMatcher
will be used.- See Also:
Matcher
,EverythingMatcher
-
addTriggerListener
void addTriggerListener(TriggerListener triggerListener, Matcher<TriggerKey>... matchers)
Add the given
to theTriggerListener
Scheduler
, and register it to receive events for Triggers that are matched by ANY of the given Matchers. If no matcher is provided, theEverythingMatcher
will be used.- See Also:
Matcher
,EverythingMatcher
-
addTriggerListener
void addTriggerListener(TriggerListener triggerListener, java.util.List<Matcher<TriggerKey>> matchers)
Add the given
to theTriggerListener
Scheduler
, and register it to receive events for Triggers that are matched by ANY of the given Matchers. If no matcher is provided, theEverythingMatcher
will be used.- See Also:
Matcher
,EverythingMatcher
-
addTriggerListenerMatcher
boolean addTriggerListenerMatcher(java.lang.String listenerName, Matcher<TriggerKey> matcher)
Add the given Matcher to the set of matchers for which the listener will receive events if ANY of the matchers match.- Parameters:
listenerName
- the name of the listener to add the matcher tomatcher
- the additional matcher to apply for selecting events- Returns:
- true if the identified listener was found and updated
-
removeTriggerListenerMatcher
boolean removeTriggerListenerMatcher(java.lang.String listenerName, Matcher<TriggerKey> matcher)
Remove the given Matcher to the set of matchers for which the listener will receive events if ANY of the matchers match.- Parameters:
listenerName
- the name of the listener to add the matcher tomatcher
- the additional matcher to apply for selecting events- Returns:
- true if the given matcher was found and removed from the listener's list of matchers
-
setTriggerListenerMatchers
boolean setTriggerListenerMatchers(java.lang.String listenerName, java.util.List<Matcher<TriggerKey>> matchers)
Set the set of Matchers for which the listener will receive events if ANY of the matchers match.Removes any existing matchers for the identified listener!
- Parameters:
listenerName
- the name of the listener to add the matcher tomatchers
- the matchers to apply for selecting events- Returns:
- true if the given matcher was found and removed from the listener's list of matchers
-
getTriggerListenerMatchers
java.util.List<Matcher<TriggerKey>> getTriggerListenerMatchers(java.lang.String listenerName)
Get the set of Matchers for which the listener will receive events if ANY of the matchers match.- Parameters:
listenerName
- the name of the listener to add the matcher to- Returns:
- the matchers registered for selecting events for the identified listener
-
removeTriggerListener
boolean removeTriggerListener(java.lang.String name)
Remove the identified
from theTriggerListener
Scheduler
.- Returns:
- true if the identified listener was found in the list, and removed.
-
getTriggerListeners
java.util.List<TriggerListener> getTriggerListeners()
Get a List containing all of the
s in theTriggerListener
Scheduler
, in the order in which they were registered.
-
getTriggerListener
TriggerListener getTriggerListener(java.lang.String name)
Get the
that has the given name.TriggerListener
-
addSchedulerListener
void addSchedulerListener(SchedulerListener schedulerListener)
Register the given
with theSchedulerListener
Scheduler
.
-
removeSchedulerListener
boolean removeSchedulerListener(SchedulerListener schedulerListener)
Remove the given
from theSchedulerListener
Scheduler
.- Returns:
- true if the identified listener was found in the list, and removed.
-
getSchedulerListeners
java.util.List<SchedulerListener> getSchedulerListeners()
Get a List containing all of the
s registered with theSchedulerListener
Scheduler
, in the order in which they were registered.
-
-