- java.lang.Object
-
- org.refcodes.eventbus.AbstractEventBus<EventBusEvent,org.refcodes.observer.Observer<EventBusEvent>,EventBusEventMatcher,org.refcodes.mixin.EventMetaData,String>
-
- org.refcodes.eventbus.EventBusImpl
-
- All Implemented Interfaces:
org.refcodes.component.Destroyable
,org.refcodes.component.HandleLookup<String,org.refcodes.observer.Observer<EventBusEvent>>
,DispatchStrategyAccessor
,EventBus
,EventBusObservable<EventBusEvent,org.refcodes.observer.Observer<EventBusEvent>,EventBusEventMatcher,String>
,EventBusPublisher<EventBusEvent>
,GenericEventBus<EventBusEvent,org.refcodes.observer.Observer<EventBusEvent>,EventBusEventMatcher,org.refcodes.mixin.EventMetaData,String>
,org.refcodes.matcher.Matcher<EventBusEvent>
,org.refcodes.observer.EventMatcher<EventBusEvent>
,org.refcodes.observer.Publisher<EventBusEvent>
public class EventBusImpl extends AbstractEventBus<EventBusEvent,org.refcodes.observer.Observer<EventBusEvent>,EventBusEventMatcher,org.refcodes.mixin.EventMetaData,String> implements EventBus
TheEventBusImpl
defines a predefinedGenericEventBus
tailored to use theMetaDataActionEvent
as event type to use. This grants interoperability with otherMetaDataActionEvent
based systems.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.refcodes.component.Destroyable
org.refcodes.component.Destroyable.DestroyAutomaton
-
Nested classes/interfaces inherited from interface org.refcodes.eventbus.DispatchStrategyAccessor
DispatchStrategyAccessor.DispatchStrategyMutator, DispatchStrategyAccessor.DispatchStrategyProperty
-
-
Constructor Summary
Constructors Constructor Description EventBusImpl()
Constructs theEventBusImpl
with theDispatchStrategy
beingDispatchStrategy.CASCADE
when publishing events.EventBusImpl(boolean isDaemon)
Constructs theEventBusImpl
with theDispatchStrategy
beingDispatchStrategy.CASCADE
when publishing events.EventBusImpl(ExecutorService aExecutorService)
Constructs theEventBusImpl
with theDispatchStrategy
beingDispatchStrategy.CASCADE
when publishing events.EventBusImpl(DispatchStrategy aDispatchStrategy)
Constructs theEventBusImpl
with the givenDispatchStrategy
when publishing events.EventBusImpl(DispatchStrategy aDispatchStrategy, boolean isDaemon)
Constructs theEventBusImpl
with the givenDispatchStrategy
when publishing events.EventBusImpl(DispatchStrategy aDispatchStrategy, ExecutorService aExecutorService)
Constructs theEventBusImpl
with theDispatchStrategy
beingDispatchStrategy.CASCADE
when publishing events.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.String
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.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.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.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.String
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.String
onCatchAll(org.refcodes.observer.Observer<EventBusEvent> aObserver)
Similar to the more generic methodEventBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes all events passing the Event-Bus.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.String
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.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.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.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.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.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.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.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.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.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.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.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.String
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.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.String
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.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.String
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>
StringonType(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.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.String
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 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.mixin.EventMetaData aEventMetaData)
Fires an event with the according properties.void
publishEvent(Enum<?> aAction, org.refcodes.mixin.EventMetaData aEventMetaData, DispatchStrategy aStrategy)
Fires an event with the according properties.void
publishEvent(String aChannel)
Fires an event with the according properties.void
publishEvent(String aAlias, String aGroup, String aChannel, String aUid, Class<?> aPublisherType)
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(DispatchStrategy aStrategy)
Fires an event with the according properties.void
publishEvent(org.refcodes.mixin.EventMetaData aEventMetaData)
Fires an event with the according properties.void
publishEvent(org.refcodes.mixin.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>
Stringsubscribe(Class<EVT> aEventType, org.refcodes.observer.Observer<EVT> aObserver)
Subscribes 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 org.refcodes.eventbus.DispatchStrategyAccessor
getDispatchStrategy
-
Methods inherited from interface org.refcodes.eventbus.EventBusObservable
subscribe, unsubscribeAll
-
Methods inherited from interface org.refcodes.eventbus.GenericEventBus
publishEvent, publishEvent
-
-
-
-
Constructor Detail
-
EventBusImpl
public EventBusImpl()
Constructs theEventBusImpl
with theDispatchStrategy
beingDispatchStrategy.CASCADE
when publishing events.
-
EventBusImpl
public EventBusImpl(boolean isDaemon)
Constructs theEventBusImpl
with theDispatchStrategy
beingDispatchStrategy.CASCADE
when publishing events.
-
EventBusImpl
public EventBusImpl(ExecutorService aExecutorService)
Constructs theEventBusImpl
with theDispatchStrategy
beingDispatchStrategy.CASCADE
when publishing events.- Parameters:
aExecutorService
- TheExecutorService
to be used when creating threads.
-
EventBusImpl
public EventBusImpl(DispatchStrategy aDispatchStrategy)
Constructs theEventBusImpl
with the givenDispatchStrategy
when publishing events.- Parameters:
aDispatchStrategy
- TheDispatchStrategy
to be used when publishing events.
-
EventBusImpl
public EventBusImpl(DispatchStrategy aDispatchStrategy, boolean isDaemon)
Constructs theEventBusImpl
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.
-
EventBusImpl
public EventBusImpl(DispatchStrategy aDispatchStrategy, ExecutorService aExecutorService)
Constructs theEventBusImpl
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 Detail
-
onAlias
public String 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.- Specified by:
onAlias
in interfaceGenericEventBus<EventBusEvent,org.refcodes.observer.Observer<EventBusEvent>,EventBusEventMatcher,org.refcodes.mixin.EventMetaData,String>
- Parameters:
aName
- The name for which to subscribe.aObserver
- The observer to be notified.- Returns:
- A handle to unsubscribe this combination.
-
onChannel
public String 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.- Specified by:
onChannel
in interfaceGenericEventBus<EventBusEvent,org.refcodes.observer.Observer<EventBusEvent>,EventBusEventMatcher,org.refcodes.mixin.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
public String 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.- Specified by:
onGroup
in interfaceGenericEventBus<EventBusEvent,org.refcodes.observer.Observer<EventBusEvent>,EventBusEventMatcher,org.refcodes.mixin.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
public String 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.- Specified by:
onUniversalId
in interfaceGenericEventBus<EventBusEvent,org.refcodes.observer.Observer<EventBusEvent>,EventBusEventMatcher,org.refcodes.mixin.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
public String 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.- Specified by:
onAction
in interfaceGenericEventBus<EventBusEvent,org.refcodes.observer.Observer<EventBusEvent>,EventBusEventMatcher,org.refcodes.mixin.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 interfaceGenericEventBus<EventBusEvent,org.refcodes.observer.Observer<EventBusEvent>,EventBusEventMatcher,org.refcodes.mixin.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
public String onCatchAll(org.refcodes.observer.Observer<EventBusEvent> aObserver)
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 interfaceGenericEventBus<EventBusEvent,org.refcodes.observer.Observer<EventBusEvent>,EventBusEventMatcher,org.refcodes.mixin.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 interfaceGenericEventBus<EventBusEvent,org.refcodes.observer.Observer<EventBusEvent>,EventBusEventMatcher,org.refcodes.mixin.EventMetaData,String>
- Parameters:
aPublisherType
- The type of the event publisher.aObserver
- The observer to be notified.- Returns:
- A handle to unsubscribe this combination.
-
onEvent
public String 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.- Specified by:
onEvent
in interfaceGenericEventBus<EventBusEvent,org.refcodes.observer.Observer<EventBusEvent>,EventBusEventMatcher,org.refcodes.mixin.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 interfaceGenericEventBus<EventBusEvent,org.refcodes.observer.Observer<EventBusEvent>,EventBusEventMatcher,org.refcodes.mixin.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 interfaceGenericEventBus<EventBusEvent,org.refcodes.observer.Observer<EventBusEvent>,EventBusEventMatcher,org.refcodes.mixin.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 interfaceGenericEventBus<EventBusEvent,org.refcodes.observer.Observer<EventBusEvent>,EventBusEventMatcher,org.refcodes.mixin.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 interfaceGenericEventBus<EventBusEvent,org.refcodes.observer.Observer<EventBusEvent>,EventBusEventMatcher,org.refcodes.mixin.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
public String 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. YourObservable
may be of the required type!- Specified by:
onEvent
in interfaceGenericEventBus<EventBusEvent,org.refcodes.observer.Observer<EventBusEvent>,EventBusEventMatcher,org.refcodes.mixin.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 interfaceGenericEventBus<EventBusEvent,org.refcodes.observer.Observer<EventBusEvent>,EventBusEventMatcher,org.refcodes.mixin.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 interfaceGenericEventBus<EventBusEvent,org.refcodes.observer.Observer<EventBusEvent>,EventBusEventMatcher,org.refcodes.mixin.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 interfaceGenericEventBus<EventBusEvent,org.refcodes.observer.Observer<EventBusEvent>,EventBusEventMatcher,org.refcodes.mixin.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 interfaceGenericEventBus<EventBusEvent,org.refcodes.observer.Observer<EventBusEvent>,EventBusEventMatcher,org.refcodes.mixin.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 interfaceGenericEventBus<EventBusEvent,org.refcodes.observer.Observer<EventBusEvent>,EventBusEventMatcher,org.refcodes.mixin.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 interfaceGenericEventBus<EventBusEvent,org.refcodes.observer.Observer<EventBusEvent>,EventBusEventMatcher,org.refcodes.mixin.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 interfaceGenericEventBus<EventBusEvent,org.refcodes.observer.Observer<EventBusEvent>,EventBusEventMatcher,org.refcodes.mixin.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 interfaceGenericEventBus<EventBusEvent,org.refcodes.observer.Observer<EventBusEvent>,EventBusEventMatcher,org.refcodes.mixin.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 interfaceGenericEventBus<EventBusEvent,org.refcodes.observer.Observer<EventBusEvent>,EventBusEventMatcher,org.refcodes.mixin.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 interfaceGenericEventBus<EventBusEvent,org.refcodes.observer.Observer<EventBusEvent>,EventBusEventMatcher,org.refcodes.mixin.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 interfaceGenericEventBus<EventBusEvent,org.refcodes.observer.Observer<EventBusEvent>,EventBusEventMatcher,org.refcodes.mixin.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 interfaceGenericEventBus<EventBusEvent,org.refcodes.observer.Observer<EventBusEvent>,EventBusEventMatcher,org.refcodes.mixin.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 interfaceGenericEventBus<EventBusEvent,org.refcodes.observer.Observer<EventBusEvent>,EventBusEventMatcher,org.refcodes.mixin.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 interfaceGenericEventBus<EventBusEvent,org.refcodes.observer.Observer<EventBusEvent>,EventBusEventMatcher,org.refcodes.mixin.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
public void publishEvent(Class<?> aPublisherType)
Fires an event with the according properties.- Specified by:
publishEvent
in interfaceGenericEventBus<EventBusEvent,org.refcodes.observer.Observer<EventBusEvent>,EventBusEventMatcher,org.refcodes.mixin.EventMetaData,String>
- Parameters:
aPublisherType
- The type of the event publisher.
-
publishEvent
public void publishEvent(String aChannel)
Fires an event with the according properties.- Specified by:
publishEvent
in interfaceGenericEventBus<EventBusEvent,org.refcodes.observer.Observer<EventBusEvent>,EventBusEventMatcher,org.refcodes.mixin.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 interfaceGenericEventBus<EventBusEvent,org.refcodes.observer.Observer<EventBusEvent>,EventBusEventMatcher,org.refcodes.mixin.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
public void publishEvent(Enum<?> aAction, Class<?> aPublisherType)
Fires an event with the according properties.- Specified by:
publishEvent
in interfaceGenericEventBus<EventBusEvent,org.refcodes.observer.Observer<EventBusEvent>,EventBusEventMatcher,org.refcodes.mixin.EventMetaData,String>
- Parameters:
aAction
- The action which this represents.aPublisherType
- The type of the event publisher.
-
publishEvent
public void publishEvent(Enum<?> aAction, String aChannel)
Fires an event with the according properties.- Specified by:
publishEvent
in interfaceGenericEventBus<EventBusEvent,org.refcodes.observer.Observer<EventBusEvent>,EventBusEventMatcher,org.refcodes.mixin.EventMetaData,String>
- Parameters:
aAction
- The action which this represents.aChannel
- The channel name on which the event is receivable.
-
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 interfaceGenericEventBus<EventBusEvent,org.refcodes.observer.Observer<EventBusEvent>,EventBusEventMatcher,org.refcodes.mixin.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.mixin.EventMetaData aEventMetaData)
Fires an event with the according properties.- Specified by:
publishEvent
in interfaceGenericEventBus<EventBusEvent,org.refcodes.observer.Observer<EventBusEvent>,EventBusEventMatcher,org.refcodes.mixin.EventMetaData,String>
- Parameters:
aEventMetaData
- The Meta-Data to be supplied by the event.
-
publishEvent
public void publishEvent(Enum<?> aAction, org.refcodes.mixin.EventMetaData aEventMetaData)
Fires an event with the according properties.- Specified by:
publishEvent
in interfaceGenericEventBus<EventBusEvent,org.refcodes.observer.Observer<EventBusEvent>,EventBusEventMatcher,org.refcodes.mixin.EventMetaData,String>
- Parameters:
aAction
- The action which this represents.aEventMetaData
- The Meta-Data to be supplied by the event.
-
publishEvent
public void publishEvent(Enum<?> aAction)
Fires an event with the according properties.- Specified by:
publishEvent
in interfaceGenericEventBus<EventBusEvent,org.refcodes.observer.Observer<EventBusEvent>,EventBusEventMatcher,org.refcodes.mixin.EventMetaData,String>
- Parameters:
aAction
- The action which this represents.
-
publishEvent
public void publishEvent(Class<?> aPublisherType, DispatchStrategy aStrategy)
Fires an event with the according properties.- Specified by:
publishEvent
in interfaceGenericEventBus<EventBusEvent,org.refcodes.observer.Observer<EventBusEvent>,EventBusEventMatcher,org.refcodes.mixin.EventMetaData,String>
- Parameters:
aPublisherType
- The type of the event publisher.aStrategy
- TheDispatchStrategy
to use when dispatching the event.
-
publishEvent
public void publishEvent(String aChannel, DispatchStrategy aStrategy)
Fires an event with the according properties.- Specified by:
publishEvent
in interfaceGenericEventBus<EventBusEvent,org.refcodes.observer.Observer<EventBusEvent>,EventBusEventMatcher,org.refcodes.mixin.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 interfaceGenericEventBus<EventBusEvent,org.refcodes.observer.Observer<EventBusEvent>,EventBusEventMatcher,org.refcodes.mixin.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
public void publishEvent(Enum<?> aAction, Class<?> aPublisherType, DispatchStrategy aStrategy)
Fires an event with the according properties.- Specified by:
publishEvent
in interfaceGenericEventBus<EventBusEvent,org.refcodes.observer.Observer<EventBusEvent>,EventBusEventMatcher,org.refcodes.mixin.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
public void publishEvent(Enum<?> aAction, String aChannel, DispatchStrategy aStrategy)
Fires an event with the according properties.- Specified by:
publishEvent
in interfaceGenericEventBus<EventBusEvent,org.refcodes.observer.Observer<EventBusEvent>,EventBusEventMatcher,org.refcodes.mixin.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 interfaceGenericEventBus<EventBusEvent,org.refcodes.observer.Observer<EventBusEvent>,EventBusEventMatcher,org.refcodes.mixin.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.mixin.EventMetaData aEventMetaData, DispatchStrategy aStrategy)
Fires an event with the according properties.- Specified by:
publishEvent
in interfaceGenericEventBus<EventBusEvent,org.refcodes.observer.Observer<EventBusEvent>,EventBusEventMatcher,org.refcodes.mixin.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.mixin.EventMetaData aEventMetaData, DispatchStrategy aStrategy)
Fires an event with the according properties.- Specified by:
publishEvent
in interfaceGenericEventBus<EventBusEvent,org.refcodes.observer.Observer<EventBusEvent>,EventBusEventMatcher,org.refcodes.mixin.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
public void publishEvent(Enum<?> aAction, DispatchStrategy aStrategy)
Fires an event with the according properties.- Specified by:
publishEvent
in interfaceGenericEventBus<EventBusEvent,org.refcodes.observer.Observer<EventBusEvent>,EventBusEventMatcher,org.refcodes.mixin.EventMetaData,String>
- Parameters:
aAction
- The action which this represents.aStrategy
- TheDispatchStrategy
to use when dispatching the event.
-
publishEvent
public void publishEvent(DispatchStrategy aStrategy)
Fires an event with the according properties.- Specified by:
publishEvent
in interfaceGenericEventBus<EventBusEvent,org.refcodes.observer.Observer<EventBusEvent>,EventBusEventMatcher,org.refcodes.mixin.EventMetaData,String>
- Parameters:
aStrategy
- TheDispatchStrategy
to use when dispatching the event.
-
-