Interface LifeCycleBus
-
- All Superinterfaces:
DestroyBus
,org.refcodes.eventbus.DispatchStrategyAccessor
,org.refcodes.observer.EventMatcher<ApplicationEvent>
,org.refcodes.eventbus.GenericBusObservable<ApplicationEvent,org.refcodes.observer.Observer<ApplicationEvent>,ApplicationMatcher,org.refcodes.observer.EventMetaData>
,org.refcodes.eventbus.GenericBusPublisher<ApplicationEvent>
,org.refcodes.eventbus.GenericEventBus<ApplicationEvent,org.refcodes.observer.Observer<ApplicationEvent>,ApplicationMatcher,org.refcodes.observer.EventMetaData,java.lang.String>
,org.refcodes.component.HandleLookup<ApplicationEvent,org.refcodes.observer.Observer<ApplicationEvent>>
,InitializeBus
,org.refcodes.matcher.Matcher<ApplicationEvent>
,PauseBus
,org.refcodes.observer.Publisher<ApplicationEvent>
,ResumeBus
,StartBus
,StopBus
- All Known Subinterfaces:
ApplicationBus
,MessagePropertiesBus
- All Known Implementing Classes:
ApplicationBusImpl
public interface LifeCycleBus extends InitializeBus, StartBus, PauseBus, ResumeBus, StopBus, DestroyBus
TheLifeCycleBus
extends theApplicationBus
with convenience functionality common to everyday application and service development regarding dispatching ofLifeCycleStatus
signals such asInitializeBusEvent
,StartBusEvent
,PauseBusEvent
,ResumeBusEvent
,StopBusEvent
orDestroyBusEvent
instances. To ensure controlledLifeCycleBusObserver
bootstrapping (subscribed viaonLifeCycle(LifeCycleBusObserver)
and the like), theInitializeBusEvent
instances fired upon calls to methods such asInitializeBus.publishInitialize(Properties)
(and the like) are (if not stated otherwise) dispatched with theDispatchStrategy.CASCADE
strategy. Same applies to service "shutdown" as ofPauseBus.publishPause()
,StopBus.publishStop()
orDestroyBus.publishDestroy()
(and the like) which are also dispatched by default with theDispatchStrategy.CASCADE
strategy. This means that the observer methodsLifeCycleBusObserver.onInitialize(InitializeBusEvent)
,LifeCycleBusObserver.onPause(PauseBusEvent)
,LifeCycleBusObserver.onStop(StopBusEvent)
andLifeCycleBusObserver.onDestroy(DestroyBusEvent)
must exit the invoking thread as soon as possible so not to block succeeding listener methods. As initialization is processed in a controlled manner (as mentioned above), starting or resuming theLifeCycleBusObserver
instances is done with theDispatchStrategy.PARALLEL
as we enter normal operation. This means that the observer methodsLifeCycleBusObserver.onStart(StartBusEvent)
andLifeCycleBusObserver.onResume(ResumeBusEvent)
do not need to exit the invoking thread as they cannot block succeeding listener methods.
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default java.lang.String
onLifeCycle(java.lang.Class<?> aPublisherType, LifeCycleBusObserver aObserver)
Subscribes aLifeCycleBusObserver
forLifeCycleBusEvent
instances with the given attributes to be passed to the accordingLifeCycleBusObserver
methods.default java.lang.String
onLifeCycle(java.lang.Enum<?> aAction, java.lang.Class<?> aPublisherType, LifeCycleBusObserver aObserver)
Subscribes aLifeCycleBusObserver
forLifeCycleBusEvent
instances with the given attributes to be passed to the accordingLifeCycleBusObserver
methods.default java.lang.String
onLifeCycle(java.lang.Enum<?> aAction, java.lang.String aAlias, java.lang.String aGroup, java.lang.String aChannel, java.lang.String aUid, java.lang.Class<?> aPublisherType, LifeCycleBusObserver aObserver)
Subscribes aLifeCycleBusObserver
forLifeCycleBusEvent
instances with the given attributes to be passed to the accordingLifeCycleBusObserver
methods.default java.lang.String
onLifeCycle(java.lang.Enum<?> aAction, java.lang.String aChannel, LifeCycleBusObserver aObserver)
Subscribes aLifeCycleBusObserver
forLifeCycleBusEvent
instances with the given attributes to be passed to the accordingLifeCycleBusObserver
methods.default java.lang.String
onLifeCycle(java.lang.Enum<?> aAction, LifeCycleBusObserver aObserver)
Subscribes aLifeCycleBusObserver
forLifeCycleBusEvent
instances with the given attributes to be passed to the accordingLifeCycleBusObserver
methods.default java.lang.String
onLifeCycle(java.lang.String aAlias, java.lang.String aGroup, java.lang.String aChannel, java.lang.String aUid, java.lang.Class<?> aPublisherType, LifeCycleBusObserver aObserver)
Subscribes aLifeCycleBusObserver
forLifeCycleBusEvent
instances with the given attributes to be passed to the accordingLifeCycleBusObserver
methods.default java.lang.String
onLifeCycle(java.lang.String aChannel, LifeCycleBusObserver aObserver)
Subscribes aLifeCycleBusObserver
forLifeCycleBusEvent
instances with the given attributes to be passed to the accordingLifeCycleBusObserver
methods.default java.lang.String
onLifeCycle(LifeCycleBusObserver aObserver)
Subscribes aLifeCycleBusObserver
forLifeCycleBusEvent
instances to be passed to the accordingLifeCycleBusObserver
methods.-
Methods inherited from interface org.refcodes.eventbus.ext.application.DestroyBus
onDestroy, onDestroy, onDestroy, onDestroy, onDestroy, onDestroy, onDestroy, onDestroy, publishDestroy, publishDestroy, publishDestroy, publishDestroy, publishDestroy, publishDestroy, publishDestroy, publishDestroy, publishDestroy, publishDestroy
-
Methods inherited from interface org.refcodes.eventbus.GenericBusObservable
subscribe, subscribe, subscribe, unsubscribeAll
-
Methods inherited from interface org.refcodes.eventbus.GenericEventBus
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, publishEvent, publishEvent
-
Methods inherited from interface org.refcodes.component.HandleLookup
hasHandle, lookupHandle, removeHandle
-
Methods inherited from interface org.refcodes.eventbus.ext.application.InitializeBus
onInitialize, onInitialize, onInitialize, onInitialize, onInitialize, onInitialize, onInitialize, onInitialize, publishInitialize, publishInitialize, publishInitialize, publishInitialize, publishInitialize, publishInitialize, publishInitialize, publishInitialize, publishInitialize, publishInitialize, publishInitialize, publishInitialize, publishInitialize, publishInitialize, publishInitialize, publishInitialize, publishInitialize, publishInitialize, publishInitialize, publishInitialize
-
Methods inherited from interface org.refcodes.eventbus.ext.application.PauseBus
onPause, onPause, onPause, onPause, onPause, onPause, onPause, onPause, publishPause, publishPause, publishPause, publishPause, publishPause, publishPause, publishPause, publishPause, publishPause, publishPause
-
Methods inherited from interface org.refcodes.eventbus.ext.application.ResumeBus
onResume, onResume, onResume, onResume, onResume, onResume, onResume, onResume, publishResume, publishResume, publishResume, publishResume, publishResume, publishResume, publishResume, publishResume, publishResume, publishResume
-
Methods inherited from interface org.refcodes.eventbus.ext.application.StartBus
onStart, onStart, onStart, onStart, onStart, onStart, onStart, onStart, publishStart, publishStart, publishStart, publishStart, publishStart, publishStart, publishStart, publishStart, publishStart, publishStart
-
Methods inherited from interface org.refcodes.eventbus.ext.application.StopBus
onStop, onStop, onStop, onStop, onStop, onStop, onStop, onStop, publishStop, publishStop, publishStop, publishStop, publishStop, publishStop, publishStop, publishStop, publishStop, publishStop
-
-
-
-
Method Detail
-
onLifeCycle
default java.lang.String onLifeCycle(LifeCycleBusObserver aObserver)
Subscribes aLifeCycleBusObserver
forLifeCycleBusEvent
instances to be passed to the accordingLifeCycleBusObserver
methods.- Parameters:
aObserver
- The observer to be notified.- Returns:
- A handle to unsubscribe this combination.
-
onLifeCycle
default java.lang.String onLifeCycle(java.lang.Class<?> aPublisherType, LifeCycleBusObserver aObserver)
Subscribes aLifeCycleBusObserver
forLifeCycleBusEvent
instances with the given attributes to be passed to the accordingLifeCycleBusObserver
methods.- Parameters:
aPublisherType
- The type of the event publisher.aObserver
- The observer to be notified.- Returns:
- A handle to unsubscribe this combination.
-
onLifeCycle
default java.lang.String onLifeCycle(java.lang.String aChannel, LifeCycleBusObserver aObserver)
Subscribes aLifeCycleBusObserver
forLifeCycleBusEvent
instances with the given attributes to be passed to the accordingLifeCycleBusObserver
methods.- Parameters:
aChannel
- The channel name on which the event is receivable.aObserver
- The observer to be notified.- Returns:
- A handle to unsubscribe this combination.
-
onLifeCycle
default java.lang.String onLifeCycle(java.lang.String aAlias, java.lang.String aGroup, java.lang.String aChannel, java.lang.String aUid, java.lang.Class<?> aPublisherType, LifeCycleBusObserver aObserver)
Subscribes aLifeCycleBusObserver
forLifeCycleBusEvent
instances with the given attributes to be passed to the accordingLifeCycleBusObserver
methods.- Parameters:
aAlias
- The alias property.aGroup
- The group property.aChannel
- The channel property.aUid
- The UID (Universal-ID) property.aPublisherType
- The type of the event publisher.aObserver
- The observer to be notified.- Returns:
- A handle to unsubscribe this combination.
-
onLifeCycle
default java.lang.String onLifeCycle(java.lang.Enum<?> aAction, java.lang.Class<?> aPublisherType, LifeCycleBusObserver aObserver)
Subscribes aLifeCycleBusObserver
forLifeCycleBusEvent
instances with the given attributes to be passed to the accordingLifeCycleBusObserver
methods.- 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.
-
onLifeCycle
default java.lang.String onLifeCycle(java.lang.Enum<?> aAction, java.lang.String aChannel, LifeCycleBusObserver aObserver)
Subscribes aLifeCycleBusObserver
forLifeCycleBusEvent
instances with the given attributes to be passed to the accordingLifeCycleBusObserver
methods.- 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.
-
onLifeCycle
default java.lang.String onLifeCycle(java.lang.Enum<?> aAction, java.lang.String aAlias, java.lang.String aGroup, java.lang.String aChannel, java.lang.String aUid, java.lang.Class<?> aPublisherType, LifeCycleBusObserver aObserver)
Subscribes aLifeCycleBusObserver
forLifeCycleBusEvent
instances with the given attributes to be passed to the accordingLifeCycleBusObserver
methods.- Parameters:
aAction
- The action which this represents.aAlias
- The alias property.aGroup
- The group property.aChannel
- The channel property.aUid
- The UID (Universal-ID) property.aPublisherType
- The type of the event publisher.aObserver
- The observer to be notified.- Returns:
- A handle to unsubscribe this combination.
-
onLifeCycle
default java.lang.String onLifeCycle(java.lang.Enum<?> aAction, LifeCycleBusObserver aObserver)
Subscribes aLifeCycleBusObserver
forLifeCycleBusEvent
instances with the given attributes to be passed to the accordingLifeCycleBusObserver
methods.- Parameters:
aAction
- The action which this represents.aObserver
- The observer to be notified.- Returns:
- A handle to unsubscribe this combination.
-
-