|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.blojsom.event.SimpleBlojsomEventBroadcaster
SimpleBlojsomEventBroadcaster.
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(BlojsomEvent)
method adds the capability for components to have an
event processed after the call instead of asynchronously as with the broadcastEvent(BlojsomEvent)
method.
Nested Class Summary | |
protected class |
SimpleBlojsomEventBroadcaster.EventHandler
Event handler helper class. |
Constructor Summary | |
SimpleBlojsomEventBroadcaster()
Default constructor. |
Method Summary | |
void |
addListener(BlojsomListener listener)
Add a event to this event broadcaster |
void |
addListener(BlojsomListener listener,
BlojsomFilter filter)
Add a event to this event broadcaster. |
void |
broadcastEvent(BlojsomEvent event)
Broadcast an event to all listeners |
void |
processEvent(BlojsomEvent event)
Process an event with all listeners |
void |
removeListener(BlojsomListener 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 SimpleBlojsomEventBroadcaster()
Method Detail |
public void addListener(BlojsomListener listener)
addListener
in interface BlojsomEventBroadcaster
listener
- BlojsomListener
public void addListener(BlojsomListener listener, BlojsomFilter filter)
BlojsomFilter
instance
passed to this method.
addListener
in interface BlojsomEventBroadcaster
listener
- BlojsomListener
filter
- BlojsomFilter
used to filter eventspublic void removeListener(BlojsomListener listener)
removeListener
in interface BlojsomEventBroadcaster
listener
- BlojsomListener
public void broadcastEvent(BlojsomEvent event)
broadcastEvent
in interface BlojsomEventBroadcaster
event
- BlojsomEvent
to be broadcast to all listenerspublic void processEvent(BlojsomEvent event)
processEvent
in interface BlojsomEventBroadcaster
event
- BlojsomEvent
to be processed by all listeners
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |