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:
Serializable,Event<T>,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:
Event, 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 voidfire(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 TypegetEventType(Class<?> runtimeType)static <E> EventImpl<E>of(InjectionPoint injectionPoint, BeanManagerImpl beanManager)WeldEvent<T>select(Annotation... qualifiers)Obtains a child Event for the given additional required qualifiers.<U extends T>
WeldEvent<U>select(Class<U> subtype, Annotation... qualifiers)Obtains a child Event for the given required type and additional required qualifiers.<X> WeldEvent<X>select(Type type, Annotation... qualifiers)Obtains a childEventfor the given required type and additional required qualifiers.<U extends T>
WeldEvent<U>select(TypeLiteral<U> subtype, Annotation... qualifiers)Obtains a child Event for the given required type and additional required qualifiers.StringtoString()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:EventFires an event with the specified qualifiers and notifies observers.
-
fireAsync
public <U extends T> CompletionStage<U> fireAsync(U event)
Description copied from interface:EventFires an event asynchronously with the specified qualifiers and notifies asynchronous observers.
- Specified by:
fireAsyncin interfaceEvent<T>- Parameters:
event- the event object- Returns:
- a
CompletionStageallowing 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 withCompletionExceptionthat 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:EventFires an event asynchronously with the specified qualifiers and notifies asynchronous observers. A custom
Executorwill be used to make asynchronous calls- Specified by:
fireAsyncin interfaceEvent<T>- Parameters:
event- the event objectoptions- the notification options- Returns:
- a
CompletionStageallowing 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 withCompletionExceptionthat 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:EventObtains 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:EventObtains 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:EventObtains 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:WeldEventObtains a child
Eventfor the given required type and additional required qualifiers. Must be invoked onEvent<T>where T isObject.
-
-