geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1796210 - in /geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi: BeforeBeanDiscovery.java ObserverMethod.java ProcessObserverMethod.java configurator/ProducerConfigurator.java
Date Thu, 25 May 2017 21:56:59 GMT
Author: struberg
Date: Thu May 25 21:56:59 2017
New Revision: 1796210

URL: http://svn.apache.org/viewvc?rev=1796210&view=rev
Log:
GERONIMO-6553 more smallish cleanup

Modified:
    geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/BeforeBeanDiscovery.java
    geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/ObserverMethod.java
    geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/ProcessObserverMethod.java
    geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/configurator/ProducerConfigurator.java

Modified: geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/BeforeBeanDiscovery.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/BeforeBeanDiscovery.java?rev=1796210&r1=1796209&r2=1796210&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/BeforeBeanDiscovery.java
(original)
+++ geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/BeforeBeanDiscovery.java
Thu May 25 21:56:59 2017
@@ -94,12 +94,24 @@ public interface BeforeBeanDiscovery
     void addAnnotatedType(AnnotatedType<?> type, String id);
 
     /**
-     * Returns a new annotated type configurator based on a new bean id and bean class.
-     *
      * @param clazz to add
      * @param id of the annotated type
      * @param <T>
-     * @return
+     * @return a new annotated type configurator based on a new bean id and bean class.
      */
     <T> AnnotatedTypeConfigurator<T> addAnnotatedType(Class<T> clazz, String
id);
+
+    /**
+     * @param interceptorBindingType
+     * @param <T>
+     * @return a new annotated type configurator to create an InterceptorBinding
+     */
+    <T> AnnotatedTypeConfigurator<T> configureInterceptorBinding(Class<T>
interceptorBindingType);
+
+    /**
+     * @param qualifier
+     * @param <T>
+     * @return a new annotated type configurator to create a Qualifier
+     */
+    <T> AnnotatedTypeConfigurator<T> configureQualifier(Class<T> qualifier);
 }

Modified: geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/ObserverMethod.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/ObserverMethod.java?rev=1796210&r1=1796209&r2=1796210&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/ObserverMethod.java
(original)
+++ geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/ObserverMethod.java
Thu May 25 21:56:59 2017
@@ -24,6 +24,7 @@ import java.util.Set;
 
 import javax.enterprise.event.Reception;
 import javax.enterprise.event.TransactionPhase;
+import javax.naming.event.*;
 
 /**
  * <p>ObserverMethod is the SPI to handle an observer method, which is 
@@ -63,8 +64,13 @@ import javax.enterprise.event.Transactio
  * @param <T> the event which should be observed
  * @see javax.enterprise.event.Observes
  */
-public interface ObserverMethod<T>
+public interface ObserverMethod<T> extends Prioritized
 {
+    /**
+     * The default Priority of any ObserverMethod without a &#064;Priority annotation.
+     */
+    int DEFAULT_PRIORITY = 2500;
+
     Class<?> getBeanClass();
     
     /**
@@ -90,16 +96,43 @@ public interface ObserverMethod<T>
     TransactionPhase getTransactionPhase();
 
     /**
-     * will actually cann the underlying observer method
+     * will actually call the underlying observer method
      * @param event
      */
-    void notify(T event);
+    default void notify(T event)
+    {
+        // empty by default
+    }
+
+    /**
+     * Call the observer method with the given eventContext.
+     * @param eventContext
+     */
+    default void notify(EventContext<T> eventContext)
+    {
+        if (eventContext != null)
+        {
+            notify(eventContext.getEvent());
+        }
+    }
 
    /**
-    * Whether or not this observer method is an async observer.  defaults to false for compatibility
-    * @return
+    * @return Whether or not this observer method is an async observer.  defaults to false
for compatibility
     */
-    default boolean isAsync() {
+    default boolean isAsync()
+    {
         return false;
     }
+
+    /**
+     * Only synchronous ObserverMethods can be ordered!
+     *
+     * @return The &#064;Priority of this ObserverMethod
+     */
+    default int getPriority()
+    {
+        return DEFAULT_PRIORITY;
+    }
+
+
 }

Modified: geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/ProcessObserverMethod.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/ProcessObserverMethod.java?rev=1796210&r1=1796209&r2=1796210&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/ProcessObserverMethod.java
(original)
+++ geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/ProcessObserverMethod.java
Thu May 25 21:56:59 2017
@@ -45,6 +45,17 @@ public interface ProcessObserverMethod<T
      */
     ObserverMethod<T> getObserverMethod();
 
+
+    /**
+     * @param observerMethod to replace the original one
+     */
+    void setObserverMethod(ObserverMethod<T> observerMethod);
+
+    /**
+     * Tell the container to ignore the current ObserverMethod.
+     */
+    void veto();
+
     /**
      * Add throwable.
      * 
@@ -57,5 +68,7 @@ public interface ProcessObserverMethod<T
     * @return
     */
     ObserverMethodConfigurator<T> configureObserverMethod();
+
+
     
 }

Modified: geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/configurator/ProducerConfigurator.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/configurator/ProducerConfigurator.java?rev=1796210&r1=1796209&r2=1796210&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/configurator/ProducerConfigurator.java
(original)
+++ geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/configurator/ProducerConfigurator.java
Thu May 25 21:56:59 2017
@@ -19,6 +19,7 @@
 
 package javax.enterprise.inject.spi.configurator;
 
+import javax.enterprise.context.spi.CreationalContext;
 import javax.enterprise.inject.Instance;
 import java.util.function.Consumer;
 import java.util.function.Function;
@@ -32,7 +33,7 @@ public interface ProducerConfigurator<T>
      * @param callback use as produced instance for the configured bean
      * @return self
      */
-    <U extends T> ProducerConfigurator<U> produceWith(Function<Instance<Object>,
U> callback);
+    <U extends T> ProducerConfigurator<T> produceWith(Function<CreationalContext<U>,
U> callback);
 
     /**
      *



Mime
View raw message