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 TypeMethodDescriptionvoid
addNotificationListener
(EventType type, INotificationListener listener) Addlistener
to the collection of objects to be informed when the receiver triggers an event of typename
.void
attach
(INotificationSupport support) void
clear()
void
detach
(INotificationSupport support) getOwner()
void
handleEvent
(Event event) Called when an event occurs.protected boolean
hasListener
(EventType type, INotificationListener listener) boolean
isEmpty()
void
removeNotificationListener
(EventType type, INotificationListener listener) Removelistener
from the collection of objects to be informed about events of typename
.void
triggerEvent
(Event event) void
triggerEventReverse
(Event event)
-
Constructor Details
-
EventDispatcher
-
-
Method Details
-
addNotificationListener
Description copied from interface:INotificationSupport
Addlistener
to the collection of objects to be informed when the receiver triggers an event of typename
.- Specified by:
addNotificationListener
in 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:INotificationListener
Called when an event occurs.- Specified by:
handleEvent
in interfaceINotificationListener
- Parameters:
event
- The event object giving detail information about the context.
-
hasListener
-
isEmpty
public boolean isEmpty() -
removeNotificationListener
Description copied from interface:INotificationSupport
Removelistener
from the collection of objects to be informed about events of typename
.- Specified by:
removeNotificationListener
in interfaceINotificationSupport
- Parameters:
type
- The event type we are no longer interested in.listener
- The object registered for the event till now.
-
triggerEvent
-
triggerEventReverse
-