Package org.xwiki.observation.event
Class AbstractLocalEventListener
- java.lang.Object
-
- org.xwiki.observation.AbstractEventListener
-
- org.xwiki.observation.event.AbstractLocalEventListener
-
- All Implemented Interfaces:
org.xwiki.observation.EventListener
@Unstable public abstract class AbstractLocalEventListener extends org.xwiki.observation.AbstractEventListener
This is a version of anAbstractEventListener
that skips automatically all events that are remote: only local events will be processed. This abstraction should be preferred overAbstractEventListener
when the remote events should be ignored.- Since:
- 14.4RC1, 13.10.7
- Version:
- $Id: 264e53f73561c2f4712e9d7509842dba6197c77b $
-
-
Field Summary
Fields Modifier and Type Field Description protected RemoteObservationManagerContext
remoteObservationManagerContext
-
Constructor Summary
Constructors Constructor Description AbstractLocalEventListener(String name, Object... values)
AbstractLocalEventListener(String name, List<? extends org.xwiki.observation.event.Event> events)
AbstractLocalEventListener(String name, org.xwiki.observation.event.Event... events)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
onEvent(org.xwiki.observation.event.Event event, Object source, Object data)
abstract void
processLocalEvent(org.xwiki.observation.event.Event event, Object source, Object data)
Handle the local events, seeonEvent(Event, Object, Object)
for details.
-
-
-
Field Detail
-
remoteObservationManagerContext
@Inject protected RemoteObservationManagerContext remoteObservationManagerContext
-
-
Constructor Detail
-
AbstractLocalEventListener
public AbstractLocalEventListener(String name, List<? extends org.xwiki.observation.event.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, theonEvent(Event, Object, Object)
method will be called.
-
AbstractLocalEventListener
public AbstractLocalEventListener(String name, org.xwiki.observation.event.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, theonEvent(Event, Object, Object)
method will be called.
-
AbstractLocalEventListener
public AbstractLocalEventListener(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, theonEvent(Event, Object, Object)
method will be called.
-
-
Method Detail
-
processLocalEvent
public abstract void processLocalEvent(org.xwiki.observation.event.Event event, Object source, Object data)
Handle the local events, seeonEvent(Event, Object, Object)
for details.- Parameters:
event
- the event triggered. Can be used to differentiate different events if your Object supports several events for example.source
- the event source i.e. the object for which the event was triggered. For example this would be the document Object if the event is a document update event.data
- some additional and optional data passed that can be acted on.
-
-