geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rsandt...@apache.org
Subject svn commit: r1796299 - /geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/event/Event.java
Date Fri, 26 May 2017 16:27:26 GMT
Author: rsandtner
Date: Fri May 26 16:27:25 2017
New Revision: 1796299

URL: http://svn.apache.org/viewvc?rev=1796299&view=rev
Log:
GERONIMO-6553 update event to cdi 2.0

Modified:
    geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/event/Event.java

Modified: geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/event/Event.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/event/Event.java?rev=1796299&r1=1796298&r2=1796299&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/event/Event.java
(original)
+++ geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/event/Event.java
Fri May 26 16:27:25 2017
@@ -19,6 +19,8 @@
 package javax.enterprise.event;
 
 import java.lang.annotation.Annotation;
+import java.util.concurrent.CompletionStage;
+import java.util.concurrent.Executor;
 
 import javax.enterprise.util.TypeLiteral;
 
@@ -33,11 +35,38 @@ public interface Event<T>
 {
 
     void fire(T event);
-    
+
+    /**
+     * Fires the given event asynchronous and notifies all {@link ObservesAsync} observers.
+     *
+     * @param asyncEvent event to fire async
+     * @param <U> the type of the result
+     *
+     * @return {@link CompletionStage} with type {@code U}
+     *
+     * @since 2.0
+     */
+    <U extends T> CompletionStage<U> fireAsync(U asyncEvent);
+
+    /**
+     * Fires the given event asynchronous and notifies all {@link ObservesAsync} observers.
+     *
+     * @param asyncEvent event to fire async
+     * @param notificationOptions
+     * @param <U> type of the result
+     *
+     * @return {@link CompletionStage} with type {@code U}
+     *
+     * @since 2.0
+     */
+    //X TODO add notificationOptions to javadoc
+    <U extends T> CompletionStage<U>  fireAsync(U asyncEvent, NotificationOptions
notificationOptions);
+
     Event<T> select(Annotation... qualifiers);
     
     <U extends T> Event<U> select(Class<U> subtype, Annotation... qualifiers);
     
-    <U extends T> Event<U> select(TypeLiteral<U> subtype, Annotation...
qualifiers);
+    <U extends T> Event<U> select(TypeLiteral<U> subtype,
+                                  Annotation... qualifiers);
 
 }



Mime
View raw message