Package org.jboss.weld.event
Class EventImpl<T>
- java.lang.Object
-
- org.jboss.weld.bean.builtin.AbstractFacade<T,WeldEvent<T>>
-
- org.jboss.weld.event.EventImpl<T>
-
- Type Parameters:
T
- The type of event being wrapped
- All Implemented Interfaces:
Event<T>
,Serializable
,WeldEvent<T>
public class EventImpl<T> extends AbstractFacade<T,WeldEvent<T>> implements WeldEvent<T>, Serializable
Implementation of the Event interface- Author:
- David Allen
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.jboss.weld.bean.builtin.AbstractFacade
AbstractFacade.AbstractFacadeSerializationProxy<T,X>
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
fire(T event)
Fires an event with the specified qualifiers and notifies observers.<U extends T>
CompletionStage<U>fireAsync(U event)
Fires an event asynchronously with the specified qualifiers and notifies asynchronous observers.<U extends T>
CompletionStage<U>fireAsync(U event, NotificationOptions options)
Fires an event asynchronously with the specified qualifiers and notifies asynchronous observers.protected Type
getEventType(Class<?> runtimeType)
static <E> EventImpl<E>
of(InjectionPoint injectionPoint, BeanManagerImpl beanManager)
<U extends T>
WeldEvent<U>select(TypeLiteral<U> subtype, Annotation... qualifiers)
Obtains a childEvent
for the given required type and additional required qualifiers.WeldEvent<T>
select(Annotation... qualifiers)
Obtains a childEvent
for the given additional required qualifiers.<U extends T>
WeldEvent<U>select(Class<U> subtype, Annotation... qualifiers)
Obtains a childEvent
for the given required type and additional required qualifiers.<X> WeldEvent<X>
select(Type type, Annotation... qualifiers)
Obtains a childEvent
for the given required type and additional required qualifiers.String
toString()
Gets a string representation-
Methods inherited from class org.jboss.weld.bean.builtin.AbstractFacade
equals, getBeanManager, getCreationalContext, getFacadeType, getInjectionPoint, getQualifiers, getType, hashCode
-
-
-
-
Method Detail
-
of
public static <E> EventImpl<E> of(InjectionPoint injectionPoint, BeanManagerImpl beanManager)
-
toString
public String toString()
Gets a string representation
-
fire
public void fire(T event)
Description copied from interface:Event
Fires an event with the specified qualifiers and notifies observers.
-
fireAsync
public <U extends T> CompletionStage<U> fireAsync(U event)
Description copied from interface:Event
Fires an event asynchronously with the specified qualifiers and notifies asynchronous observers.
- Specified by:
fireAsync
in interfaceEvent<T>
- Type Parameters:
U
- event type- Parameters:
event
- the event object- Returns:
- a
CompletionStage
allowing further pipeline composition on the asynchronous operation. Default asynchronous execution facility is container specific. If any observer notified by this event throws an exception then the resulting CompletionStage is completed exceptionally withCompletionException
that wraps all the exceptions raised by observers as suppressed exception. If no exception is thrown by observers then the resulting CompletionStage is completed normally with the event payload.
-
fireAsync
public <U extends T> CompletionStage<U> fireAsync(U event, NotificationOptions options)
Description copied from interface:Event
Fires an event asynchronously with the specified qualifiers and notifies asynchronous observers. A custom
Executor
will be used to make asynchronous calls- Specified by:
fireAsync
in interfaceEvent<T>
- Type Parameters:
U
- event type- Parameters:
event
- the event objectoptions
- the notification options- Returns:
- a
CompletionStage
allowing further pipeline composition on the asynchronous operation. Default asynchronous execution facility is container specific. If any observer notified by this event throws an exception then the resulting CompletionStage is completed exceptionally withCompletionException
that wraps all the exceptions raised by observers as suppressed exception. If no exception is thrown by observers then the resulting CompletionStage is completed normally with the event payload.
-
select
public WeldEvent<T> select(Annotation... qualifiers)
Description copied from interface:Event
Obtains a child
Event
for the given additional required qualifiers.
-
select
public <U extends T> WeldEvent<U> select(Class<U> subtype, Annotation... qualifiers)
Description copied from interface:Event
Obtains a child
Event
for the given required type and additional required qualifiers.
-
select
public <U extends T> WeldEvent<U> select(TypeLiteral<U> subtype, Annotation... qualifiers)
Description copied from interface:Event
Obtains a child
Event
for the given required type and additional required qualifiers.
-
select
public <X> WeldEvent<X> select(Type type, Annotation... qualifiers)
Description copied from interface:WeldEvent
Obtains a child
Event
for the given required type and additional required qualifiers. Must be invoked onEvent<T>
where T isObject
.
-
-