|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.blojsom.event.SimpleEventBroadcaster
SimpleEventBroadcaster.
Events are broadcast to each event in a separate thread so that the broadcaster is not a bottleneck. No defined order is set for how each event will receive an event, so you should not assume any order in listeners being called. No steps are taken to ensure a event does not receive an event if it is removed at the same time an event is being broadcast. The addition of theprocessEvent(Event)
method adds the capability for components to have an
event processed after the call instead of asynchronously as with the broadcastEvent(Event)
method.
Nested Class Summary | |
protected class |
SimpleEventBroadcaster.EventHandler
Event handler helper class. |
Constructor Summary | |
SimpleEventBroadcaster()
Default constructor. |
Method Summary | |
void |
addListener(Listener listener)
Add a event to this event broadcaster |
void |
addListener(Listener listener,
Filter filter)
Add a event to this event broadcaster. |
void |
broadcastEvent(Event event)
Broadcast an event to all listeners |
void |
processEvent(Event event)
Process an event with all listeners |
void |
removeListener(Listener listener)
Remove a event from this event broadcaster |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SimpleEventBroadcaster()
Method Detail |
public void addListener(Listener listener)
addListener
in interface EventBroadcaster
listener
- Listener
public void addListener(Listener listener, Filter filter)
Filter
instance
passed to this method.
addListener
in interface EventBroadcaster
listener
- Listener
filter
- Filter
used to filter eventspublic void removeListener(Listener listener)
removeListener
in interface EventBroadcaster
listener
- Listener
public void broadcastEvent(Event event)
broadcastEvent
in interface EventBroadcaster
event
- Event
to be broadcast to all listenerspublic void processEvent(Event event)
processEvent
in interface EventBroadcaster
event
- Event
to be processed by all listeners
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |