Module org.refcodes.observer
Package org.refcodes.observer
This package provides types supporting the Observable-Pattern. E.g. we have
the definitions of an
Observable
and the
according Observer
.
An Observable
for example can be observed by
Observer
instances being subscribed to it via
Observable.subscribeObserver(Object)
.
-
Interface Summary Interface Description ActionEvent AnActionEvent
extends theEvent
and provides additional means to provide an actionActionAccessor.getAction()
being of typeEnum
.Event EventMatcher<E extends GenericEvent<?>> This interface typifies theMatcher
interface for the usage withGenericActionEvent
instances.GenericActionEvent<A,SRC> AnGenericActionEvent
extends theGenericEvent
and provides additional means to provide an action viaActionAccessor.getAction()
being of a generic type.GenericActionMetaDataEvent<A,EM extends org.refcodes.mixin.EventMetaData,SRC> AnGenericActionMetaDataEvent
provides Meta-Data describing theGenericActionEvent
in more detail and a source being the origin of theGenericActionMetaDataEvent
.GenericActionMetaDataEvent.GenericActionMetaDataEventBuilder<A,EM extends org.refcodes.mixin.EventMetaData,SRC,B extends GenericActionMetaDataEvent.GenericActionMetaDataEventBuilder<A,EM,SRC,B>> Builder extension for theGenericActionMetaDataEvent
type.GenericActionPayloadEvent<A,P,SRC> TheGenericActionPayloadEvent
represents anActionEvent
which carries an additional payload.GenericActionPayloadMetaDataEvent<A,P,EM extends org.refcodes.mixin.EventMetaData,SRC> AnGenericActionPayloadMetaDataEvent
provides Meta-Data describing theGenericActionPayloadMetaDataEvent
in more detail and a payload as well as an action.GenericActionPayloadMetaDataEvent.GenericActionPayloadMetaDataEventBuilder<A,P,EM extends org.refcodes.mixin.EventMetaData,SRC,B extends GenericActionPayloadMetaDataEvent.GenericActionPayloadMetaDataEventBuilder<A,P,EM,SRC,B>> Builder extension for theGenericActionPayloadMetaDataEvent
type.GenericEvent<SRC> GenericMetaDataEvent<EM extends org.refcodes.mixin.EventMetaData,SRC> AnGenericMetaDataEvent
provides Meta-Data describing theGenericActionEvent
in more detail and a source being the origin of theGenericMetaDataEvent
.GenericPayloadEvent<P,SRC> TheGenericPayloadEvent
represents anEvent
which carries an additional payload accessible viaPayloadAccessor.getPayload()
.GenericPayloadMetaDataEvent<P,EM extends org.refcodes.mixin.EventMetaData,SRC> AnGenericPayloadMetaDataEvent
provides Meta-Data describing theGenericPayloadMetaDataEvent
in more detail and a payload.MetaDataActionEvent AnMetaDataActionEvent
is published by anObservable
and is consumed by zero to manyObserver
instances.MetaDataActionEvent.ActionMetaDataEventBuilder Builder for theMetaDataActionEvent
.MetaDataEvent MetaDataEventMatcher<E extends GenericMetaDataEvent<?,?>> This interface typifies theMatcher
interface for the usage withGenericMetaDataEvent
instances.Observable<O> TheObservable
interface can be implemented by any class which can be observed byObserver
instances (proposal) or any listener interface (custom as of your needs).ObservableObserver<O extends Observable<?>> AnObservableObserver
is an observer, observing an observable.Observer<E extends GenericEvent<?>> The listener of an event subscriber to be fed with events by a event publisher.ObserverDescriptor<E extends GenericEvent<?>,O extends Observer<E>,EM extends EventMatcher<E>> ThisObserverDescriptor
describes theObserver
, i.e. in some cases anObserver
requires anEventMatcher
which determines whichGenericActionEvent
instances to pass to theObserver
.Observers<O,B extends Observers<O,B>> Provides methods to manage all subscribedObserver
instances as a whole and is intended as an extension of theObservable
interface.PayloadActionEvent<P> ThePayloadActionEvent
represents anActionEvent
which carries an additional payload.PayloadEvent<P> ThePayloadEvent
represents anEvent
which carries an additional payload accessible viaPayloadAccessor.getPayload()
.PayloadMetaDataActionEvent<P> AnPayloadMetaDataActionEvent
provides Meta-Data describing thePayloadMetaDataActionEvent
in more detail and a payload as well as an action.PayloadMetaDataActionEvent.ActionPayloadMetaDataEventBuilder<P> Builder extension for thePayloadMetaDataActionEvent
type.PayloadMetaDataEvent<P> AnPayloadMetaDataEvent
provides Meta-Data describing theGenericPayloadMetaDataEvent
in more detail and a payload.Publisher<E extends GenericEvent<?>> A system publishingGenericActionEvent
instances (such as an event bus), may implement this interface.SubscribeEvent<O extends Observable<?>> AnSubscribeEvent
is published by anObservable
when an observer is being subscribed.UnsubscribeEvent<O extends Observable<?>> AnUnsubscribeEvent
is published by anObservable
when an observer is being unsubscribed. -
Class Summary Class Description AbstractActionEvent<A,SRC> The Class AbstractActionEvent.AbstractEvent<SRC> Basic implementation of theGenericEvent
.AbstractMetaDataActionEvent<A,EM extends org.refcodes.mixin.EventMetaData,SRC> Ready to useGenericActionEvent
storing a defined set ofEventMetaData
.AbstractMetaDataActionEvent.AbstractActionMetaDataEventBuilder<A,EM extends org.refcodes.mixin.EventMetaData,SRC,B extends GenericActionMetaDataEvent.GenericActionMetaDataEventBuilder<A,EM,SRC,B>> Implementation of theGenericActionMetaDataEvent.GenericActionMetaDataEventBuilder
interface for easily creatingMetaDataActionEvent
instances.AbstractMetaDataEvent<EM extends org.refcodes.mixin.EventMetaData,SRC> Ready to useGenericActionEvent
storing a defined set ofEventMetaData
.AbstractObservable<O,EV> This abstract class provides functionality to implement default refcodesObservable
behavior.AbstractPayloadActionEvent<A,P,SRC> Basic implementation of theGenericActionPayloadEvent
.AbstractPayloadEvent<P,SRC> Basic implementation of theGenericPayloadEvent
.AbstractPayloadMetaDataActionEvent<A,P,EM extends org.refcodes.mixin.EventMetaData,SRC> Basic implementation of theGenericActionPayloadMetaDataEvent
.AbstractPayloadMetaDataActionEvent.AbstractActionPayloadMetaDataEventBuilder<A,P,EM extends org.refcodes.mixin.EventMetaData,SRC,B extends GenericActionPayloadMetaDataEvent.GenericActionPayloadMetaDataEventBuilder<A,P,EM,SRC,B>> Basic implementation of theGenericActionPayloadMetaDataEvent.GenericActionPayloadMetaDataEventBuilder
.AbstractPayloadMetaDataEvent<P,EM extends org.refcodes.mixin.EventMetaData,SRC> Basic implementation of theGenericActionPayloadEvent
.ActionEventImpl Basic implementation of theEvent
interface.EventImpl Basic implementation of theEvent
interface.EventMatcherSugar Declarative syntactic sugar which may be statically imported in order to allow declarative definitions for theEventMatcher
elements.MetaDataActionEventBuilderImpl Implementation of theMetaDataActionEvent.ActionMetaDataEventBuilder
interface for easily creatingMetaDataActionEvent
instances.MetaDataActionEventImpl MetaDataEventImpl Basic implementation of theEvent
interface.ObserverDescriptorImpl<E extends GenericEvent<?>,O extends Observer<E>,EM extends EventMatcher<E>> As a descriptor describes something fixed, this class is immutable in the sense that there are no setters for the attributes.PayloadActionEventImpl<P> ThePayloadActionEvent
represents anActionEvent
which carries an additional payload.PayloadEventImpl<P> Basic implementation of thePayloadEvent
interface.PayloadMetaDataActionEventBuilderImpl<P> Implementation of thePayloadMetaDataActionEvent.ActionPayloadMetaDataEventBuilder
interface for easily creatingPayloadMetaDataActionEvent
instances.PayloadMetaDataActionEventImpl<P> Basic implementation of theAbstractPayloadMetaDataActionEvent
.PayloadMetaDataEventImpl<P> Basic implementation of thePayloadMetaDataEvent
interface.SubscribeEventImpl<O extends Observable<?>> The Class SubscribeEventImpl.UnsubscribeEventImpl<O extends Observable<?>> The Class UnsubscribeEventImpl.