Package org.xwiki.observation
Class AbstractThreadEventListener
- java.lang.Object
-
- org.xwiki.observation.AbstractThreadEventListener
-
- All Implemented Interfaces:
EventListener
- Direct Known Subclasses:
WrappedThreadEventListener
public abstract class AbstractThreadEventListener extends Object implements EventListener
Filter events by keeping only events produced by the providedThread
.- Since:
- 3.2M3
- Version:
- $Id: 50b106ccae4955b72d841da0d42a0aea98d374bc $
-
-
Constructor Summary
Constructors Constructor Description AbstractThreadEventListener()
AbstractThreadEventListener(Thread thread)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
onEvent(Event event, Object source, Object data)
TheObservationManager
calls this method when an event matches one of the events for which this listener is registered (seeEventListener.getEvents()
.protected abstract void
onEventInternal(Event event, Object source, Object data)
Called when the event has been produce by the properThread
.-
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
getEvents, getName
-
-
-
-
Constructor Detail
-
AbstractThreadEventListener
public AbstractThreadEventListener()
-
AbstractThreadEventListener
public AbstractThreadEventListener(Thread thread)
- Parameters:
thread
- the thread to match to receive events.
-
-
Method Detail
-
onEvent
public void onEvent(Event event, Object source, Object data)
Description copied from interface:EventListener
TheObservationManager
calls this method when an event matches one of the events for which this listener is registered (seeEventListener.getEvents()
.- Specified by:
onEvent
in interfaceEventListener
- 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.
-
onEventInternal
protected abstract void onEventInternal(Event event, Object source, Object data)
Called when the event has been produce by the properThread
.- 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.
-
-