|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.activemath.events.impl.AsyncMulticaster
public class AsyncMulticaster
Async implementation of the ActivemathEventMulticaster interface. This multicaster decouples event recievement and propagation. The event is enqueued and the calling thread is free to go. A single delivery thread handles event propagation to the listeners.
| Constructor Summary | |
|---|---|
AsyncMulticaster(ActivemathEventListener listener)
Create an AsyncEventQueue and an AsyncEventPropagator thread. |
|
| Method Summary | |
|---|---|
void |
addListener(ActivemathEventListener listener)
|
void |
onActivemathEvent(ActivemathEvent event)
Handle an Activemath event. |
void |
publishEvent(ActivemathEvent event)
Publish an event. |
void |
removeAllListeners()
|
void |
removeListener(ActivemathEventListener listener)
|
void |
stop()
signal thread to stop |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AsyncMulticaster(ActivemathEventListener listener)
AsyncEventQueue and an AsyncEventPropagator thread.
If listener is of type ActivemathEventListenerBatched, an
ActivemathEventListenerBatched thread is created instead.
The propagator thread is then started.
| Method Detail |
|---|
public void stop()
ActivemathEventMulticaster
stop in interface ActivemathEventMulticasterpublic void addListener(ActivemathEventListener listener)
public void removeListener(ActivemathEventListener listener)
public void removeAllListeners()
public void publishEvent(ActivemathEvent event)
ActivemathEventPublisher
publishEvent in interface ActivemathEventPublisherpublic void onActivemathEvent(ActivemathEvent event)
ActivemathEventListenerThis method must return as quickly as possible and must not block the calling thread for long.
onActivemathEvent in interface ActivemathEventListenerevent - the event to respond to
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||