java.lang.Object
org.refcodes.eventbus.AbstractEventBus<EventBusEvent,org.refcodes.observer.Observer<EventBusEvent>,EventBusEventMatcher,org.refcodes.observer.EventMetaData,String>
org.refcodes.eventbus.EventBus
- All Implemented Interfaces:
Destroyable
,org.refcodes.component.HandleLookup<String,
,org.refcodes.observer.Observer<EventBusEvent>> DispatchStrategyAccessor
,EventBroker<EventBusEvent,
,EventBusEventMatcher> EventBusObservable<EventBusEvent,
,org.refcodes.observer.Observer<EventBusEvent>, EventBusEventMatcher, String> EventBusPublisher<EventBusEvent>
,EventDispatcher<EventBusEvent,
,org.refcodes.observer.Observer<EventBusEvent>, EventBusEventMatcher, org.refcodes.observer.EventMetaData, String> org.refcodes.matcher.Matchable<EventBusEvent>
,org.refcodes.observer.Publisher<EventBusEvent>
public class EventBus
extends AbstractEventBus<EventBusEvent,org.refcodes.observer.Observer<EventBusEvent>,EventBusEventMatcher,org.refcodes.observer.EventMetaData,String>
implements EventBroker<EventBusEvent,EventBusEventMatcher>
The
EventBus
defines a predefined EventDispatcher
tailored to
use the MetaDataActionEvent
as event type to use. This grants
interoperability with other MetaDataActionEvent
based systems.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.refcodes.eventbus.DispatchStrategyAccessor
DispatchStrategyAccessor.DispatchStrategyMutator, DispatchStrategyAccessor.DispatchStrategyProperty
-
Constructor Summary
ConstructorDescriptionEventBus()
Constructs theEventBus
with theDispatchStrategy
beingDispatchStrategy.CASCADE
when publishing events.EventBus
(boolean isDaemon) Constructs theEventBus
with theDispatchStrategy
beingDispatchStrategy.CASCADE
when publishing events.EventBus
(ExecutorService aExecutorService) Constructs theEventBus
with theDispatchStrategy
beingDispatchStrategy.CASCADE
when publishing events.EventBus
(DispatchStrategy aDispatchStrategy) Constructs theEventBus
with the givenDispatchStrategy
when publishing events.EventBus
(DispatchStrategy aDispatchStrategy, boolean isDaemon) Constructs theEventBus
with the givenDispatchStrategy
when publishing events.EventBus
(DispatchStrategy aDispatchStrategy, ExecutorService aExecutorService) Constructs theEventBus
with theDispatchStrategy
beingDispatchStrategy.CASCADE
when publishing events. -
Method Summary
Modifier and TypeMethodDescriptiononAction
(Class<EventBusEvent> aEventType, Enum<?> aAction, org.refcodes.observer.Observer<EventBusEvent> aObserver) Similar to the more generic methodEventBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events for the given action.onAction
(Enum<?> aAction, org.refcodes.observer.Observer<EventBusEvent> aObserver) Similar to the more generic methodEventBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events for the given action.onActions
(Class<EventBusEvent> aEventType, org.refcodes.observer.Observer<EventBusEvent> aObserver, Enum<?>... aActions) Similar to the more generic methodEventBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events for the given action.onActions
(org.refcodes.observer.Observer<EventBusEvent> aObserver, Enum<?>... aActions) Similar to the more generic methodEventBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events for the given action.onAlias
(Class<EventBusEvent> aEventType, String aName, org.refcodes.observer.Observer<EventBusEvent> aObserver) Similar to the more generic methodEventBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events with the given name.onAlias
(String aName, org.refcodes.observer.Observer<EventBusEvent> aObserver) Similar to the more generic methodEventBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events with the given name.onCatchAll
(org.refcodes.observer.Observer<EventBusEvent> aObserver) Similar to the more generic methodEventBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes all events passing the Event-Bus.onChannel
(Class<EventBusEvent> aEventType, String aChannel, org.refcodes.observer.Observer<EventBusEvent> aObserver) Similar to the more generic methodEventBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events for the given channel.onChannel
(String aChannel, org.refcodes.observer.Observer<EventBusEvent> aObserver) Similar to the more generic methodEventBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events for the given channel.onEvent
(Class<?> aPublisherType, org.refcodes.observer.Observer<EventBusEvent> aObserver) Similar to the more generic methodEventBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events with the given attributes.onEvent
(Class<EventBusEvent> aEventType, Class<?> aPublisherType, org.refcodes.observer.Observer<EventBusEvent> aObserver) Similar to the more generic methodEventBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events with the given attributes.onEvent
(Class<EventBusEvent> aEventType, Enum<?> aAction, Class<?> aPublisherType, org.refcodes.observer.Observer<EventBusEvent> aObserver) Similar to the more generic methodEventBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events with the given attributes.onEvent
(Class<EventBusEvent> aEventType, Enum<?> aAction, String aAlias, String aGroup, String aChannel, String aUid, Class<?> aPublisherType, org.refcodes.observer.Observer<EventBusEvent> aObserver) Similar to the more generic methodEventBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events with the given attributes.onEvent
(Class<EventBusEvent> aEventType, Enum<?> aAction, String aChannel, org.refcodes.observer.Observer<EventBusEvent> aObserver) Similar to the more generic methodEventBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events with the given attributes.onEvent
(Class<EventBusEvent> aEventType, Enum<?> aAction, org.refcodes.observer.Observer<EventBusEvent> aObserver) Similar to the more generic methodEventBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events with the given attributes.onEvent
(Class<EventBusEvent> aEventType, String aAlias, String aGroup, String aChannel, String aUid, Class<?> aPublisherType, org.refcodes.observer.Observer<EventBusEvent> aObserver) Similar to the more generic methodEventBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events with the given attributes.onEvent
(Class<EventBusEvent> aEventType, String aChannel, org.refcodes.observer.Observer<EventBusEvent> aObserver) Similar to the more generic methodEventBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events with the given attributes.onEvent
(Enum<?> aAction, Class<?> aPublisherType, org.refcodes.observer.Observer<EventBusEvent> aObserver) Similar to the more generic methodEventBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events with the given attributes.onEvent
(Enum<?> aAction, String aAlias, String aGroup, String aChannel, String aUid, Class<?> aPublisherType, org.refcodes.observer.Observer<EventBusEvent> aObserver) Similar to the more generic methodEventBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events with the given attributes.onEvent
(Enum<?> aAction, String aChannel, org.refcodes.observer.Observer<EventBusEvent> aObserver) Similar to the more generic methodEventBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events with the given attributes.onEvent
(Enum<?> aAction, org.refcodes.observer.Observer<EventBusEvent> aObserver) Similar to the more generic methodEventBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events with the given attributes.onEvent
(String aAlias, String aGroup, String aChannel, String aUid, Class<?> aPublisherType, org.refcodes.observer.Observer<EventBusEvent> aObserver) Similar to the more generic methodEventBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events with the given attributes.onEvent
(String aChannel, org.refcodes.observer.Observer<EventBusEvent> aObserver) Similar to the more generic methodEventBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events with the given attributes.onGroup
(Class<EventBusEvent> aEventType, String aGroup, org.refcodes.observer.Observer<EventBusEvent> aObserver) Similar to the more generic methodEventBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events for the given group.onGroup
(String aGroup, org.refcodes.observer.Observer<EventBusEvent> aObserver) Similar to the more generic methodEventBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events for the given group.<EVT extends EventBusEvent>
StringSimilar to the more generic methodEventBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events of the given type.onUniversalId
(Class<EventBusEvent> aEventType, String aUid, org.refcodes.observer.Observer<EventBusEvent> aObserver) Similar to the more generic methodEventBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events for the given Universal-TID.onUniversalId
(String aUid, org.refcodes.observer.Observer<EventBusEvent> aObserver) Similar to the more generic methodEventBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events for the given Universal-TID.void
publishEvent
(Class<?> aPublisherType) Fires an event with the according properties.void
publishEvent
(Class<?> aPublisherType, DispatchStrategy aStrategy) Fires an event with the according properties.void
publishEvent
(Enum<?> aAction) Fires an event with the according properties.void
publishEvent
(Enum<?> aAction, Class<?> aPublisherType) Fires an event with the according properties.void
publishEvent
(Enum<?> aAction, Class<?> aPublisherType, DispatchStrategy aStrategy) Fires an event with the according properties.void
publishEvent
(Enum<?> aAction, String aChannel) Fires an event with the according properties.void
publishEvent
(Enum<?> aAction, String aChannel, Class<?> aPublisherType) Fires an event with the according properties.void
publishEvent
(Enum<?> aAction, String aAlias, String aGroup, String aChannel, String aUid, Class<?> aPublisherType) Fires an event with the according properties.void
publishEvent
(Enum<?> aAction, String aAlias, String aGroup, String aChannel, String aUid, Class<?> aPublisherType, DispatchStrategy aStrategy) Fires an event with the according properties.void
publishEvent
(Enum<?> aAction, String aChannel, DispatchStrategy aStrategy) Fires an event with the according properties.void
publishEvent
(Enum<?> aAction, DispatchStrategy aStrategy) Fires an event with the according properties.void
publishEvent
(Enum<?> aAction, org.refcodes.observer.EventMetaData aEventMetaData) Fires an event with the according properties.void
publishEvent
(Enum<?> aAction, org.refcodes.observer.EventMetaData aEventMetaData, DispatchStrategy aStrategy) Fires an event with the according properties.void
publishEvent
(String aChannel) Fires an event with the according properties.void
Fires an event with the according properties.void
publishEvent
(String aAlias, String aGroup, String aChannel, String aUid, Class<?> aPublisherType, DispatchStrategy aStrategy) Fires an event with the according properties.void
publishEvent
(String aChannel, DispatchStrategy aStrategy) Fires an event with the according properties.void
publishEvent
(org.refcodes.observer.EventMetaData aEventMetaData) Fires an event with the according properties.void
publishEvent
(org.refcodes.observer.EventMetaData aEventMetaData, DispatchStrategy aStrategy) Fires an event with the according properties.<EVT extends EventBusEvent>
Stringsubscribe
(Class<EVT> aEventType, EventBusEventMatcher aEventMatcher, org.refcodes.observer.Observer<EVT> aObserver) Subscribes a listener to the event bus.<EVT extends EventBusEvent>
StringSubscribes a listener to the event bus.Methods inherited from class org.refcodes.eventbus.AbstractEventBus
cascadeDispatch, destroy, getDispatchStrategy, hasHandle, isMatching, lookupHandle, parallelDispatch, publishEvent, removeHandle, sequentialDispatch, subscribe, unsubscribeAll
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.security.auth.Destroyable
isDestroyed
Methods inherited from interface org.refcodes.eventbus.DispatchStrategyAccessor
getDispatchStrategy
Methods inherited from interface org.refcodes.eventbus.EventBusObservable
subscribe, unsubscribeAll
Methods inherited from interface org.refcodes.eventbus.EventDispatcher
publishEvent, publishEvent
Methods inherited from interface org.refcodes.component.HandleLookup
hasHandle, lookupHandle, removeHandle
Methods inherited from interface org.refcodes.matcher.Matchable
isMatching
-
Constructor Details
-
EventBus
public EventBus()Constructs theEventBus
with theDispatchStrategy
beingDispatchStrategy.CASCADE
when publishing events. -
EventBus
public EventBus(boolean isDaemon) Constructs theEventBus
with theDispatchStrategy
beingDispatchStrategy.CASCADE
when publishing events. -
EventBus
Constructs theEventBus
with theDispatchStrategy
beingDispatchStrategy.CASCADE
when publishing events.- Parameters:
aExecutorService
- TheExecutorService
to be used when creating threads.
-
EventBus
Constructs theEventBus
with the givenDispatchStrategy
when publishing events.- Parameters:
aDispatchStrategy
- TheDispatchStrategy
to be used when publishing events.
-
EventBus
Constructs theEventBus
with the givenDispatchStrategy
when publishing events.- Parameters:
aDispatchStrategy
- TheDispatchStrategy
to be used when publishing events.isDaemon
- True when to create daemon dispatchThread
instances (shutdown upon last applicationThread
shutdown), else applicationThread
instances are created for dispatch.
-
EventBus
Constructs theEventBus
with theDispatchStrategy
beingDispatchStrategy.CASCADE
when publishing events.- Parameters:
aDispatchStrategy
- TheDispatchStrategy
to be used when publishing events.aExecutorService
- TheExecutorService
to be used when creating threads.
-
-
Method Details
-
onAlias
Similar to the more generic methodEventBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events with the given name.- Specified by:
onAlias
in interfaceEventDispatcher<EventBusEvent,
org.refcodes.observer.Observer<EventBusEvent>, EventBusEventMatcher, org.refcodes.observer.EventMetaData, String> - Parameters:
aName
- The name for which to subscribe.aObserver
- The observer to be notified.- Returns:
- A handle to unsubscribe this combination.
-
onChannel
Similar to the more generic methodEventBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events for the given channel.- Specified by:
onChannel
in interfaceEventDispatcher<EventBusEvent,
org.refcodes.observer.Observer<EventBusEvent>, EventBusEventMatcher, org.refcodes.observer.EventMetaData, String> - Parameters:
aChannel
- The channel to which to subscribe to.aObserver
- The observer to be notified.- Returns:
- A handle to unsubscribe this combination.
-
onGroup
Similar to the more generic methodEventBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events for the given group.- Specified by:
onGroup
in interfaceEventDispatcher<EventBusEvent,
org.refcodes.observer.Observer<EventBusEvent>, EventBusEventMatcher, org.refcodes.observer.EventMetaData, String> - Parameters:
aGroup
- The group to which to subscribe to.aObserver
- The observer to be notified.- Returns:
- A handle to unsubscribe this combination.
-
onUniversalId
Similar to the more generic methodEventBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events for the given Universal-TID.- Specified by:
onUniversalId
in interfaceEventDispatcher<EventBusEvent,
org.refcodes.observer.Observer<EventBusEvent>, EventBusEventMatcher, org.refcodes.observer.EventMetaData, String> - Parameters:
aUid
- The Universal-TID to which to subscribe to.aObserver
- The observer to be notified.- Returns:
- A handle to unsubscribe this combination.
-
onAction
Similar to the more generic methodEventBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events for the given action.- Specified by:
onAction
in interfaceEventDispatcher<EventBusEvent,
org.refcodes.observer.Observer<EventBusEvent>, EventBusEventMatcher, org.refcodes.observer.EventMetaData, String> - Parameters:
aAction
- The action to which to subscribe to.aObserver
- The observer to be notified.- Returns:
- A handle to unsubscribe this combination.
-
onActions
public String onActions(org.refcodes.observer.Observer<EventBusEvent> aObserver, Enum<?>... aActions) Similar to the more generic methodEventBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events for the given action.- Specified by:
onActions
in interfaceEventDispatcher<EventBusEvent,
org.refcodes.observer.Observer<EventBusEvent>, EventBusEventMatcher, org.refcodes.observer.EventMetaData, String> - Parameters:
aObserver
- The observer to be notified.aActions
- The actions to which to subscribe to.- Returns:
- A handle to unsubscribe this combination.
-
onCatchAll
Similar to the more generic methodEventBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes all events passing the Event-Bus. Call it a "catch-all" hook.- Specified by:
onCatchAll
in interfaceEventDispatcher<EventBusEvent,
org.refcodes.observer.Observer<EventBusEvent>, EventBusEventMatcher, org.refcodes.observer.EventMetaData, String> - Parameters:
aObserver
- The observer to be notified.- Returns:
- A handle to unsubscribe this combination.
-
onEvent
public String onEvent(Class<?> aPublisherType, org.refcodes.observer.Observer<EventBusEvent> aObserver) Similar to the more generic methodEventBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events with the given attributes.- Specified by:
onEvent
in interfaceEventDispatcher<EventBusEvent,
org.refcodes.observer.Observer<EventBusEvent>, EventBusEventMatcher, org.refcodes.observer.EventMetaData, String> - Parameters:
aPublisherType
- The type of the event publisher.aObserver
- The observer to be notified.- Returns:
- A handle to unsubscribe this combination.
-
onEvent
Similar to the more generic methodEventBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events with the given attributes.- Specified by:
onEvent
in interfaceEventDispatcher<EventBusEvent,
org.refcodes.observer.Observer<EventBusEvent>, EventBusEventMatcher, org.refcodes.observer.EventMetaData, String> - Parameters:
aChannel
- The channel name on which the event is receivable.aObserver
- The observer to be notified.- Returns:
- A handle to unsubscribe this combination.
-
onEvent
public String onEvent(String aAlias, String aGroup, String aChannel, String aUid, Class<?> aPublisherType, org.refcodes.observer.Observer<EventBusEvent> aObserver) Similar to the more generic methodEventBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events with the given attributes.- Specified by:
onEvent
in interfaceEventDispatcher<EventBusEvent,
org.refcodes.observer.Observer<EventBusEvent>, EventBusEventMatcher, org.refcodes.observer.EventMetaData, String> - Parameters:
aAlias
- The alias property.aGroup
- The group property.aChannel
- The channel property.aUid
- The UID (Universal-TID) property.aPublisherType
- The type of the event publisher.aObserver
- The observer to be notified.- Returns:
- A handle to unsubscribe this combination.
-
onEvent
public String onEvent(Enum<?> aAction, Class<?> aPublisherType, org.refcodes.observer.Observer<EventBusEvent> aObserver) Similar to the more generic methodEventBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events with the given attributes.- Specified by:
onEvent
in interfaceEventDispatcher<EventBusEvent,
org.refcodes.observer.Observer<EventBusEvent>, EventBusEventMatcher, org.refcodes.observer.EventMetaData, String> - Parameters:
aAction
- The action which this represents.aPublisherType
- The type of the event publisher.aObserver
- The observer to be notified.- Returns:
- A handle to unsubscribe this combination.
-
onEvent
public String onEvent(Enum<?> aAction, String aChannel, org.refcodes.observer.Observer<EventBusEvent> aObserver) Similar to the more generic methodEventBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events with the given attributes.- Specified by:
onEvent
in interfaceEventDispatcher<EventBusEvent,
org.refcodes.observer.Observer<EventBusEvent>, EventBusEventMatcher, org.refcodes.observer.EventMetaData, String> - Parameters:
aAction
- The action which this represents.aChannel
- The channel name on which the event is receivable.aObserver
- The observer to be notified.- Returns:
- A handle to unsubscribe this combination.
-
onEvent
public String onEvent(Enum<?> aAction, String aAlias, String aGroup, String aChannel, String aUid, Class<?> aPublisherType, org.refcodes.observer.Observer<EventBusEvent> aObserver) Similar to the more generic methodEventBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events with the given attributes.- Specified by:
onEvent
in interfaceEventDispatcher<EventBusEvent,
org.refcodes.observer.Observer<EventBusEvent>, EventBusEventMatcher, org.refcodes.observer.EventMetaData, String> - Parameters:
aAction
- The action which this represents.aAlias
- The alias property.aGroup
- The group property.aChannel
- The channel property.aUid
- The UID (Universal-TID) property.aPublisherType
- The type of the event publisher.aObserver
- The observer to be notified.- Returns:
- A handle to unsubscribe this combination.
-
onEvent
Similar to the more generic methodEventBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events with the given attributes. YourObservable
may be of the required type!- Specified by:
onEvent
in interfaceEventDispatcher<EventBusEvent,
org.refcodes.observer.Observer<EventBusEvent>, EventBusEventMatcher, org.refcodes.observer.EventMetaData, String> - Parameters:
aAction
- The action which this represents.aObserver
- The observer to be notified.- Returns:
- A handle to unsubscribe this combination.
-
onEvent
public String onEvent(Class<EventBusEvent> aEventType, Class<?> aPublisherType, org.refcodes.observer.Observer<EventBusEvent> aObserver) Similar to the more generic methodEventBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events with the given attributes. YourObservable
may be of the required type!- Specified by:
onEvent
in interfaceEventDispatcher<EventBusEvent,
org.refcodes.observer.Observer<EventBusEvent>, EventBusEventMatcher, org.refcodes.observer.EventMetaData, String> - Parameters:
aEventType
- The event type to subscribe for.aPublisherType
- The type of the event publisher.aObserver
- The observer to be notified.- Returns:
- A handle to unsubscribe this combination.
-
onEvent
public String onEvent(Class<EventBusEvent> aEventType, String aChannel, org.refcodes.observer.Observer<EventBusEvent> aObserver) Similar to the more generic methodEventBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events with the given attributes. YourObservable
may be of the required type!- Specified by:
onEvent
in interfaceEventDispatcher<EventBusEvent,
org.refcodes.observer.Observer<EventBusEvent>, EventBusEventMatcher, org.refcodes.observer.EventMetaData, String> - Parameters:
aEventType
- The event type to subscribe for.aChannel
- The channel name on which the event is receivable.aObserver
- The observer to be notified.- Returns:
- A handle to unsubscribe this combination.
-
onEvent
public String onEvent(Class<EventBusEvent> aEventType, String aAlias, String aGroup, String aChannel, String aUid, Class<?> aPublisherType, org.refcodes.observer.Observer<EventBusEvent> aObserver) Similar to the more generic methodEventBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events with the given attributes. YourObservable
may be of the required type!- Specified by:
onEvent
in interfaceEventDispatcher<EventBusEvent,
org.refcodes.observer.Observer<EventBusEvent>, EventBusEventMatcher, org.refcodes.observer.EventMetaData, String> - Parameters:
aEventType
- The event type to subscribe for.aAlias
- The alias property.aGroup
- The group property.aChannel
- The channel property.aUid
- The UID (Universal-TID) property.aPublisherType
- The type of the event publisher.aObserver
- The observer to be notified.- Returns:
- A handle to unsubscribe this combination.
-
onEvent
public String onEvent(Class<EventBusEvent> aEventType, Enum<?> aAction, Class<?> aPublisherType, org.refcodes.observer.Observer<EventBusEvent> aObserver) Similar to the more generic methodEventBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events with the given attributes. YourObservable
may be of the required type!- Specified by:
onEvent
in interfaceEventDispatcher<EventBusEvent,
org.refcodes.observer.Observer<EventBusEvent>, EventBusEventMatcher, org.refcodes.observer.EventMetaData, String> - Parameters:
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.- Returns:
- A handle to unsubscribe this combination.
-
onEvent
public String onEvent(Class<EventBusEvent> aEventType, Enum<?> aAction, String aChannel, org.refcodes.observer.Observer<EventBusEvent> aObserver) Similar to the more generic methodEventBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events with the given attributes. YourObservable
may be of the required type!- Specified by:
onEvent
in interfaceEventDispatcher<EventBusEvent,
org.refcodes.observer.Observer<EventBusEvent>, EventBusEventMatcher, org.refcodes.observer.EventMetaData, String> - Parameters:
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.- Returns:
- A handle to unsubscribe this combination.
-
onEvent
public String onEvent(Class<EventBusEvent> aEventType, Enum<?> aAction, String aAlias, String aGroup, String aChannel, String aUid, Class<?> aPublisherType, org.refcodes.observer.Observer<EventBusEvent> aObserver) Similar to the more generic methodEventBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events with the given attributes. YourObservable
may be of the required type!- Specified by:
onEvent
in interfaceEventDispatcher<EventBusEvent,
org.refcodes.observer.Observer<EventBusEvent>, EventBusEventMatcher, org.refcodes.observer.EventMetaData, String> - Parameters:
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-TID) property.aPublisherType
- The type of the event publisher.aObserver
- The observer to be notified.- Returns:
- A handle to unsubscribe this combination.
-
onEvent
public String onEvent(Class<EventBusEvent> aEventType, Enum<?> aAction, org.refcodes.observer.Observer<EventBusEvent> aObserver) Similar to the more generic methodEventBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events with the given attributes. YourObservable
may be of the required type!- Specified by:
onEvent
in interfaceEventDispatcher<EventBusEvent,
org.refcodes.observer.Observer<EventBusEvent>, EventBusEventMatcher, org.refcodes.observer.EventMetaData, String> - Parameters:
aEventType
- The event type to subscribe for.aAction
- The action which this represents.aObserver
- The observer to be notified.- Returns:
- A handle to unsubscribe this combination.
-
subscribe
public <EVT extends EventBusEvent> String subscribe(Class<EVT> aEventType, EventBusEventMatcher aEventMatcher, org.refcodes.observer.Observer<EVT> aObserver) Subscribes a listener to the event bus. In case the handle is being ignored, use the "unsubscribeAll" method where all subscriptions for a listener are removed.- Specified by:
subscribe
in interfaceEventBusObservable<EventBusEvent,
org.refcodes.observer.Observer<EventBusEvent>, EventBusEventMatcher, String> - Type Parameters:
EVT
- The type of the event to subscribe for.- Parameters:
aEventType
- The type of event to observe.aEventMatcher
- TheEventMatcher
to guard theObserver
.aObserver
- TheObserver
to subscribe.- Returns:
- A handle to unsubscribe this combination.
-
subscribe
public <EVT extends EventBusEvent> String subscribe(Class<EVT> aEventType, org.refcodes.observer.Observer<EVT> aObserver) Subscribes a listener to the event bus. In case the handle is being ignored, use the "unsubscribeAll" method where all subscriptions for a listener are removed.- Specified by:
subscribe
in interfaceEventBusObservable<EventBusEvent,
org.refcodes.observer.Observer<EventBusEvent>, EventBusEventMatcher, String> - Type Parameters:
EVT
- The type of the event to subscribe for.- Parameters:
aEventType
- The type of event to observe.aObserver
- TheObserver
to subscribe.- Returns:
- A handle to unsubscribe this combination.
-
onType
public <EVT extends EventBusEvent> String onType(Class<EVT> aEventType, org.refcodes.observer.Observer<EVT> aObserver) Similar to the more generic methodEventBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events of the given type. YourObservable
may be of the required type!- Specified by:
onType
in interfaceEventDispatcher<EventBusEvent,
org.refcodes.observer.Observer<EventBusEvent>, EventBusEventMatcher, org.refcodes.observer.EventMetaData, String> - Type Parameters:
EVT
- The type of the event to subscribe for.- Parameters:
aEventType
- The event type to subscribe for.aObserver
- The observer to be notified.- Returns:
- A handle to unsubscribe this combination.
-
onAlias
public String onAlias(Class<EventBusEvent> aEventType, String aName, org.refcodes.observer.Observer<EventBusEvent> aObserver) Similar to the more generic methodEventBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events with the given name.- Specified by:
onAlias
in interfaceEventDispatcher<EventBusEvent,
org.refcodes.observer.Observer<EventBusEvent>, EventBusEventMatcher, org.refcodes.observer.EventMetaData, String> - Parameters:
aEventType
- The event type to subscribe for.aName
- The name for which to subscribe.aObserver
- The observer to be notified.- Returns:
- A handle to unsubscribe this combination.
-
onChannel
public String onChannel(Class<EventBusEvent> aEventType, String aChannel, org.refcodes.observer.Observer<EventBusEvent> aObserver) Similar to the more generic methodEventBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events for the given channel.- Specified by:
onChannel
in interfaceEventDispatcher<EventBusEvent,
org.refcodes.observer.Observer<EventBusEvent>, EventBusEventMatcher, org.refcodes.observer.EventMetaData, String> - Parameters:
aEventType
- The event type to subscribe for.aChannel
- The channel to which to subscribe to.aObserver
- The observer to be notified.- Returns:
- A handle to unsubscribe this combination.
-
onGroup
public String onGroup(Class<EventBusEvent> aEventType, String aGroup, org.refcodes.observer.Observer<EventBusEvent> aObserver) Similar to the more generic methodEventBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events for the given group.- Specified by:
onGroup
in interfaceEventDispatcher<EventBusEvent,
org.refcodes.observer.Observer<EventBusEvent>, EventBusEventMatcher, org.refcodes.observer.EventMetaData, String> - Parameters:
aEventType
- The event type to subscribe for.aGroup
- The group to which to subscribe to.aObserver
- The observer to be notified.- Returns:
- A handle to unsubscribe this combination.
-
onUniversalId
public String onUniversalId(Class<EventBusEvent> aEventType, String aUid, org.refcodes.observer.Observer<EventBusEvent> aObserver) Similar to the more generic methodEventBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events for the given Universal-TID.- Specified by:
onUniversalId
in interfaceEventDispatcher<EventBusEvent,
org.refcodes.observer.Observer<EventBusEvent>, EventBusEventMatcher, org.refcodes.observer.EventMetaData, String> - Parameters:
aEventType
- The event type to subscribe for.aUid
- The Universal-TID to which to subscribe to.aObserver
- The observer to be notified.- Returns:
- A handle to unsubscribe this combination.
-
onAction
public String onAction(Class<EventBusEvent> aEventType, Enum<?> aAction, org.refcodes.observer.Observer<EventBusEvent> aObserver) Similar to the more generic methodEventBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events for the given action.- Specified by:
onAction
in interfaceEventDispatcher<EventBusEvent,
org.refcodes.observer.Observer<EventBusEvent>, EventBusEventMatcher, org.refcodes.observer.EventMetaData, String> - Parameters:
aEventType
- The event type to subscribe for.aAction
- The action to which to subscribe to.aObserver
- The observer to be notified.- Returns:
- A handle to unsubscribe this combination.
-
onActions
public String onActions(Class<EventBusEvent> aEventType, org.refcodes.observer.Observer<EventBusEvent> aObserver, Enum<?>... aActions) Similar to the more generic methodEventBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events for the given action.- Specified by:
onActions
in interfaceEventDispatcher<EventBusEvent,
org.refcodes.observer.Observer<EventBusEvent>, EventBusEventMatcher, org.refcodes.observer.EventMetaData, String> - Parameters:
aEventType
- The event type to subscribe for.aObserver
- The observer to be notified.aActions
- The actions to which to subscribe to.- Returns:
- A handle to unsubscribe this combination.
-
publishEvent
Fires an event with the according properties.- Specified by:
publishEvent
in interfaceEventDispatcher<EventBusEvent,
org.refcodes.observer.Observer<EventBusEvent>, EventBusEventMatcher, org.refcodes.observer.EventMetaData, String> - Parameters:
aPublisherType
- The type of the event publisher.
-
publishEvent
Fires an event with the according properties.- Specified by:
publishEvent
in interfaceEventDispatcher<EventBusEvent,
org.refcodes.observer.Observer<EventBusEvent>, EventBusEventMatcher, org.refcodes.observer.EventMetaData, String> - Parameters:
aChannel
- The channel name on which the event is receivable.
-
publishEvent
public void publishEvent(String aAlias, String aGroup, String aChannel, String aUid, Class<?> aPublisherType) Fires an event with the according properties.- Specified by:
publishEvent
in interfaceEventDispatcher<EventBusEvent,
org.refcodes.observer.Observer<EventBusEvent>, EventBusEventMatcher, org.refcodes.observer.EventMetaData, String> - Parameters:
aAlias
- The alias property.aGroup
- The group property.aChannel
- The channel property.aUid
- The UID (Universal-TID) property.aPublisherType
- The type of the event publisher.
-
publishEvent
Fires an event with the according properties.- Specified by:
publishEvent
in interfaceEventDispatcher<EventBusEvent,
org.refcodes.observer.Observer<EventBusEvent>, EventBusEventMatcher, org.refcodes.observer.EventMetaData, String> - Parameters:
aAction
- The action which this represents.aPublisherType
- The type of the event publisher.
-
publishEvent
Fires an event with the according properties.- Specified by:
publishEvent
in interfaceEventDispatcher<EventBusEvent,
org.refcodes.observer.Observer<EventBusEvent>, EventBusEventMatcher, org.refcodes.observer.EventMetaData, String> - Parameters:
aAction
- The action which this represents.aChannel
- The channel name on which the event is receivable.
-
publishEvent
Fires an event with the according properties.- Specified by:
publishEvent
in interfaceEventDispatcher<EventBusEvent,
org.refcodes.observer.Observer<EventBusEvent>, EventBusEventMatcher, org.refcodes.observer.EventMetaData, String> - Parameters:
aAction
- The action which this represents.aChannel
- The channel name on which the event is receivable.aPublisherType
- The publisher type for theEventMetaData
.
-
publishEvent
public void publishEvent(Enum<?> aAction, String aAlias, String aGroup, String aChannel, String aUid, Class<?> aPublisherType) Fires an event with the according properties.- Specified by:
publishEvent
in interfaceEventDispatcher<EventBusEvent,
org.refcodes.observer.Observer<EventBusEvent>, EventBusEventMatcher, org.refcodes.observer.EventMetaData, String> - Parameters:
aAction
- The action which this represents.aAlias
- The alias property.aGroup
- The group property.aChannel
- The channel property.aUid
- The UID (Universal-TID) property.aPublisherType
- The type of the event publisher.
-
publishEvent
public void publishEvent(org.refcodes.observer.EventMetaData aEventMetaData) Fires an event with the according properties.- Specified by:
publishEvent
in interfaceEventDispatcher<EventBusEvent,
org.refcodes.observer.Observer<EventBusEvent>, EventBusEventMatcher, org.refcodes.observer.EventMetaData, String> - Parameters:
aEventMetaData
- The Meta-Data to be supplied by the event.
-
publishEvent
Fires an event with the according properties.- Specified by:
publishEvent
in interfaceEventDispatcher<EventBusEvent,
org.refcodes.observer.Observer<EventBusEvent>, EventBusEventMatcher, org.refcodes.observer.EventMetaData, String> - Parameters:
aAction
- The action which this represents.aEventMetaData
- The Meta-Data to be supplied by the event.
-
publishEvent
Fires an event with the according properties.- Specified by:
publishEvent
in interfaceEventDispatcher<EventBusEvent,
org.refcodes.observer.Observer<EventBusEvent>, EventBusEventMatcher, org.refcodes.observer.EventMetaData, String> - Parameters:
aAction
- The action which this represents.
-
publishEvent
Fires an event with the according properties.- Specified by:
publishEvent
in interfaceEventDispatcher<EventBusEvent,
org.refcodes.observer.Observer<EventBusEvent>, EventBusEventMatcher, org.refcodes.observer.EventMetaData, String> - Parameters:
aPublisherType
- The type of the event publisher.aStrategy
- TheDispatchStrategy
to use when dispatching the event.
-
publishEvent
Fires an event with the according properties.- Specified by:
publishEvent
in interfaceEventDispatcher<EventBusEvent,
org.refcodes.observer.Observer<EventBusEvent>, EventBusEventMatcher, org.refcodes.observer.EventMetaData, String> - Parameters:
aChannel
- The channel name on which the event is receivable.aStrategy
- TheDispatchStrategy
to use when dispatching the event.
-
publishEvent
public void publishEvent(String aAlias, String aGroup, String aChannel, String aUid, Class<?> aPublisherType, DispatchStrategy aStrategy) Fires an event with the according properties.- Specified by:
publishEvent
in interfaceEventDispatcher<EventBusEvent,
org.refcodes.observer.Observer<EventBusEvent>, EventBusEventMatcher, org.refcodes.observer.EventMetaData, String> - Parameters:
aAlias
- The alias property.aGroup
- The group property.aChannel
- The channel property.aUid
- The UID (Universal-TID) property.aPublisherType
- The type of the event publisher.aStrategy
- TheDispatchStrategy
to use when dispatching the event.
-
publishEvent
Fires an event with the according properties.- Specified by:
publishEvent
in interfaceEventDispatcher<EventBusEvent,
org.refcodes.observer.Observer<EventBusEvent>, EventBusEventMatcher, org.refcodes.observer.EventMetaData, String> - Parameters:
aAction
- The action which this represents.aPublisherType
- The type of the event publisher.aStrategy
- TheDispatchStrategy
to use when dispatching the event.
-
publishEvent
Fires an event with the according properties.- Specified by:
publishEvent
in interfaceEventDispatcher<EventBusEvent,
org.refcodes.observer.Observer<EventBusEvent>, EventBusEventMatcher, org.refcodes.observer.EventMetaData, String> - Parameters:
aAction
- The action which this represents.aChannel
- The channel name on which the event is receivable.aStrategy
- TheDispatchStrategy
to use when dispatching the event.
-
publishEvent
public void publishEvent(Enum<?> aAction, String aAlias, String aGroup, String aChannel, String aUid, Class<?> aPublisherType, DispatchStrategy aStrategy) Fires an event with the according properties.- Specified by:
publishEvent
in interfaceEventDispatcher<EventBusEvent,
org.refcodes.observer.Observer<EventBusEvent>, EventBusEventMatcher, org.refcodes.observer.EventMetaData, String> - Parameters:
aAction
- The action which this represents.aAlias
- The alias property.aGroup
- The group property.aChannel
- The channel property.aUid
- The UID (Universal-TID) property.aPublisherType
- The type of the event publisher.aStrategy
- TheDispatchStrategy
to use when dispatching the event.
-
publishEvent
public void publishEvent(org.refcodes.observer.EventMetaData aEventMetaData, DispatchStrategy aStrategy) Fires an event with the according properties.- Specified by:
publishEvent
in interfaceEventDispatcher<EventBusEvent,
org.refcodes.observer.Observer<EventBusEvent>, EventBusEventMatcher, org.refcodes.observer.EventMetaData, String> - Parameters:
aEventMetaData
- The Meta-Data to be supplied by the event.aStrategy
- TheDispatchStrategy
to use when dispatching the event.
-
publishEvent
public void publishEvent(Enum<?> aAction, org.refcodes.observer.EventMetaData aEventMetaData, DispatchStrategy aStrategy) Fires an event with the according properties.- Specified by:
publishEvent
in interfaceEventDispatcher<EventBusEvent,
org.refcodes.observer.Observer<EventBusEvent>, EventBusEventMatcher, org.refcodes.observer.EventMetaData, String> - Parameters:
aAction
- The action which this represents.aEventMetaData
- The Meta-Data to be supplied by the event.aStrategy
- TheDispatchStrategy
to use when dispatching the event.
-
publishEvent
Fires an event with the according properties.- Specified by:
publishEvent
in interfaceEventDispatcher<EventBusEvent,
org.refcodes.observer.Observer<EventBusEvent>, EventBusEventMatcher, org.refcodes.observer.EventMetaData, String> - Parameters:
aAction
- The action which this represents.aStrategy
- TheDispatchStrategy
to use when dispatching the event.
-