Uses of Class
de.espirit.firstspirit.event.BusIdentifier
-
Uses of BusIdentifier in de.espirit.firstspirit.agency
Modifier and TypeMethodDescriptionstatic <T extends Serializable>
BusIdentifier<T>EventBusAgent.createBusIdentifier
(@NotNull String identifier, @NotNull Class<T> eventType, @org.jetbrains.annotations.Nullable long... ids) Createbus
identifier object.
A bus identifier should be as local and specific as possible to avoid unnecessary event delivery to listeners not interested in the events.Modifier and TypeMethodDescription<T extends Serializable>
voidEventBusAgent.post
(@NotNull BusIdentifier<T> bus, T data) Post an event on the specifiedbus
.
Event delivery is asynchronous - this method returns before the event is delivered and processed by all possibly remote listeners.
Eachbus
has its own event queue and the events will be delivered in order one event at a time from this queue to the registered listeners.<T extends Serializable>
voidEventBusAgent.register
(@NotNull BusIdentifier<T> bus, @NotNull Consumer<T> listener) <T extends Serializable>
voidEventBusAgent.unregister
(@NotNull BusIdentifier<T> bus, @NotNull Consumer<T> listener) -
Uses of BusIdentifier in de.espirit.firstspirit.event
Modifier and TypeFieldDescriptionstatic final BusIdentifier<TrackingEvent>
TrackingEvent.BUS_IDENTIFIER
Use this bus identifier for registering listeners with theEventBusAgent
in order to receive tracking events.static final BusIdentifier<UrlEvent>
UrlEvent.BUS_IDENTIFIER
Use this identifier to register a listener for this event.