Class EventBus
java.lang.Object
com.google.web.bindery.event.shared.EventBus
- Direct Known Subclasses:
CountingEventBus,EventBus,RecordingEventBus,ResettableEventBus,SimpleEventBus
Dispatches
Events to interested parties. Eases decoupling by allowing
objects to interact without having direct dependencies upon one another, and
without requiring event sources to deal with maintaining handler lists. There
will typically be one EventBus per application, broadcasting events that may
be of general interest.- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract <H> HandlerRegistrationaddHandler(Event.Type<H> type, H handler) Adds an unfiltered handler to receive events of this type from all sources.abstract <H> HandlerRegistrationaddHandlerToSource(Event.Type<H> type, Object source, H handler) Adds a handler to receive events of this type from the given source.protected static <H> voiddispatchEvent(Event<H> event, H handler) Invokesevent.dispatchwithhandler.abstract voidFires the event from no source.abstract voidfireEventFromSource(Event<?> event, Object source) Fires the given event to the handlers listening to the event's type.protected static voidsetSourceOfEvent(Event<?> event, Object source) Setssourceas the source ofevent.
-
Constructor Details
-
EventBus
public EventBus()
-
-
Method Details