public abstract class AbstractEventPublisher extends Object implements EventPublisher
| Constructor and Description | 
|---|
| AbstractEventPublisher() | 
| Modifier and Type | Method and Description | 
|---|---|
| <E extends Event> | addEventListener(Class<E> eventClass,
                CallableWithArgs<?> listener)Adds a callable as an event listener. | 
| void | addEventListener(Map<String,CallableWithArgs<?>> listener)Adds a Map containing event listeners. | 
| void | addEventListener(Object listener)Adds an event listener. | 
| void | addEventListener(String eventName,
                CallableWithArgs<?> listener)Adds a callable as an event listener. | 
| boolean | isEventPublishingEnabled()Returns whether events will be published by the event bus or not. | 
| void | publishEvent(Event event)Publishes an event. | 
| void | publishEvent(String eventName)Publishes an event. | 
| void | publishEvent(String eventName,
            List<?> params)Publishes an event. | 
| void | publishEventAsync(Event event)Publishes an event. | 
| void | publishEventAsync(String eventName)Publishes an event. | 
| void | publishEventAsync(String eventName,
                 List<?> params)Publishes an event. | 
| void | publishEventOutsideUI(Event event)Publishes an event. | 
| void | publishEventOutsideUI(String eventName)Publishes an event. | 
| void | publishEventOutsideUI(String eventName,
                     List<?> params)Publishes an event. | 
| <E extends Event> | removeEventListener(Class<E> eventClass,
                   CallableWithArgs<?> listener)Removes a callable as an event listener. | 
| void | removeEventListener(Map<String,CallableWithArgs<?>> listener)Removes a Map containing event listeners. | 
| void | removeEventListener(Object listener)Removes an event listener. | 
| void | removeEventListener(String eventName,
                   CallableWithArgs<?> listener)Removes a callable as an event listener. | 
| void | setEventPublishingEnabled(boolean enabled)Sets the enabled state for event publishing. | 
| void | setEventRouter(EventRouter eventRouter) | 
@Inject public void setEventRouter(@Nonnull EventRouter eventRouter)
public boolean isEventPublishingEnabled()
EventPublisherisEventPublishingEnabled in interface EventPublisherpublic <E extends Event> void removeEventListener(@Nonnull Class<E> eventClass, @Nonnull CallableWithArgs<?> listener)
EventPublisherremoveEventListener in interface EventPublishereventClass - the type of the eventlistener - an event listenerpublic void addEventListener(@Nonnull Object listener)
EventPublisherAccepted types are: Script, Map and Object.
addEventListener in interface EventPublisherlistener - an event listenerpublic void addEventListener(@Nonnull String eventName, @Nonnull CallableWithArgs<?> listener)
EventPublisheraddEventListener in interface EventPublishereventName - the name of the eventlistener - an event listenerpublic void publishEvent(@Nonnull String eventName)
EventPublisherListeners will be notified in the same thread as the publisher.
publishEvent in interface EventPublishereventName - the name of the eventpublic void publishEventOutsideUI(@Nonnull Event event)
EventPublisherListeners will be notified outside of the UI thread.
publishEventOutsideUI in interface EventPublisherevent - the event to be publishedpublic void removeEventListener(@Nonnull Map<String,CallableWithArgs<?>> listener)
EventPublisherAn event listener may be a
Some examples of eventHandler names are: StartupStart, MyCoolEvent. Event names must follow the camelCase naming convention.
removeEventListener in interface EventPublisherlistener - an event listener of type Mappublic <E extends Event> void addEventListener(@Nonnull Class<E> eventClass, @Nonnull CallableWithArgs<?> listener)
EventPublisheraddEventListener in interface EventPublishereventClass - the type of the eventlistener - an event listenerpublic void publishEventOutsideUI(@Nonnull String eventName)
EventPublisherListeners will be notified outside of the UI thread.
publishEventOutsideUI in interface EventPublishereventName - the name of the eventpublic void publishEventOutsideUI(@Nonnull String eventName, @Nullable List<?> params)
EventPublisherListeners will be notified outside of the UI thread.
publishEventOutsideUI in interface EventPublishereventName - the name of the eventparams - event arguments sent to listenerspublic void publishEvent(@Nonnull String eventName, @Nullable List<?> params)
EventPublisherListeners will be notified in the same thread as the publisher.
publishEvent in interface EventPublishereventName - the name of the eventparams - event arguments sent to listenerspublic void publishEventAsync(@Nonnull String eventName, @Nullable List<?> params)
EventPublisherListeners will be notified in a different thread.
publishEventAsync in interface EventPublishereventName - the name of the eventparams - event arguments sent to listenerspublic void removeEventListener(@Nonnull String eventName, @Nonnull CallableWithArgs<?> listener)
EventPublisherremoveEventListener in interface EventPublishereventName - the name of the eventlistener - an event listenerpublic void removeEventListener(@Nonnull Object listener)
EventPublisherAccepted types are: Script, Map and Object.
removeEventListener in interface EventPublisherlistener - an event listenerpublic void addEventListener(@Nonnull Map<String,CallableWithArgs<?>> listener)
EventPublisherAn event listener may be a
Some examples of eventHandler names are: StartupStart, MyCoolEvent. Event names must follow the camelCase naming convention.
addEventListener in interface EventPublisherlistener - an event listener of type Mappublic void setEventPublishingEnabled(boolean enabled)
EventPublishersetEventPublishingEnabled in interface EventPublisherenabled - the value fot the enabled state.public void publishEvent(@Nonnull Event event)
EventPublisherListeners will be notified in the same thread as the publisher.
publishEvent in interface EventPublisherevent - the event to be publishedpublic void publishEventAsync(@Nonnull String eventName)
EventPublisherListeners will be notified in a different thread.
publishEventAsync in interface EventPublishereventName - the name of the eventpublic void publishEventAsync(@Nonnull Event event)
EventPublisherListeners will be notified in a different thread.
publishEventAsync in interface EventPublisherevent - the event to be published