public class DefaultEventSinkBroker extends Object implements EventSinkBroker
EventSinkBroker
.Constructor and Description |
---|
DefaultEventSinkBroker() |
Modifier and Type | Method and Description |
---|---|
void |
addSink(Class<? extends Event> eventClass,
EventSink sink)
Adds a new event sink associated with the specified event class.
|
EventSink |
get(Class<? extends Event> eventClass)
Get the event sink associated with the given event class.
|
protected EventSink |
get(Class<? extends Event> eventClass,
boolean cacheInferredSink)
|
void |
removeSink(Class<? extends Event> eventClass)
Removes a previously added event sink.
|
protected Map<Class<? extends Event>,EventSink> |
sinks()
|
public void addSink(Class<? extends Event> eventClass, EventSink sink)
EventSinkBroker
addSink
in interface EventSinkBroker
eventClass
- class of events handled by the sinksink
- event sinkpublic EventSink get(Class<? extends Event> eventClass)
EventSinkBroker
get
in interface EventSinkBroker
eventClass
- class of eventsprotected EventSink get(Class<? extends Event> eventClass, boolean cacheInferredSink)
EventSink
corresponding to the supplied Event
class. If no such direct mapping exists then the Event
class
supplied will be examined to determine whether any of its interfaces or
super-interfaces have a direct mapping to an EventSink
; if such a
mapping is found then the resulting EventSink
will be returned.
In such a case if the supplied boolean
is true
then a
direct mapping is added to cache the inferred relationship between the
supplied Event
class and the resulting EventSink
, but if
the boolean
is false
no such cache entry is added.public void removeSink(Class<? extends Event> eventClass)
EventSinkBroker
removeSink
in interface EventSinkBroker
eventClass
- class of events handled by the sinkCopyright © 2015. All Rights Reserved.