Package org.refcodes.eventbus
Class EventBusImpl
- java.lang.Object
-
- org.refcodes.eventbus.AbstractEventBus<BusEvent,org.refcodes.observer.Observer<BusEvent>,BusMatcher,org.refcodes.observer.EventMetaData,java.lang.String>
-
- org.refcodes.eventbus.EventBusImpl
-
- All Implemented Interfaces:
org.refcodes.component.HandleLookup<BusEvent,org.refcodes.observer.Observer<BusEvent>>,DispatchStrategyAccessor,EventBus,GenericBusObservable<BusEvent,org.refcodes.observer.Observer<BusEvent>,BusMatcher,org.refcodes.observer.EventMetaData>,GenericBusPublisher<BusEvent>,GenericEventBus<BusEvent,org.refcodes.observer.Observer<BusEvent>,BusMatcher,org.refcodes.observer.EventMetaData,java.lang.String>,org.refcodes.matcher.Matcher<BusEvent>,org.refcodes.observer.EventMatcher<BusEvent>,org.refcodes.observer.Publisher<BusEvent>
public class EventBusImpl extends AbstractEventBus<BusEvent,org.refcodes.observer.Observer<BusEvent>,BusMatcher,org.refcodes.observer.EventMetaData,java.lang.String> implements EventBus
TheEventBusImplis a ready to use implementation of aEventBususing a defaultDispatchStrategybeingDispatchStrategy.CASCADEand extending theAbstractEventBus.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.refcodes.eventbus.DispatchStrategyAccessor
DispatchStrategyAccessor.DispatchStrategyMutator, DispatchStrategyAccessor.DispatchStrategyProperty
-
-
Constructor Summary
Constructors Constructor Description EventBusImpl()Constructs theEventBuswith theDispatchStrategybeingDispatchStrategy.CASCADEwhen publishing events.EventBusImpl(int aCorePoolSize)Constructs theEventBuswith theDispatchStrategybeingDispatchStrategy.CASCADEwhen publishing events.EventBusImpl(java.util.concurrent.ExecutorService aExecutorService)Constructs theEventBuswith theDispatchStrategybeingDispatchStrategy.CASCADEwhen publishing events.EventBusImpl(DispatchStrategy aDispatchStrategy)Constructs theEventBuswith the givenDispatchStrategywhen publishing events.EventBusImpl(DispatchStrategy aDispatchStrategy, int aCorePoolSize)Constructs theEventBuswith the givenDispatchStrategywhen publishing events.EventBusImpl(DispatchStrategy aDispatchStrategy, java.util.concurrent.ExecutorService aExecutorService)Constructs theEventBuswith theDispatchStrategybeingDispatchStrategy.CASCADEwhen publishing events.
-
Method Summary
-
Methods inherited from class org.refcodes.eventbus.AbstractEventBus
cascadeDispatch, getDispatchStrategy, hasHandle, isMatching, lookupHandle, parallelDispatch, publishEvent, removeHandle, sequentialDispatch, subscribe, unsubscribeAll
-
Methods inherited from interface org.refcodes.eventbus.DispatchStrategyAccessor
getDispatchStrategy
-
Methods inherited from interface org.refcodes.eventbus.EventBus
onAction, onAction, onActions, onActions, onAlias, onAlias, onCatchAll, onChannel, onChannel, onEvent, onEvent, onEvent, onEvent, onEvent, onEvent, onEvent, onEvent, onEvent, onEvent, onEvent, onEvent, onEvent, onEvent, onGroup, onGroup, onType, onUniversalId, onUniversalId, publishEvent, publishEvent, publishEvent, publishEvent, publishEvent, publishEvent, publishEvent, publishEvent, publishEvent, publishEvent, publishEvent, publishEvent, publishEvent, publishEvent, publishEvent, publishEvent, publishEvent, publishEvent, publishEvent, subscribe, subscribe
-
Methods inherited from interface org.refcodes.eventbus.GenericBusObservable
subscribe, unsubscribeAll
-
Methods inherited from interface org.refcodes.eventbus.GenericEventBus
publishEvent, publishEvent
-
-
-
-
Constructor Detail
-
EventBusImpl
public EventBusImpl()
Constructs theEventBuswith theDispatchStrategybeingDispatchStrategy.CASCADEwhen publishing events.
-
EventBusImpl
public EventBusImpl(java.util.concurrent.ExecutorService aExecutorService)
Constructs theEventBuswith theDispatchStrategybeingDispatchStrategy.CASCADEwhen publishing events.- Parameters:
aExecutorService- TheExecutorServiceto be used when creating threads.
-
EventBusImpl
public EventBusImpl(DispatchStrategy aDispatchStrategy)
Constructs theEventBuswith the givenDispatchStrategywhen publishing events.- Parameters:
aDispatchStrategy- TheDispatchStrategyto be used when publishing events.
-
EventBusImpl
public EventBusImpl(DispatchStrategy aDispatchStrategy, java.util.concurrent.ExecutorService aExecutorService)
Constructs theEventBuswith theDispatchStrategybeingDispatchStrategy.CASCADEwhen publishing events.- Parameters:
aDispatchStrategy- TheDispatchStrategyto be used when publishing events.aExecutorService- TheExecutorServiceto be used when creating threads.
-
EventBusImpl
public EventBusImpl(int aCorePoolSize)
Constructs theEventBuswith theDispatchStrategybeingDispatchStrategy.CASCADEwhen publishing events.- Parameters:
aCorePoolSize- The number of threads to keep in the pool, even if they are idle.
-
EventBusImpl
public EventBusImpl(DispatchStrategy aDispatchStrategy, int aCorePoolSize)
Constructs theEventBuswith the givenDispatchStrategywhen publishing events.- Parameters:
aCorePoolSize- The number of threads to keep in the pool, even if they are idle.aDispatchStrategy- TheDispatchStrategyto be used when publishing events.
-
-