Package me.tamkungz.signals.internal
Class SignalEnvelopeDispatcher
java.lang.Object
me.tamkungz.signals.internal.SignalEnvelopeDispatcher
- All Implemented Interfaces:
foo.zaaarf.geb.api.IEventDispatcher<SignalEnvelope>
public final class SignalEnvelopeDispatcher
extends Object
implements foo.zaaarf.geb.api.IEventDispatcher<SignalEnvelope>
Hands every
SignalEnvelope that reaches a GEB bus to the SignalRouters registered on it.
GEB only calls listeners once a dispatcher for the event type is registered on the bus, and drops events
without one. Dispatchers are normally generated by GEB's annotation processor and discovered through a
service file; this one is written out by hand so that a SignalBus works on any bus
it is given, without annotation processing and without depending on which class loader the service file is
visible to.
Internal: SignalBus registers it.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final SignalEnvelopeDispatcherThe shared instance; the dispatcher keeps no state. -
Method Summary
Modifier and TypeMethodDescriptionbooleancallListeners(SignalEnvelope event, Map<Class<? extends foo.zaaarf.geb.api.IListener>, Set<foo.zaaarf.geb.api.IListener>> listeners)
-
Field Details
-
INSTANCE
The shared instance; the dispatcher keeps no state.
-
-
Method Details
-
callListeners
public boolean callListeners(SignalEnvelope event, Map<Class<? extends foo.zaaarf.geb.api.IListener>, Set<foo.zaaarf.geb.api.IListener>> listeners) - Specified by:
callListenersin interfacefoo.zaaarf.geb.api.IEventDispatcher<SignalEnvelope>
-
eventType
- Specified by:
eventTypein interfacefoo.zaaarf.geb.api.IEventDispatcher<SignalEnvelope>
-