GenericEventBus
is the (virtual) machine wide manager for event
handling. It implements a publish/subscribe mechanism.
"... lately some colleagues and me were reasoning on how to do client-side (Browser, JavaScript) communication between web-page components ... decoupled ... in general I recommend taking a look at an event-bus (aka page-bus), with Java why not take a look at the refcodes-eventbus? ... the following “equation” came to mind … simply speaking, the equation Observer pattern + Publish–subscribe pattern = Message broker solves to refcodes-eventbus ..."
Signaling events to some event-listener … Subscribing your event-listener for some specific events … Publishing events merely to interested event-listeners … Strongly decoupling the publisher and the subscriber … Considering privacy issues (no simple broadcast) …
In the article refcodes-eventbus: Observer + Publish–subscribe = Message broker I describe the refcodes-eventbus accompanied with a plain simple example on how to use it.
The refcodes-eventbus artifact makes use of the refcodes-matcher framework for defining the criteria on when to deliver an event to an event-listener. It also sets on top of the refcodes-observer framework regarding issues around the Observer pattern ... See also "http://www.refcodes.org/blog/publish_subscribe_observe_event-bus"
Interface | Description |
---|---|
BusEvent | |
BusEvent.BusEventBuilder |
Intuitive Meta-Interface for the
BusEvent.BusEventBuilder as used by the
EventBus . |
BusMatcher |
A convenience definition of an
EventMatcher for the ready to use out
of the box EventBusImpl implementation of the generic
GenericEventBus definition. |
BusObserver |
A convenience definition of an
Observer for the ready to use out of
the box EventBusImpl implementation of the generic
GenericEventBus definition. |
DispatchStrategyAccessor |
Provides an accessor for a
DispatchStrategy property. |
DispatchStrategyAccessor.DispatchStrategyMutator |
Provides a mutator for a
DispatchStrategy property. |
DispatchStrategyAccessor.DispatchStrategyProperty |
Provides a
DispatchStrategy property. |
EventBus |
The
EventBus defines a predefined GenericEventBus tailored to
use the ActionMetaDataEvent as event type to use. |
GenericBusEvent<A,META extends org.refcodes.observer.EventMetaData,SRC extends GenericEventBus<?,?,?,?,?>> |
Intuitive Meta-Interface for the
GenericActionMetaDataEvent as used
by the EventBus . |
GenericBusEvent.GenericBusEventBuilder<A,META extends org.refcodes.observer.EventMetaData,SRC extends GenericEventBus<?,?,?,?,?>,B extends GenericBusEvent.GenericBusEventBuilder<A,META,SRC,B>> |
Intuitive Meta-Interface for the
GenericBusEvent.GenericBusEventBuilder as used
by the GenericEventBus . |
GenericBusObservable<E extends org.refcodes.observer.GenericEvent<?>,O extends org.refcodes.observer.Observer<E>,MATCH extends org.refcodes.observer.EventMatcher<E>,H> | |
GenericBusPublisher<E extends org.refcodes.observer.GenericEvent<?>> |
The Interface BusPublisher.
|
GenericEventBus<E extends org.refcodes.observer.GenericEvent<?>,O extends org.refcodes.observer.Observer<E>,MATCH extends org.refcodes.observer.EventMatcher<E>,META extends org.refcodes.observer.EventMetaData,H> |
The
GenericEventBus is the (virtual) machine wide manager for
GenericActionEvent handling. |
Class | Description |
---|---|
AbstractEventBus<E extends org.refcodes.observer.GenericEvent<?>,O extends org.refcodes.observer.Observer<E>,MATCH extends org.refcodes.observer.EventMatcher<E>,META extends org.refcodes.observer.EventMetaData,H> |
The Class AbstractEventBus.
|
BusEventBuilderImpl |
Intuitive Meta-Class for the
ActionMetaDataEventBuilderImpl as used
by the EventBus . |
BusEventImpl |
Intuitive Meta-Class for the
ActionMetaDataEventImpl as used by the
EventBus . |
BusMatcherSugar |
Declarative syntactic sugar which may be statically imported in order to
allow declarative definitions for the
BusMatcher elements. |
EventBusImpl |
The
EventBusImpl is a ready to use implementation of a
EventBus using a default DispatchStrategy being
DispatchStrategy.CASCADE and extending the AbstractEventBus . |
Enum | Description |
---|---|
DispatchStrategy |
The
DispatchStrategy defines how child events are published within a
parent event publish cycle. |
Copyright © 2018. All rights reserved.