T
- event typepublic class FastEvent<T> extends Object
FastEvent eliminates most of the overhead associated with request dispatching by resolving observer methods upfront. It is therefore suitable for cases when certain event is dispatched repeatedly. A FastEvent instance should be created once for a given event type / qualifiers combination and then reused every time a given event is dispatched.
FastEvent provides a subset of functionality provided by Event
and these additional constraints apply to its usage:
fire(Object)
method is
not considered for observer method resolution.These constraints should always be carefully considered when deciding whether to use FastEvent or not. FastEvent is an internal construct and should not be used by an application.
Modifier and Type | Method and Description |
---|---|
void |
fire(T event) |
static <T> FastEvent<T> |
of(Class<T> type,
BeanManagerImpl manager,
Annotation... qualifiers)
Same as
of(Class, BeanManagerImpl, Annotation...) , just the accessible lenient observer notifier is used for observer method resolution |
static <T> FastEvent<T> |
of(Class<T> type,
BeanManagerImpl manager,
ObserverNotifier notifier,
Annotation... qualifiers)
Constructs a new FastEvent instance
|
public static <T> FastEvent<T> of(Class<T> type, BeanManagerImpl manager, Annotation... qualifiers)
of(Class, BeanManagerImpl, Annotation...)
, just the accessible lenient observer notifier is used for observer method resolutionpublic static <T> FastEvent<T> of(Class<T> type, BeanManagerImpl manager, ObserverNotifier notifier, Annotation... qualifiers)
type
- the event typemanager
- the bean managernotifier
- the notifier to be used for observer method resolutionqualifiers
- the event qualifierspublic void fire(T event)
Copyright © 2015. All Rights Reserved.