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 provided Thread.
- Since:
- 3.2M3
- Version:
- $Id: 66bc9c1272e5baea1f5aa3914b5b15124839b60b $
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractThreadEventListener
public AbstractThreadEventListener()
- Use
Thread.currentThread().
AbstractThreadEventListener
public AbstractThreadEventListener(Thread thread)
- Parameters:
thread - the thread to match to receive events.
onEvent
public void onEvent(Event event,
Object source,
Object data)
- Description copied from interface:
EventListener
- The
ObservationManager calls this method when an event matches one of the events
for which this listener is registered (see EventListener.getEvents().
- Specified by:
onEvent in interface EventListener
- 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 proper
Thread.
- 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.
Copyright © 2004–2014 XWiki. All rights reserved.