E
- the element typeO
- the generic typeEM
- the generic typeH
- the generic typepublic interface GenericEventBus<E extends org.refcodes.observer.GenericEvent<?>,O extends org.refcodes.observer.Observer<E>,EM extends org.refcodes.observer.EventMatcher<E>,H> extends BusPublisher<E>, BusObservable<E,O,EM,H>, DispatchStrategyAccessor
GenericEventBus
is the (virtual) machine wide manager for
GenericActionEvent
handling.
TIPP: In order to distinguish ActionMetaDataEventImpl
instances from
each other, create an actions enumeration, enumerating the various event
actions you support. Pass the actual action you intend to notify upon to the
according constructor, as an Observer
you may use the declarative
method EventMatcherSugar.actionEqualWith(Object)
to test whether your
action was notified (or a simple switch case statement).
DispatchStrategyAccessor.DispatchStrategyMutator, DispatchStrategyAccessor.DispatchStrategyProperty
Modifier and Type | Method and Description |
---|---|
<EVT extends E> |
onAction(Class<EVT> aEventType,
Enum<?> aAction,
org.refcodes.observer.Observer<EVT> aObserver)
Similar to the more generic method
BusObservable.subscribe(EventMatcher, Observer) THOUGH subscribes for events
for the given action. |
String |
onAction(Enum<?> aAction,
O aObserver)
Similar to the more generic method
BusObservable.subscribe(EventMatcher, Observer) THOUGH subscribes for events
for the given action. |
String |
onCatchAll(O aObserver)
Similar to the more generic method
BusObservable.subscribe(EventMatcher, Observer) THOUGH subscribes all events
passing the Event-Bus. |
<EVT extends E> |
onChannel(Class<EVT> aEventType,
String aChannel,
org.refcodes.observer.Observer<EVT> aObserver)
Similar to the more generic method
BusObservable.subscribe(EventMatcher, Observer) THOUGH subscribes for events
for the given channel. |
String |
onChannel(String aChannel,
O aObserver)
Similar to the more generic method
BusObservable.subscribe(EventMatcher, Observer) THOUGH subscribes for events
for the given channel. |
String |
onEvent(Class<?> aPublisherType,
org.refcodes.observer.Observer<BusEvent> aObserver)
Similar to the more generic method
BusObservable.subscribe(EventMatcher, Observer) THOUGH subscribes for events
with the given attributes. |
<EVT extends E> |
onEvent(Class<EVT> aEventType,
Class<?> aPublisherType,
org.refcodes.observer.Observer<EVT> aObserver)
Similar to the more generic method
BusObservable.subscribe(EventMatcher, Observer) THOUGH subscribes for events
with the given attributes. |
<EVT extends E> |
onEvent(Class<EVT> aEventType,
Enum<?> aAction,
Class<?> aPublisherType,
org.refcodes.observer.Observer<EVT> aObserver)
Similar to the more generic method
BusObservable.subscribe(EventMatcher, Observer) THOUGH subscribes for events
with the given attributes. |
<EVT extends E> |
onEvent(Class<EVT> aEventType,
Enum<?> aAction,
org.refcodes.observer.Observer<EVT> aObserver)
Similar to the more generic method
BusObservable.subscribe(EventMatcher, Observer) THOUGH subscribes for events
with the given attributes. |
<EVT extends E> |
onEvent(Class<EVT> aEventType,
Enum<?> aAction,
String aChannel,
org.refcodes.observer.Observer<EVT> aObserver)
Similar to the more generic method
BusObservable.subscribe(EventMatcher, Observer) THOUGH subscribes for events
with the given attributes. |
<EVT extends E> |
onEvent(Class<EVT> aEventType,
Enum<?> aAction,
String aAlias,
String aGroup,
String aChannel,
String aUid,
Class<?> aPublisherType,
org.refcodes.observer.Observer<EVT> aObserver)
Similar to the more generic method
BusObservable.subscribe(EventMatcher, Observer) THOUGH subscribes for events
with the given attributes. |
<EVT extends E> |
onEvent(Class<EVT> aEventType,
String aChannel,
org.refcodes.observer.Observer<EVT> aObserver)
Similar to the more generic method
BusObservable.subscribe(EventMatcher, Observer) THOUGH subscribes for events
with the given attributes. |
<EVT extends E> |
onEvent(Class<EVT> aEventType,
String aAlias,
String aGroup,
String aChannel,
String aUid,
Class<?> aPublisherType,
org.refcodes.observer.Observer<EVT> aObserver)
Similar to the more generic method
BusObservable.subscribe(EventMatcher, Observer) THOUGH subscribes for events
with the given attributes. |
String |
onEvent(Enum<?> aAction,
Class<?> aPublisherType,
org.refcodes.observer.Observer<BusEvent> aObserver)
Similar to the more generic method
BusObservable.subscribe(EventMatcher, Observer) THOUGH subscribes for events
with the given attributes. |
String |
onEvent(Enum<?> aAction,
org.refcodes.observer.Observer<BusEvent> aObserver)
Similar to the more generic method
BusObservable.subscribe(EventMatcher, Observer) THOUGH subscribes for events
with the given attributes. |
String |
onEvent(Enum<?> aAction,
String aChannel,
org.refcodes.observer.Observer<BusEvent> aObserver)
Similar to the more generic method
BusObservable.subscribe(EventMatcher, Observer) THOUGH subscribes for events
with the given attributes. |
String |
onEvent(Enum<?> aAction,
String aAlias,
String aGroup,
String aChannel,
String aUid,
Class<?> aPublisherType,
org.refcodes.observer.Observer<BusEvent> aObserver)
Similar to the more generic method
BusObservable.subscribe(EventMatcher, Observer) THOUGH subscribes for events
with the given attributes. |
String |
onEvent(String aChannel,
org.refcodes.observer.Observer<BusEvent> aObserver)
Similar to the more generic method
BusObservable.subscribe(EventMatcher, Observer) THOUGH subscribes for events
with the given attributes. |
String |
onEvent(String aAlias,
String aGroup,
String aChannel,
String aUid,
Class<?> aPublisherType,
org.refcodes.observer.Observer<BusEvent> aObserver)
Similar to the more generic method
BusObservable.subscribe(EventMatcher, Observer) THOUGH subscribes for events
with the given attributes. |
<EVT extends E> |
onGroup(Class<EVT> aEventType,
String aGroup,
org.refcodes.observer.Observer<EVT> aObserver)
Similar to the more generic method
BusObservable.subscribe(EventMatcher, Observer) THOUGH subscribes for events
for the given group. |
String |
onGroup(String aGroup,
O aObserver)
Similar to the more generic method
BusObservable.subscribe(EventMatcher, Observer) THOUGH subscribes for events
for the given group. |
<EVT extends E> |
onName(Class<EVT> aEventType,
String aName,
org.refcodes.observer.Observer<EVT> aObserver)
Similar to the more generic method
BusObservable.subscribe(EventMatcher, Observer) THOUGH subscribes for events
with the given name. |
String |
onName(String aName,
O aObserver)
Similar to the more generic method
BusObservable.subscribe(EventMatcher, Observer) THOUGH subscribes for events
with the given name. |
<EVT extends E> |
onType(Class<EVT> aEventType,
org.refcodes.observer.Observer<EVT> aObserver)
Similar to the more generic method
BusObservable.subscribe(EventMatcher, Observer) THOUGH subscribes for events
of the given type. |
<EVT extends E> |
onUniversalId(Class<EVT> aEventType,
String aUid,
org.refcodes.observer.Observer<EVT> aObserver)
Similar to the more generic method
BusObservable.subscribe(EventMatcher, Observer) THOUGH subscribes for events
for the given Universal-ID. |
String |
onUniversalId(String aUid,
O aObserver)
Similar to the more generic method
BusObservable.subscribe(EventMatcher, Observer) THOUGH subscribes for events
for the given Universal-ID. |
default void |
publishEvent(E aEvent)
Publishes an event using the
DispatchStrategy as returned by
DispatchStrategyAccessor.getDispatchStrategy() . |
void |
publishEvent(E aEvent,
DispatchStrategy aDispatchStrategy)
Publishes an event using the given
DispatchStrategy . |
subscribe, subscribe, unsubscribeAll
hasHandle, lookupHandle, removeHandle
getDispatchStrategy
default void publishEvent(E aEvent)
DispatchStrategy
as returned by
DispatchStrategyAccessor.getDispatchStrategy()
.
publishEvent
in interface org.refcodes.observer.Publisher<E extends org.refcodes.observer.GenericEvent<?>>
void publishEvent(E aEvent, DispatchStrategy aDispatchStrategy)
DispatchStrategy
.aEvent
- aEvent The event to be published.aDispatchStrategy
- The DispatchStrategy
to be used when
publishing the event.String onEvent(Class<?> aPublisherType, org.refcodes.observer.Observer<BusEvent> aObserver)
BusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events
with the given attributes. Your Observable
may be of the required
type!aPublisherType
- The type of the event publisher.aObserver
- The observer to be notified.String onEvent(String aChannel, org.refcodes.observer.Observer<BusEvent> aObserver)
BusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events
with the given attributes. Your Observable
may be of the required
type!aChannel
- The channel name on which the event is receivable.aObserver
- The observer to be notified.String onEvent(String aAlias, String aGroup, String aChannel, String aUid, Class<?> aPublisherType, org.refcodes.observer.Observer<BusEvent> aObserver)
BusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events
with the given attributes. Your Observable
may be of the required
type!aAlias
- The alias property.aGroup
- The group property.aChannel
- The channel property.aUid
- The UID (Universal-ID) property.aPublisherType
- The type of the event publisher.aObserver
- The observer to be notified.String onEvent(Enum<?> aAction, Class<?> aPublisherType, org.refcodes.observer.Observer<BusEvent> aObserver)
BusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events
with the given attributes. Your Observable
may be of the required
type!aAction
- The action which this represents.aPublisherType
- The type of the event publisher.aObserver
- The observer to be notified.String onEvent(Enum<?> aAction, String aChannel, org.refcodes.observer.Observer<BusEvent> aObserver)
BusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events
with the given attributes. Your Observable
may be of the required
type!aAction
- The action which this represents.aChannel
- The channel name on which the event is receivable.aObserver
- The observer to be notified.String onEvent(Enum<?> aAction, String aAlias, String aGroup, String aChannel, String aUid, Class<?> aPublisherType, org.refcodes.observer.Observer<BusEvent> aObserver)
BusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events
with the given attributes. Your Observable
may be of the required
type!aAction
- The action which this represents.aAlias
- The alias property.aGroup
- The group property.aChannel
- The channel property.aUid
- The UID (Universal-ID) property.aPublisherType
- The type of the event publisher.aObserver
- The observer to be notified.String onEvent(Enum<?> aAction, org.refcodes.observer.Observer<BusEvent> aObserver)
BusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events
with the given attributes. Your Observable
may be of the required
type!aAction
- The action which this represents.aObserver
- The observer to be notified.String onName(String aName, O aObserver)
BusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events
with the given name.aName
- The name for which to subscribe.aObserver
- The observer to be notified.String onChannel(String aChannel, O aObserver)
BusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events
for the given channel.aChannel
- The name channel to which to subscribe to.aObserver
- The observer to be notified.String onGroup(String aGroup, O aObserver)
BusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events
for the given group.aGroup
- The name group to which to subscribe to.aObserver
- The observer to be notified.String onUniversalId(String aUid, O aObserver)
BusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events
for the given Universal-ID.aUid
- The name Universal-ID to which to subscribe to.aObserver
- The observer to be notified.String onAction(Enum<?> aAction, O aObserver)
BusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events
for the given action.aAction
- The name action to which to subscribe to.aObserver
- The observer to be notified.String onCatchAll(O aObserver)
BusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes all events
passing the Event-Bus. Call it a "catch-all" hook.aObserver
- The observer to be notified.<EVT extends E> String onEvent(Class<EVT> aEventType, Class<?> aPublisherType, org.refcodes.observer.Observer<EVT> aObserver)
BusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events
with the given attributes. Your Observable
may be of the required
type!aEventType
- The event type to subscribe for.aPublisherType
- The type of the event publisher.aObserver
- The observer to be notified.<EVT extends E> String onEvent(Class<EVT> aEventType, String aChannel, org.refcodes.observer.Observer<EVT> aObserver)
BusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events
with the given attributes. Your Observable
may be of the required
type!aEventType
- The event type to subscribe for.aChannel
- The channel name on which the event is receivable.aObserver
- The observer to be notified.<EVT extends E> String onEvent(Class<EVT> aEventType, String aAlias, String aGroup, String aChannel, String aUid, Class<?> aPublisherType, org.refcodes.observer.Observer<EVT> aObserver)
BusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events
with the given attributes. Your Observable
may be of the required
type!aEventType
- The event type to subscribe for.aAlias
- The alias property.aGroup
- The group property.aChannel
- The channel property.aUid
- The UID (Universal-ID) property.aPublisherType
- The type of the event publisher.aObserver
- The observer to be notified.<EVT extends E> String onEvent(Class<EVT> aEventType, Enum<?> aAction, Class<?> aPublisherType, org.refcodes.observer.Observer<EVT> aObserver)
BusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events
with the given attributes. Your Observable
may be of the required
type!aEventType
- The event type to subscribe for.aAction
- The action which this represents.aPublisherType
- The type of the event publisher.aObserver
- The observer to be notified.<EVT extends E> String onEvent(Class<EVT> aEventType, Enum<?> aAction, String aChannel, org.refcodes.observer.Observer<EVT> aObserver)
BusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events
with the given attributes. Your Observable
may be of the required
type!aEventType
- The event type to subscribe for.aAction
- The action which this represents.aChannel
- The channel name on which the event is receivable.aObserver
- The observer to be notified.<EVT extends E> String onEvent(Class<EVT> aEventType, Enum<?> aAction, String aAlias, String aGroup, String aChannel, String aUid, Class<?> aPublisherType, org.refcodes.observer.Observer<EVT> aObserver)
BusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events
with the given attributes. Your Observable
may be of the required
type!aEventType
- The event type to subscribe for.aAction
- The action which this represents.aAlias
- The alias property.aGroup
- The group property.aChannel
- The channel property.aUid
- The UID (Universal-ID) property.aPublisherType
- The type of the event publisher.aObserver
- The observer to be notified.<EVT extends E> String onEvent(Class<EVT> aEventType, Enum<?> aAction, org.refcodes.observer.Observer<EVT> aObserver)
BusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events
with the given attributes. Your Observable
may be of the required
type!aEventType
- The event type to subscribe for.aAction
- The action which this represents.aObserver
- The observer to be notified.<EVT extends E> String onType(Class<EVT> aEventType, org.refcodes.observer.Observer<EVT> aObserver)
BusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events
of the given type. Your Observable
may be of the required type!aEventType
- The event type to subscribe for.aObserver
- The observer to be notified.<EVT extends E> String onName(Class<EVT> aEventType, String aName, org.refcodes.observer.Observer<EVT> aObserver)
BusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events
with the given name.aEventType
- The event type to subscribe for.aName
- The name for which to subscribe.aObserver
- The observer to be notified.<EVT extends E> String onChannel(Class<EVT> aEventType, String aChannel, org.refcodes.observer.Observer<EVT> aObserver)
BusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events
for the given channel.aEventType
- The event type to subscribe for.aChannel
- The name channel to which to subscribe to.aObserver
- The observer to be notified.<EVT extends E> String onGroup(Class<EVT> aEventType, String aGroup, org.refcodes.observer.Observer<EVT> aObserver)
BusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events
for the given group.aEventType
- The event type to subscribe for.aGroup
- The name group to which to subscribe to.aObserver
- The observer to be notified.<EVT extends E> String onUniversalId(Class<EVT> aEventType, String aUid, org.refcodes.observer.Observer<EVT> aObserver)
BusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events
for the given Universal-ID.aEventType
- The event type to subscribe for.aUid
- The name Universal-ID to which to subscribe to.aObserver
- The observer to be notified.<EVT extends E> String onAction(Class<EVT> aEventType, Enum<?> aAction, org.refcodes.observer.Observer<EVT> aObserver)
BusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events
for the given action.aEventType
- The event type to subscribe for.aAction
- The name action to which to subscribe to.aObserver
- The observer to be notified.Copyright © 2018. All rights reserved.