|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.stuffthathappens.classbus.EdtDeliveryStrategy
public class EdtDeliveryStrategy
An event delivery strategy that ensures EventSubscribers are only notified on
the Swing Event Dispatch Thread (EDT). If the sender is already on the EDT, events are
simply passed through. Otherwise this implementation uses
SwingUtilities.invokeLater(...) to deliver the events.
| Constructor Summary | |
|---|---|
EdtDeliveryStrategy()
|
|
| Method Summary | ||
|---|---|---|
|
publishTo(java.lang.Iterable<EventSubscriber<T>> subscribers,
T event,
DeliveryCompleteCallback<T> callback)
Iterate over the given collection of subscribers, calling EventSubscriber.onEvent(Object) on each subscriber. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public EdtDeliveryStrategy()
| Method Detail |
|---|
public <T> void publishTo(java.lang.Iterable<EventSubscriber<T>> subscribers,
T event,
DeliveryCompleteCallback<T> callback)
DeliveryStrategyEventSubscriber.onEvent(Object) on each subscriber.
This may spawn a new thread, depending on the implementation.
The callback is optional. If null, it is ignored.
publishTo in interface DeliveryStrategysubscribers - the subscribers to notify.event - the object to send.callback - an optional callback to notify upon completion.EventSubscriber.onEvent(Object)
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||