public class EventDispatcher extends Object implements INotificationSupport, INotificationListener, Serializable
Events are forwarded immediately on "handleEvent" to all listeners in the thread of the caller.
| Constructor and Description |
|---|
EventDispatcher(Object pOwner) |
| Modifier and Type | Method and Description |
|---|---|
void |
addNotificationListener(EventType type,
INotificationListener listener)
Add
listener to the collection of objects to be informed
when the receiver triggers an event of type name. |
void |
attach(INotificationSupport support) |
void |
clear() |
void |
detach(INotificationSupport support) |
Object |
getOwner() |
void |
handleEvent(Event event)
Called when an event occurs.
|
boolean |
hasListener() |
boolean |
isEmpty() |
void |
removeNotificationListener(EventType type,
INotificationListener listener)
Remove
listener from the collection of objects to be
informed about events of type name. |
void |
triggerChanged(String attribute,
Object oldValue,
Object newValue)
Convenience method for triggering an
AttributeChangedEvent. |
void |
triggerEvent(Event event) |
public EventDispatcher(Object pOwner)
public void addNotificationListener(EventType type, INotificationListener listener)
INotificationSupportlistener to the collection of objects to be informed
when the receiver triggers an event of type name.addNotificationListener in interface INotificationSupporttype - The event type we are interested in.listener - The object to be informed about an event occurrencepublic void attach(INotificationSupport support)
public void clear()
public void detach(INotificationSupport support)
public Object getOwner()
public void handleEvent(Event event)
INotificationListenerhandleEvent in interface INotificationListenerevent - The event object giving detail information about the context.public boolean hasListener()
public boolean isEmpty()
public void removeNotificationListener(EventType type, INotificationListener listener)
INotificationSupportlistener from the collection of objects to be
informed about events of type name.removeNotificationListener in interface INotificationSupporttype - The event type we are no longer interested in.listener - The object registered for the event till now.public void triggerChanged(String attribute, Object oldValue, Object newValue)
AttributeChangedEvent.string - public void triggerEvent(Event event)
Copyright © 2013 intarsys consulting GmbH. All Rights Reserved.