Package org.xwiki.observation
Class AbstractEventListener
- java.lang.Object
-
- org.xwiki.observation.AbstractEventListener
-
- All Implemented Interfaces:
EventListener
public abstract class AbstractEventListener extends Object implements EventListener
Base class forEventListener
s.- Since:
- 5.4RC1
- Version:
- $Id: 66f62bdfc0a31ed99e113158e3fb1c08ee9bb453 $
-
-
Constructor Summary
Constructors Constructor Description AbstractEventListener(String name, Object... values)
AbstractEventListener(String name, List<? extends Event> events)
AbstractEventListener(String name, Event... events)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<Event>
getEvents()
String
getName()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.xwiki.observation.EventListener
onEvent
-
-
-
-
Constructor Detail
-
AbstractEventListener
public AbstractEventListener(String name, List<? extends Event> events)
- Parameters:
name
- the listener's name. It's a free form text identifying this listener instance in a unique manner. This name is used for some operations inObservationManager
.events
- the list of events this listener is configured to receive. This listener will be automatically registered with this list of events against theObservationManager
. When an event occurs, for each matching event in this list, theEventListener.onEvent(Event, Object, Object)
method will be called.
-
AbstractEventListener
public AbstractEventListener(String name, Event... events)
- Parameters:
name
- the listener's name. It's a free form text identifying this listener instance in a unique manner. This name is used for some operations inObservationManager
.events
- the list of events this listener is configured to receive. This listener will be automatically registered with this list of events against theObservationManager
. When an event occurs, for each matching event in this list, theEventListener.onEvent(Event, Object, Object)
method will be called.
-
AbstractEventListener
public AbstractEventListener(String name, Object... values)
- Parameters:
name
- the listener's name. It's a free form text identifying this listener instance in a unique manner. This name is used for some operations inObservationManager
.values
- the list of events this listener is configured to receive (values can be can be Event, Iterable of Event or Event[]). This listener will be automatically registered with this list of events against theObservationManager
. When an event occurs, for each matching event in this list, theEventListener.onEvent(Event, Object, Object)
method will be called.- Since:
- 11.8RC1
-
-
Method Detail
-
getName
public String getName()
- Specified by:
getName
in interfaceEventListener
- Returns:
- the listener's name. It's a free form text identifying this listener instance in a unique manner. This
name is used for some operations in
ObservationManager
.
-
getEvents
public List<Event> getEvents()
- Specified by:
getEvents
in interfaceEventListener
- Returns:
- the list of events this listener is configured to receive. This listener will be automatically registered
with this list of events against the
ObservationManager
. When an event occurs, for each matching event in this list, theEventListener.onEvent(Event, Object, Object)
method will be called.
-
-