Class AbstractLocalEventListener

  • All Implemented Interfaces:
    org.xwiki.observation.EventListener

    @Unstable
    public abstract class AbstractLocalEventListener
    extends org.xwiki.observation.AbstractEventListener
    This is a version of an AbstractEventListener that skips automatically all events that are remote: only local events will be processed. This abstraction should be preferred over AbstractEventListener when the remote events should be ignored.
    Since:
    14.4RC1, 13.10.7
    Version:
    $Id: 264e53f73561c2f4712e9d7509842dba6197c77b $
    • 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 in ObservationManager.
        events - 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, the onEvent(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 in ObservationManager.
        events - 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, the onEvent(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 in ObservationManager.
        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 the ObservationManager. When an event occurs, for each matching event in this list, the onEvent(Event, Object, Object) method will be called.
    • Method Detail

      • onEvent

        public void onEvent​(org.xwiki.observation.event.Event event,
                            Object source,
                            Object data)
      • processLocalEvent

        public abstract void processLocalEvent​(org.xwiki.observation.event.Event event,
                                               Object source,
                                               Object data)
        Handle the local events, see onEvent(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.