java.lang.Object
org.refcodes.eventbus.AbstractEventBus<SimpleBusEvent,org.refcodes.observer.Observer<SimpleBusEvent>,SimpleBusMatcher,org.refcodes.mixin.EventMetaData,String>
org.refcodes.eventbus.SimpleEventBus
- All Implemented Interfaces:
org.refcodes.component.HandleLookup<String,org.refcodes.observer.Observer<SimpleBusEvent>>
,BusObservable<SimpleBusEvent,org.refcodes.observer.Observer<SimpleBusEvent>,SimpleBusMatcher,String>
,BusPublisher<SimpleBusEvent>
,DispatchStrategyAccessor
,EventBus<SimpleBusEvent,org.refcodes.observer.Observer<SimpleBusEvent>,SimpleBusMatcher,org.refcodes.mixin.EventMetaData,String>
,org.refcodes.matcher.Matcher<SimpleBusEvent>
,org.refcodes.observer.EventMatcher<SimpleBusEvent>
,org.refcodes.observer.Publisher<SimpleBusEvent>
public class SimpleEventBus extends AbstractEventBus<SimpleBusEvent,org.refcodes.observer.Observer<SimpleBusEvent>,SimpleBusMatcher,org.refcodes.mixin.EventMetaData,String> implements EventBus<SimpleBusEvent,org.refcodes.observer.Observer<SimpleBusEvent>,SimpleBusMatcher,org.refcodes.mixin.EventMetaData,String>
The
SimpleEventBus
defines a predefined EventBus
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
Constructors Constructor Description SimpleEventBus()
Constructs theSimpleEventBus
with theDispatchStrategy
beingDispatchStrategy.CASCADE
when publishing events.SimpleEventBus(int aCorePoolSize)
Constructs theSimpleEventBus
with theDispatchStrategy
beingDispatchStrategy.CASCADE
when publishing events.SimpleEventBus(ExecutorService aExecutorService)
Constructs theSimpleEventBus
with theDispatchStrategy
beingDispatchStrategy.CASCADE
when publishing events.SimpleEventBus(DispatchStrategy aDispatchStrategy)
Constructs theSimpleEventBus
with the givenDispatchStrategy
when publishing events.SimpleEventBus(DispatchStrategy aDispatchStrategy, int aCorePoolSize)
Constructs theSimpleEventBus
with the givenDispatchStrategy
when publishing events.SimpleEventBus(DispatchStrategy aDispatchStrategy, ExecutorService aExecutorService)
Constructs theSimpleEventBus
with theDispatchStrategy
beingDispatchStrategy.CASCADE
when publishing events. -
Method Summary
Modifier and Type Method Description <EVT extends SimpleBusEvent>
StringonAction(Class<EVT> aEventType, Enum<?> aAction, org.refcodes.observer.Observer<EVT> aObserver)
Similar to the more generic methodBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events for the given action.String
onAction(Enum<?> aAction, org.refcodes.observer.Observer<SimpleBusEvent> aObserver)
Similar to the more generic methodBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events for the given action.<EVT extends SimpleBusEvent>
StringonActions(Class<EVT> aEventType, org.refcodes.observer.Observer<EVT> aObserver, Enum<?>... aActions)
Similar to the more generic methodBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events for the given action.String
onActions(org.refcodes.observer.Observer<SimpleBusEvent> aObserver, Enum<?>... aActions)
Similar to the more generic methodBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events for the given action.<EVT extends SimpleBusEvent>
StringonAlias(Class<EVT> aEventType, String aName, org.refcodes.observer.Observer<EVT> aObserver)
Similar to the more generic methodBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events with the given name.String
onAlias(String aName, org.refcodes.observer.Observer<SimpleBusEvent> aObserver)
Similar to the more generic methodBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events with the given name.String
onCatchAll(org.refcodes.observer.Observer<SimpleBusEvent> aObserver)
Similar to the more generic methodBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes all events passing the Event-Bus.<EVT extends SimpleBusEvent>
StringonChannel(Class<EVT> aEventType, String aChannel, org.refcodes.observer.Observer<EVT> aObserver)
Similar to the more generic methodBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events for the given channel.String
onChannel(String aChannel, org.refcodes.observer.Observer<SimpleBusEvent> aObserver)
Similar to the more generic methodBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events for the given channel.String
onEvent(Class<?> aPublisherType, org.refcodes.observer.Observer<SimpleBusEvent> aObserver)
Similar to the more generic methodBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events with the given attributes.<EVT extends SimpleBusEvent>
StringonEvent(Class<EVT> aEventType, Class<?> aPublisherType, org.refcodes.observer.Observer<EVT> aObserver)
Similar to the more generic methodBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events with the given attributes.<EVT extends SimpleBusEvent>
StringonEvent(Class<EVT> aEventType, Enum<?> aAction, Class<?> aPublisherType, org.refcodes.observer.Observer<EVT> aObserver)
Similar to the more generic methodBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events with the given attributes.<EVT extends SimpleBusEvent>
StringonEvent(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 methodBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events with the given attributes.<EVT extends SimpleBusEvent>
StringonEvent(Class<EVT> aEventType, Enum<?> aAction, String aChannel, org.refcodes.observer.Observer<EVT> aObserver)
Similar to the more generic methodBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events with the given attributes.<EVT extends SimpleBusEvent>
StringonEvent(Class<EVT> aEventType, Enum<?> aAction, org.refcodes.observer.Observer<EVT> aObserver)
Similar to the more generic methodBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events with the given attributes.<EVT extends SimpleBusEvent>
StringonEvent(Class<EVT> aEventType, String aAlias, String aGroup, String aChannel, String aUid, Class<?> aPublisherType, org.refcodes.observer.Observer<EVT> aObserver)
Similar to the more generic methodBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events with the given attributes.<EVT extends SimpleBusEvent>
StringonEvent(Class<EVT> aEventType, String aChannel, org.refcodes.observer.Observer<EVT> aObserver)
Similar to the more generic methodBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events with the given attributes.String
onEvent(Enum<?> aAction, Class<?> aPublisherType, org.refcodes.observer.Observer<SimpleBusEvent> aObserver)
Similar to the more generic methodBusObservable.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<SimpleBusEvent> aObserver)
Similar to the more generic methodBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events with the given attributes.String
onEvent(Enum<?> aAction, String aChannel, org.refcodes.observer.Observer<SimpleBusEvent> aObserver)
Similar to the more generic methodBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events with the given attributes.String
onEvent(Enum<?> aAction, org.refcodes.observer.Observer<SimpleBusEvent> aObserver)
Similar to the more generic methodBusObservable.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<SimpleBusEvent> aObserver)
Similar to the more generic methodBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events with the given attributes.String
onEvent(String aChannel, org.refcodes.observer.Observer<SimpleBusEvent> aObserver)
Similar to the more generic methodBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events with the given attributes.<EVT extends SimpleBusEvent>
StringonGroup(Class<EVT> aEventType, String aGroup, org.refcodes.observer.Observer<EVT> aObserver)
Similar to the more generic methodBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events for the given group.String
onGroup(String aGroup, org.refcodes.observer.Observer<SimpleBusEvent> aObserver)
Similar to the more generic methodBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events for the given group.<EVT extends SimpleBusEvent>
StringonType(Class<EVT> aEventType, org.refcodes.observer.Observer<EVT> aObserver)
Similar to the more generic methodBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events of the given type.<EVT extends SimpleBusEvent>
StringonUniversalId(Class<EVT> aEventType, String aUid, org.refcodes.observer.Observer<EVT> aObserver)
Similar to the more generic methodBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events for the given Universal-TID.String
onUniversalId(String aUid, org.refcodes.observer.Observer<SimpleBusEvent> aObserver)
Similar to the more generic methodBusObservable.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 SimpleBusEvent>
Stringsubscribe(Class<EVT> aEventType, SimpleBusMatcher aEventMatcher, org.refcodes.observer.Observer<EVT> aObserver)
Subscribes a listener to the event bus.<EVT extends SimpleBusEvent>
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, 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.BusObservable
subscribe, unsubscribeAll
Methods inherited from interface org.refcodes.eventbus.DispatchStrategyAccessor
getDispatchStrategy
Methods inherited from interface org.refcodes.eventbus.EventBus
publishEvent, publishEvent
Methods inherited from interface org.refcodes.observer.EventMatcher
isMatching
Methods inherited from interface org.refcodes.component.HandleLookup
hasHandle, lookupHandle, removeHandle
-
Constructor Details
-
SimpleEventBus
public SimpleEventBus()Constructs theSimpleEventBus
with theDispatchStrategy
beingDispatchStrategy.CASCADE
when publishing events. -
SimpleEventBus
Constructs theSimpleEventBus
with theDispatchStrategy
beingDispatchStrategy.CASCADE
when publishing events.- Parameters:
aExecutorService
- TheExecutorService
to be used when creating threads.
-
SimpleEventBus
Constructs theSimpleEventBus
with the givenDispatchStrategy
when publishing events.- Parameters:
aDispatchStrategy
- TheDispatchStrategy
to be used when publishing events.
-
SimpleEventBus
Constructs theSimpleEventBus
with theDispatchStrategy
beingDispatchStrategy.CASCADE
when publishing events.- Parameters:
aDispatchStrategy
- TheDispatchStrategy
to be used when publishing events.aExecutorService
- TheExecutorService
to be used when creating threads.
-
SimpleEventBus
public SimpleEventBus(int aCorePoolSize)Constructs theSimpleEventBus
with theDispatchStrategy
beingDispatchStrategy.CASCADE
when publishing events.- Parameters:
aCorePoolSize
- The number of threads to keep in the pool, even if they are idle.
-
SimpleEventBus
Constructs theSimpleEventBus
with the givenDispatchStrategy
when publishing events.- Parameters:
aCorePoolSize
- The number of threads to keep in the pool, even if they are idle.aDispatchStrategy
- TheDispatchStrategy
to be used when publishing events.
-
-
Method Details
-
onAlias
Similar to the more generic methodBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events with the given name.- Specified by:
onAlias
in interfaceEventBus<SimpleBusEvent,org.refcodes.observer.Observer<SimpleBusEvent>,SimpleBusMatcher,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
Similar to the more generic methodBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events for the given channel.- Specified by:
onChannel
in interfaceEventBus<SimpleBusEvent,org.refcodes.observer.Observer<SimpleBusEvent>,SimpleBusMatcher,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
Similar to the more generic methodBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events for the given group.- Specified by:
onGroup
in interfaceEventBus<SimpleBusEvent,org.refcodes.observer.Observer<SimpleBusEvent>,SimpleBusMatcher,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
Similar to the more generic methodBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events for the given Universal-TID.- Specified by:
onUniversalId
in interfaceEventBus<SimpleBusEvent,org.refcodes.observer.Observer<SimpleBusEvent>,SimpleBusMatcher,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
Similar to the more generic methodBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events for the given action.- Specified by:
onAction
in interfaceEventBus<SimpleBusEvent,org.refcodes.observer.Observer<SimpleBusEvent>,SimpleBusMatcher,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<SimpleBusEvent> aObserver, Enum<?>... aActions)Similar to the more generic methodBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events for the given action.- Specified by:
onActions
in interfaceEventBus<SimpleBusEvent,org.refcodes.observer.Observer<SimpleBusEvent>,SimpleBusMatcher,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
Similar to the more generic methodBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes all events passing the Event-Bus. Call it a "catch-all" hook.- Specified by:
onCatchAll
in interfaceEventBus<SimpleBusEvent,org.refcodes.observer.Observer<SimpleBusEvent>,SimpleBusMatcher,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<SimpleBusEvent> aObserver)Similar to the more generic methodBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events with the given attributes.- Specified by:
onEvent
in interfaceEventBus<SimpleBusEvent,org.refcodes.observer.Observer<SimpleBusEvent>,SimpleBusMatcher,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
Similar to the more generic methodBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events with the given attributes.- Specified by:
onEvent
in interfaceEventBus<SimpleBusEvent,org.refcodes.observer.Observer<SimpleBusEvent>,SimpleBusMatcher,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<SimpleBusEvent> aObserver)Similar to the more generic methodBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events with the given attributes.- Specified by:
onEvent
in interfaceEventBus<SimpleBusEvent,org.refcodes.observer.Observer<SimpleBusEvent>,SimpleBusMatcher,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<SimpleBusEvent> aObserver)Similar to the more generic methodBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events with the given attributes.- Specified by:
onEvent
in interfaceEventBus<SimpleBusEvent,org.refcodes.observer.Observer<SimpleBusEvent>,SimpleBusMatcher,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<SimpleBusEvent> aObserver)Similar to the more generic methodBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events with the given attributes.- Specified by:
onEvent
in interfaceEventBus<SimpleBusEvent,org.refcodes.observer.Observer<SimpleBusEvent>,SimpleBusMatcher,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<SimpleBusEvent> aObserver)Similar to the more generic methodBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events with the given attributes.- Specified by:
onEvent
in interfaceEventBus<SimpleBusEvent,org.refcodes.observer.Observer<SimpleBusEvent>,SimpleBusMatcher,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
Similar to the more generic methodBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events with the given attributes. YourObservable
may be of the required type!- Specified by:
onEvent
in interfaceEventBus<SimpleBusEvent,org.refcodes.observer.Observer<SimpleBusEvent>,SimpleBusMatcher,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 <EVT extends SimpleBusEvent> String onEvent(Class<EVT> aEventType, Class<?> aPublisherType, org.refcodes.observer.Observer<EVT> aObserver)Similar to the more generic methodBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events with the given attributes. YourObservable
may be of the required type!- Specified by:
onEvent
in interfaceEventBus<SimpleBusEvent,org.refcodes.observer.Observer<SimpleBusEvent>,SimpleBusMatcher,org.refcodes.mixin.EventMetaData,String>
- Type Parameters:
EVT
- The type of the event to subscribe for.- 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 <EVT extends SimpleBusEvent> String onEvent(Class<EVT> aEventType, String aChannel, org.refcodes.observer.Observer<EVT> aObserver)Similar to the more generic methodBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events with the given attributes. YourObservable
may be of the required type!- Specified by:
onEvent
in interfaceEventBus<SimpleBusEvent,org.refcodes.observer.Observer<SimpleBusEvent>,SimpleBusMatcher,org.refcodes.mixin.EventMetaData,String>
- Type Parameters:
EVT
- The type of the event to subscribe for.- 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 <EVT extends SimpleBusEvent> String 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 methodBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events with the given attributes. YourObservable
may be of the required type!- Specified by:
onEvent
in interfaceEventBus<SimpleBusEvent,org.refcodes.observer.Observer<SimpleBusEvent>,SimpleBusMatcher,org.refcodes.mixin.EventMetaData,String>
- Type Parameters:
EVT
- The type of the event to subscribe for.- 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 <EVT extends SimpleBusEvent> String onEvent(Class<EVT> aEventType, Enum<?> aAction, Class<?> aPublisherType, org.refcodes.observer.Observer<EVT> aObserver)Similar to the more generic methodBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events with the given attributes. YourObservable
may be of the required type!- Specified by:
onEvent
in interfaceEventBus<SimpleBusEvent,org.refcodes.observer.Observer<SimpleBusEvent>,SimpleBusMatcher,org.refcodes.mixin.EventMetaData,String>
- Type Parameters:
EVT
- The type of the event to subscribe for.- 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 <EVT extends SimpleBusEvent> String onEvent(Class<EVT> aEventType, Enum<?> aAction, String aChannel, org.refcodes.observer.Observer<EVT> aObserver)Similar to the more generic methodBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events with the given attributes. YourObservable
may be of the required type!- Specified by:
onEvent
in interfaceEventBus<SimpleBusEvent,org.refcodes.observer.Observer<SimpleBusEvent>,SimpleBusMatcher,org.refcodes.mixin.EventMetaData,String>
- Type Parameters:
EVT
- The type of the event to subscribe for.- 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 <EVT extends SimpleBusEvent> String 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 methodBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events with the given attributes. YourObservable
may be of the required type!- Specified by:
onEvent
in interfaceEventBus<SimpleBusEvent,org.refcodes.observer.Observer<SimpleBusEvent>,SimpleBusMatcher,org.refcodes.mixin.EventMetaData,String>
- Type Parameters:
EVT
- The type of the event to subscribe for.- 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 <EVT extends SimpleBusEvent> String onEvent(Class<EVT> aEventType, Enum<?> aAction, org.refcodes.observer.Observer<EVT> aObserver)Similar to the more generic methodBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events with the given attributes. YourObservable
may be of the required type!- Specified by:
onEvent
in interfaceEventBus<SimpleBusEvent,org.refcodes.observer.Observer<SimpleBusEvent>,SimpleBusMatcher,org.refcodes.mixin.EventMetaData,String>
- Type Parameters:
EVT
- The type of the event to subscribe for.- 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 SimpleBusEvent> String subscribe(Class<EVT> aEventType, SimpleBusMatcher 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 interfaceBusObservable<SimpleBusEvent,org.refcodes.observer.Observer<SimpleBusEvent>,SimpleBusMatcher,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 SimpleBusEvent> 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 interfaceBusObservable<SimpleBusEvent,org.refcodes.observer.Observer<SimpleBusEvent>,SimpleBusMatcher,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 SimpleBusEvent> String onType(Class<EVT> aEventType, org.refcodes.observer.Observer<EVT> aObserver)Similar to the more generic methodBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events of the given type. YourObservable
may be of the required type!- Specified by:
onType
in interfaceEventBus<SimpleBusEvent,org.refcodes.observer.Observer<SimpleBusEvent>,SimpleBusMatcher,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 <EVT extends SimpleBusEvent> String onAlias(Class<EVT> aEventType, String aName, org.refcodes.observer.Observer<EVT> aObserver)Similar to the more generic methodBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events with the given name.- Specified by:
onAlias
in interfaceEventBus<SimpleBusEvent,org.refcodes.observer.Observer<SimpleBusEvent>,SimpleBusMatcher,org.refcodes.mixin.EventMetaData,String>
- Type Parameters:
EVT
- The type of the event to subscribe for.- 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 <EVT extends SimpleBusEvent> String onChannel(Class<EVT> aEventType, String aChannel, org.refcodes.observer.Observer<EVT> aObserver)Similar to the more generic methodBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events for the given channel.- Specified by:
onChannel
in interfaceEventBus<SimpleBusEvent,org.refcodes.observer.Observer<SimpleBusEvent>,SimpleBusMatcher,org.refcodes.mixin.EventMetaData,String>
- Type Parameters:
EVT
- The type of the event to subscribe for.- 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 <EVT extends SimpleBusEvent> String onGroup(Class<EVT> aEventType, String aGroup, org.refcodes.observer.Observer<EVT> aObserver)Similar to the more generic methodBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events for the given group.- Specified by:
onGroup
in interfaceEventBus<SimpleBusEvent,org.refcodes.observer.Observer<SimpleBusEvent>,SimpleBusMatcher,org.refcodes.mixin.EventMetaData,String>
- Type Parameters:
EVT
- The type of the event to subscribe for.- 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 <EVT extends SimpleBusEvent> String onUniversalId(Class<EVT> aEventType, String aUid, org.refcodes.observer.Observer<EVT> aObserver)Similar to the more generic methodBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events for the given Universal-TID.- Specified by:
onUniversalId
in interfaceEventBus<SimpleBusEvent,org.refcodes.observer.Observer<SimpleBusEvent>,SimpleBusMatcher,org.refcodes.mixin.EventMetaData,String>
- Type Parameters:
EVT
- The type of the event to subscribe for.- 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 <EVT extends SimpleBusEvent> String onAction(Class<EVT> aEventType, Enum<?> aAction, org.refcodes.observer.Observer<EVT> aObserver)Similar to the more generic methodBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events for the given action.- Specified by:
onAction
in interfaceEventBus<SimpleBusEvent,org.refcodes.observer.Observer<SimpleBusEvent>,SimpleBusMatcher,org.refcodes.mixin.EventMetaData,String>
- Type Parameters:
EVT
- The type of the event to subscribe for.- 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 <EVT extends SimpleBusEvent> String onActions(Class<EVT> aEventType, org.refcodes.observer.Observer<EVT> aObserver, Enum<?>... aActions)Similar to the more generic methodBusObservable.subscribe(EventMatcher, Observer)
THOUGH subscribes for events for the given action.- Specified by:
onActions
in interfaceEventBus<SimpleBusEvent,org.refcodes.observer.Observer<SimpleBusEvent>,SimpleBusMatcher,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.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 interfaceEventBus<SimpleBusEvent,org.refcodes.observer.Observer<SimpleBusEvent>,SimpleBusMatcher,org.refcodes.mixin.EventMetaData,String>
- Parameters:
aPublisherType
- The type of the event publisher.
-
publishEvent
Fires an event with the according properties.- Specified by:
publishEvent
in interfaceEventBus<SimpleBusEvent,org.refcodes.observer.Observer<SimpleBusEvent>,SimpleBusMatcher,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 interfaceEventBus<SimpleBusEvent,org.refcodes.observer.Observer<SimpleBusEvent>,SimpleBusMatcher,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
Fires an event with the according properties.- Specified by:
publishEvent
in interfaceEventBus<SimpleBusEvent,org.refcodes.observer.Observer<SimpleBusEvent>,SimpleBusMatcher,org.refcodes.mixin.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 interfaceEventBus<SimpleBusEvent,org.refcodes.observer.Observer<SimpleBusEvent>,SimpleBusMatcher,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 interfaceEventBus<SimpleBusEvent,org.refcodes.observer.Observer<SimpleBusEvent>,SimpleBusMatcher,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 interfaceEventBus<SimpleBusEvent,org.refcodes.observer.Observer<SimpleBusEvent>,SimpleBusMatcher,org.refcodes.mixin.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 interfaceEventBus<SimpleBusEvent,org.refcodes.observer.Observer<SimpleBusEvent>,SimpleBusMatcher,org.refcodes.mixin.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 interfaceEventBus<SimpleBusEvent,org.refcodes.observer.Observer<SimpleBusEvent>,SimpleBusMatcher,org.refcodes.mixin.EventMetaData,String>
- Parameters:
aAction
- The action which this represents.
-
publishEvent
Fires an event with the according properties.- Specified by:
publishEvent
in interfaceEventBus<SimpleBusEvent,org.refcodes.observer.Observer<SimpleBusEvent>,SimpleBusMatcher,org.refcodes.mixin.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 interfaceEventBus<SimpleBusEvent,org.refcodes.observer.Observer<SimpleBusEvent>,SimpleBusMatcher,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 interfaceEventBus<SimpleBusEvent,org.refcodes.observer.Observer<SimpleBusEvent>,SimpleBusMatcher,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
Fires an event with the according properties.- Specified by:
publishEvent
in interfaceEventBus<SimpleBusEvent,org.refcodes.observer.Observer<SimpleBusEvent>,SimpleBusMatcher,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
Fires an event with the according properties.- Specified by:
publishEvent
in interfaceEventBus<SimpleBusEvent,org.refcodes.observer.Observer<SimpleBusEvent>,SimpleBusMatcher,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 interfaceEventBus<SimpleBusEvent,org.refcodes.observer.Observer<SimpleBusEvent>,SimpleBusMatcher,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 interfaceEventBus<SimpleBusEvent,org.refcodes.observer.Observer<SimpleBusEvent>,SimpleBusMatcher,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 interfaceEventBus<SimpleBusEvent,org.refcodes.observer.Observer<SimpleBusEvent>,SimpleBusMatcher,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
Fires an event with the according properties.- Specified by:
publishEvent
in interfaceEventBus<SimpleBusEvent,org.refcodes.observer.Observer<SimpleBusEvent>,SimpleBusMatcher,org.refcodes.mixin.EventMetaData,String>
- Parameters:
aAction
- The action which this represents.aStrategy
- TheDispatchStrategy
to use when dispatching the event.
-
publishEvent
Fires an event with the according properties.- Specified by:
publishEvent
in interfaceEventBus<SimpleBusEvent,org.refcodes.observer.Observer<SimpleBusEvent>,SimpleBusMatcher,org.refcodes.mixin.EventMetaData,String>
- Parameters:
aStrategy
- TheDispatchStrategy
to use when dispatching the event.
-