Package de.intarsys.tools.event
Class EventDispatcher
java.lang.Object
de.intarsys.tools.event.EventDispatcher
- All Implemented Interfaces:
INotificationListener,INotificationSupport,Serializable,EventListener
public class EventDispatcher
extends Object
implements INotificationSupport, INotificationListener, Serializable
Helper object for management and dispatching of events.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddNotificationListener(EventType type, INotificationListener listener) Addlistenerto the collection of objects to be informed when the receiver triggers an event of typename.voidattach(INotificationSupport support) voidclear()voiddetach(INotificationSupport support) getOwner()voidhandleEvent(Event event) Called when an event occurs.protected booleanhasListener(EventType type, INotificationListener listener) booleanisEmpty()voidremoveNotificationListener(EventType type, INotificationListener listener) Removelistenerfrom the collection of objects to be informed about events of typename.voidtriggerEvent(Event event) voidtriggerEventReverse(Event event)
-
Constructor Details
-
EventDispatcher
-
-
Method Details
-
addNotificationListener
Description copied from interface:INotificationSupportAddlistenerto the collection of objects to be informed when the receiver triggers an event of typename.- Specified by:
addNotificationListenerin interfaceINotificationSupport- Parameters:
type- The event type we are interested in.listener- The object to be informed about an event occurrence
-
attach
-
clear
public void clear() -
detach
-
getOwner
-
handleEvent
Description copied from interface:INotificationListenerCalled when an event occurs.- Specified by:
handleEventin interfaceINotificationListener- Parameters:
event- The event object giving detail information about the context.
-
hasListener
-
isEmpty
public boolean isEmpty() -
removeNotificationListener
Description copied from interface:INotificationSupportRemovelistenerfrom the collection of objects to be informed about events of typename.- Specified by:
removeNotificationListenerin interfaceINotificationSupport- Parameters:
type- The event type we are no longer interested in.listener- The object registered for the event till now.
-
triggerEvent
-
triggerEventReverse
-