geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1796185 - in /geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi: ./ configurator/
Date Thu, 25 May 2017 19:49:10 GMT
Author: struberg
Date: Thu May 25 19:49:10 2017
New Revision: 1796185

URL: http://svn.apache.org/viewvc?rev=1796185&view=rev
Log:
GERONIMO-6553 apply final changes to Configurators

Added:
    geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/EventContext.java
  (with props)
Modified:
    geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/ProcessBeanAttributes.java
    geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/configurator/AnnotatedConstructorConfigurator.java
    geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/configurator/AnnotatedFieldConfigurator.java
    geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/configurator/AnnotatedMethodConfigurator.java
    geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/configurator/AnnotatedParameterConfigurator.java
    geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/configurator/AnnotatedTypeConfigurator.java
    geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/configurator/BeanAttributesConfigurator.java
    geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/configurator/BeanConfigurator.java
    geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/configurator/InjectionPointConfigurator.java
    geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/configurator/ObserverMethodConfigurator.java

Added: geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/EventContext.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/EventContext.java?rev=1796185&view=auto
==============================================================================
--- geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/EventContext.java
(added)
+++ geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/EventContext.java
Thu May 25 19:49:10 2017
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package javax.enterprise.inject.spi;
+
+/**
+ * An EventContext provides information about the event instance
+ * and the metadata of a fired event.
+ *
+ * @param <T> the type of the event instance
+ */
+public interface EventContext<T>
+{
+    /**
+     * @return the event payload
+     */
+    T getEvent();
+
+    /**
+     * @return the event metadata
+     */
+    EventMetadata getMetadata();
+}

Propchange: geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/EventContext.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/ProcessBeanAttributes.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/ProcessBeanAttributes.java?rev=1796185&r1=1796184&r2=1796185&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/ProcessBeanAttributes.java
(original)
+++ geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/ProcessBeanAttributes.java
Thu May 25 19:49:10 2017
@@ -59,10 +59,19 @@ public interface ProcessBeanAttributes<T
      */
     void addDefinitionError(Throwable t);
 
+    /**
+     * Usually having a non-static final field with any modifier other than private leads
to a
+     * DeploymentException. This is to prevent user failures as those fields cannot be proxied.
+     *
+     * In certain situations one want's to provide a CDI bean for such a class nonetheless.
+     * By invoking this method on a Bean wich such a class we can effectively prevent the
container
+     * from treating this situation as a Deployment error.
+     */
+    void ignoreFinalMethods();
+
    /**
-    * Creates a bean attributes configurator to configure this bean's attributes.
-    *
-    * @return
+    * @return a bean attributes configurator to configure this bean's attributes.
+    *       It is initialised with the BeanAttributes from the event which gets processed.
     */
     BeanAttributesConfigurator<T> configureBeanAttributes();
 }

Modified: geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/configurator/AnnotatedConstructorConfigurator.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/configurator/AnnotatedConstructorConfigurator.java?rev=1796185&r1=1796184&r2=1796185&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/configurator/AnnotatedConstructorConfigurator.java
(original)
+++ geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/configurator/AnnotatedConstructorConfigurator.java
Thu May 25 19:49:10 2017
@@ -43,27 +43,21 @@ public interface AnnotatedConstructorCon
     AnnotatedConstructorConfigurator<T> add(Annotation annotation);
 
     /**
-     * Clears an instance of the given annotation, checking members.  Ignores nonbinding
annotation members.
-     *
+     * Removes all Annotations which fit the given Predicate
      * @param annotation
-     * @return this
-     */
-    AnnotatedConstructorConfigurator<T> remove(Annotation annotation);
-
-    /**
-     * Clears all annotations of the given type, regardless of members.
-     *
-     * @param annotationType annotation class to remove
-     * @return this
+     * @return self
      */
-    AnnotatedConstructorConfigurator<T> remove(Class<? extends Annotation> annotationType);
+    AnnotatedConstructorConfigurator<T> remove(Predicate<Annotation> annotation);
 
     /**
-     * Clears all annotations
-     *
-     * @return this
+     * removes all Annotations
+     * @return self
      */
-    AnnotatedConstructorConfigurator<T> removeAll();
+    default AnnotatedConstructorConfigurator<T> removeAll()
+    {
+        remove((e) -> true);
+        return this;
+    }
 
     /**
      *
@@ -76,6 +70,11 @@ public interface AnnotatedConstructorCon
     * @param predicate the filter to apply
     * @return a stream representation of the underlying
     */
-    Stream<AnnotatedParameterConfigurator<T>> filterParams(Predicate<AnnotatedParameter<T>>
predicate);
+    default Stream<AnnotatedParameterConfigurator<T>> filterParams(Predicate<AnnotatedParameter<T>>
predicate)
+    {
+        return params()
+                .stream()
+                .filter(ap -> predicate.test(ap.getAnnotated()));
+    }
 
 }

Modified: geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/configurator/AnnotatedFieldConfigurator.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/configurator/AnnotatedFieldConfigurator.java?rev=1796185&r1=1796184&r2=1796185&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/configurator/AnnotatedFieldConfigurator.java
(original)
+++ geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/configurator/AnnotatedFieldConfigurator.java
Thu May 25 19:49:10 2017
@@ -20,8 +20,8 @@
 package javax.enterprise.inject.spi.configurator;
 
 import javax.enterprise.inject.spi.AnnotatedField;
-import javax.enterprise.util.Nonbinding;
 import java.lang.annotation.Annotation;
+import java.util.function.Predicate;
 
 public interface AnnotatedFieldConfigurator<T> {
 
@@ -40,28 +40,20 @@ public interface AnnotatedFieldConfigura
     AnnotatedFieldConfigurator<T> add(Annotation annotation);
 
     /**
-     * Remove annotations with (a) the same type and (b) the same annotation member value
for each member which is not
-     * annotated {@link Nonbinding}. The container calls the {@link Object#equals(Object)}
method of the annotation member value
-     * to compare values.
-     *
-     * @param annotation to remove
+     * Removes all Annotations which fit the given Predicate
+     * @param annotation
      * @return self
      */
-    AnnotatedFieldConfigurator<T> remove(Annotation annotation);
+    AnnotatedFieldConfigurator<T> remove(Predicate<Annotation> annotation);
 
     /**
-     * Removes all annotations with the same type. Annotation members are ignored.
-     *
-     * @param annotationType annotation class to remove
-     * @return self
-     */
-    AnnotatedFieldConfigurator<T> remove(Class<? extends Annotation> annotationType);
-
-    /**
-     * Remove all annotations from the field.
-     *
+     * removes all Annotations
      * @return self
      */
-    AnnotatedFieldConfigurator<T> removeAll();
+    default AnnotatedFieldConfigurator<T> removeAll()
+    {
+        remove((e) -> true);
+        return this;
+    }
 
 }

Modified: geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/configurator/AnnotatedMethodConfigurator.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/configurator/AnnotatedMethodConfigurator.java?rev=1796185&r1=1796184&r2=1796185&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/configurator/AnnotatedMethodConfigurator.java
(original)
+++ geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/configurator/AnnotatedMethodConfigurator.java
Thu May 25 19:49:10 2017
@@ -21,7 +21,6 @@ package javax.enterprise.inject.spi.conf
 
 import javax.enterprise.inject.spi.AnnotatedMethod;
 import javax.enterprise.inject.spi.AnnotatedParameter;
-import javax.enterprise.util.Nonbinding;
 import java.lang.annotation.Annotation;
 import java.util.List;
 import java.util.function.Predicate;
@@ -44,29 +43,21 @@ public interface AnnotatedMethodConfigur
     AnnotatedMethodConfigurator<T> add(Annotation annotation);
 
     /**
-     * Remove annotations with (a) the same type and (b) the same annotation member value
for each member which is not
-     * annotated {@link Nonbinding}. The container calls the {@link Object#equals(Object)}
method of the annotation member value
-     * to compare values.
-     *
-     * @param annotation to remove
+     * Removes all Annotations which fit the given Predicate
+     * @param annotation
      * @return self
      */
-    AnnotatedMethodConfigurator<T> remove(Annotation annotation);
+    AnnotatedMethodConfigurator<T> remove(Predicate<Annotation> annotation);
 
     /**
-     * Removes all annotations with the same type. Annotation members are ignored.
-     *
-     * @param annotationType annotation class to remove
-     * @return self
-     */
-    AnnotatedMethodConfigurator<T> remove(Class<? extends Annotation> annotationType);
-
-    /**
-     * Remove all annotations from the method.
-     *
+     * removes all Annotations
      * @return self
      */
-    AnnotatedMethodConfigurator<T> removeAll();
+    default AnnotatedMethodConfigurator<T> removeAll()
+    {
+        remove((e) -> true);
+        return this;
+    }
 
     /**
      *
@@ -81,6 +72,11 @@ public interface AnnotatedMethodConfigur
      * @return a sequence of {@link AnnotatedParameterConfigurator}s matching the given predicate
      * @see AnnotatedParameterConfigurator#getAnnotated()
      */
-    Stream<AnnotatedParameterConfigurator<T>> filterParams(Predicate<AnnotatedParameter<T>>
predicate);
+    default Stream<AnnotatedParameterConfigurator<T>> filterParams(Predicate<AnnotatedParameter<T>>
predicate)
+    {
+        return params()
+                .stream()
+                .filter(ap -> predicate.test(ap.getAnnotated()));
+    }
 
 }
\ No newline at end of file

Modified: geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/configurator/AnnotatedParameterConfigurator.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/configurator/AnnotatedParameterConfigurator.java?rev=1796185&r1=1796184&r2=1796185&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/configurator/AnnotatedParameterConfigurator.java
(original)
+++ geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/configurator/AnnotatedParameterConfigurator.java
Thu May 25 19:49:10 2017
@@ -20,6 +20,7 @@
 package javax.enterprise.inject.spi.configurator;
 
 import java.lang.annotation.Annotation;
+import java.util.function.Predicate;
 
 import javax.enterprise.inject.spi.AnnotatedParameter;
 
@@ -35,28 +36,25 @@ public interface AnnotatedParameterConfi
      * Adds an instance of the given annotation to the parameter.
      *
      * @param annotation
-     * @return
+     * @return self
      */
     AnnotatedParameterConfigurator<T> add(Annotation annotation);
 
     /**
-     * Removes
+     * Removes all Annotations which fit the given Predicate
      * @param annotation
-     * @return
+     * @return self
      */
-    AnnotatedParameterConfigurator<T> remove(Annotation annotation);
+    AnnotatedParameterConfigurator<T> remove(Predicate<Annotation> annotation);
 
     /**
-     *
-     * @param annotationType
-     * @return
-     */
-    AnnotatedParameterConfigurator<T> remove(Class<? extends Annotation> annotationType);
-
-    /**
-     * Clears
-     * @return
+     * removes all Annotations
+     * @return self
      */
-    AnnotatedParameterConfigurator<T> removeAll();
+    default AnnotatedParameterConfigurator<T> removeAll()
+    {
+        remove((e) -> true);
+        return this;
+    }
 
 }
\ No newline at end of file

Modified: geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/configurator/AnnotatedTypeConfigurator.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/configurator/AnnotatedTypeConfigurator.java?rev=1796185&r1=1796184&r2=1796185&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/configurator/AnnotatedTypeConfigurator.java
(original)
+++ geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/configurator/AnnotatedTypeConfigurator.java
Thu May 25 19:49:10 2017
@@ -23,7 +23,6 @@ import javax.enterprise.inject.spi.Annot
 import javax.enterprise.inject.spi.AnnotatedField;
 import javax.enterprise.inject.spi.AnnotatedMethod;
 import javax.enterprise.inject.spi.AnnotatedType;
-import javax.enterprise.util.Nonbinding;
 import java.lang.annotation.Annotation;
 import java.util.Set;
 import java.util.function.Predicate;
@@ -46,29 +45,21 @@ public interface AnnotatedTypeConfigurat
     AnnotatedTypeConfigurator<T> add(Annotation annotation);
 
     /**
-     * Remove annotations with (a) the same type and (b) the same annotation member value
for each member which is not
-     * annotated {@link Nonbinding}. The container calls the {@link Object#equals(Object)}
method of the annotation member value
-     * to compare values.
-     *
-     * @param annotation to remove
-     * @return self
-     */
-    AnnotatedTypeConfigurator<T> remove(Annotation annotation);
-
-    /**
-     * Removes all annotations with the same type. Annotation members are ignored.
-     *
-     * @param annotationType annotation class to remove
+     * Remove all annotations which fit the given Predicate.
      * @return self
      */
-    AnnotatedTypeConfigurator<T> remove(Class<? extends Annotation> annotationType);
+    AnnotatedTypeConfigurator<T> remove(Predicate<Annotation> predicate);
 
     /**
      * Remove all annotations from the type.
      *
      * @return self
      */
-    AnnotatedTypeConfigurator<T> removeAll();
+    default AnnotatedTypeConfigurator<T> removeAll()
+    {
+        remove((e) -> true);
+        return this;
+    }
 
     /**
      *

Modified: geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/configurator/BeanAttributesConfigurator.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/configurator/BeanAttributesConfigurator.java?rev=1796185&r1=1796184&r2=1796185&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/configurator/BeanAttributesConfigurator.java
(original)
+++ geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/configurator/BeanAttributesConfigurator.java
Thu May 25 19:49:10 2017
@@ -19,39 +19,12 @@
 
 package javax.enterprise.inject.spi.configurator;
 
-import javax.enterprise.inject.spi.AnnotatedMember;
-import javax.enterprise.inject.spi.AnnotatedType;
-import javax.enterprise.inject.spi.BeanAttributes;
 import javax.enterprise.util.TypeLiteral;
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Type;
 import java.util.Set;
 
 public interface BeanAttributesConfigurator<T> {
-    /**
-     * Read the information from the given {@link AnnotatedType}. All relevant information
is overwritten.
-     *
-     * @param type AnnotatedType to read information from
-     * @return self
-     */
-    <U extends T> BeanAttributesConfigurator<U> read(AnnotatedType<U> type);
-
-    /**
-     * Read the information from the given {@link AnnotatedMember} (field or method).
-     * All relevant information is overwritten.
-     *
-     * @param member AnnotatedMember to read information from
-     * @return self
-     */
-    <U extends T> BeanAttributesConfigurator<U> read(AnnotatedMember<U>
member);
-
-    /**
-     * Read the information from the given bean attributes. All relevant information is overwritten.
-     *
-     * @param beanAttributes beanAttributes to read information from
-     * @return self
-     */
-    BeanAttributesConfigurator<T> read(BeanAttributes<?> beanAttributes);
 
     /**
      *

Modified: geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/configurator/BeanConfigurator.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/configurator/BeanConfigurator.java?rev=1796185&r1=1796184&r2=1796185&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/configurator/BeanConfigurator.java
(original)
+++ geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/configurator/BeanConfigurator.java
Thu May 25 19:49:10 2017
@@ -30,9 +30,7 @@ import java.lang.annotation.Annotation;
 import java.lang.reflect.Type;
 import java.util.Set;
 import java.util.function.BiConsumer;
-import java.util.function.Consumer;
 import java.util.function.Function;
-import java.util.function.Supplier;
 
 public interface BeanConfigurator<T> {
 
@@ -113,24 +111,6 @@ public interface BeanConfigurator<T> {
     <U extends T> BeanConfigurator<U> createWith(Function<CreationalContext<U>,
U> callback);
 
     /**
-     *
-     * Set a {@link Supplier} to create a bean instance
-     *
-     *
-     * @param callback the Supplier to create the instance
-     * @return self
-     */
-    <U extends T> BeanConfigurator<U> produceWith(Supplier<U> callback);
-
-    /**
-     * Set a {@link Function} to create a bean instance from an {@link Instance}
-     *
-     * @param callback the function to create the instance
-     * @return self
-     */
-    <U extends T> BeanConfigurator<U> produceWith(Function<Instance<Object>,
U> callback);
-
-    /**
      * A shortcut for {@code produceWith(() -> existing} where {@code existing} represents
an instance whose lifecycle is not managed by CDI.
      *
      * @param instance use as produced instance for the configured bean
@@ -150,13 +130,13 @@ public interface BeanConfigurator<T> {
 
     /**
      *
-     * Set a {@link Consumer} to destroy a bean instance.
+     * Set a {@link BiConsumer} to destroy a bean instance.
      * If no dispose callback is specified, a NOOP dispose callback is automatically set.
      *
      * @param callback the Consumer to dispose the instance
      * @return self
      */
-    BeanConfigurator<T> disposeWith(Consumer<T> callback);
+    BeanConfigurator<T> disposeWith(BiConsumer<T, Instance<Object>> callback);
 
     /**
      * Read the information from the given annotated type. All relevant information is overwritten.

Modified: geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/configurator/InjectionPointConfigurator.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/configurator/InjectionPointConfigurator.java?rev=1796185&r1=1796184&r2=1796185&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/configurator/InjectionPointConfigurator.java
(original)
+++ geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/configurator/InjectionPointConfigurator.java
Thu May 25 19:49:10 2017
@@ -19,64 +19,13 @@
 
 package javax.enterprise.inject.spi.configurator;
 
-import javax.enterprise.inject.spi.AnnotatedField;
-import javax.enterprise.inject.spi.AnnotatedParameter;
-import javax.enterprise.inject.spi.Bean;
-import javax.enterprise.inject.spi.InjectionPoint;
 import java.lang.annotation.Annotation;
-import java.lang.reflect.Field;
-import java.lang.reflect.Parameter;
 import java.lang.reflect.Type;
 import java.util.Set;
 
 public interface InjectionPointConfigurator {
 
     /**
-     * Read the InjectionPoint information from the given {@link Field}.
-     * All relevant information is overwritten.
-     *
-     * @param field defining the InjectionPoint.
-     * @return self
-     */
-    InjectionPointConfigurator read(Field field);
-
-    /**
-     * Read the InjectionPoint information from the given {@link Parameter}.
-     * All relevant information is overwritten.
-     *
-     * @param param  the parameter defining the InjectionPoint
-     * @return self
-     */
-    InjectionPointConfigurator read(Parameter param);
-
-    /**
-     * Read the InjectionPoint information from the given {@link AnnotatedField}.
-     * All relevant information is overwritten.
-     *
-     * @param field defining the InjectionPoint
-     * @return self
-     */
-    InjectionPointConfigurator read(AnnotatedField<?> field);
-
-    /**
-     * Read the InjectionPoint information from the given {@link AnnotatedParameter}.
-     * All relevant information is overwritten.
-     *
-     * @param param defining the InjectionPoint
-     * @return self
-     */
-    InjectionPointConfigurator read(AnnotatedParameter<?> param);
-
-    /**
-     * Read the InjectionPoint information from the given {@link InjectionPoint}.
-     * All relevant information is overwritten.
-     *
-     * @param injectionPoint the InjectionPoint to get information from
-     * @return self
-     */
-    InjectionPointConfigurator read(InjectionPoint injectionPoint);
-
-    /**
      * Set the required {@link Type} (that will be used during typesafe resolution)
      * of the InjectionPoint to build.
      *
@@ -129,15 +78,6 @@ public interface InjectionPointConfigura
     InjectionPointConfigurator qualifiers(Set<Annotation> qualifiers);
 
     /**
-     * Set the {@link javax.enterprise.inject.spi.Bean} object representing the bean that
defines the injection point. If the
-     * injection point does not belong to a bean, return a null value.
-     *
-     * @param bean the bean for this configured InjectionPoint
-     * @return self
-     */
-    InjectionPointConfigurator bean(Bean<?> bean);
-
-    /**
      *
      * Change the delegate status of the built InjectionPoint.
      * By default the InjectionPoint is not a delegate one.

Modified: geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/configurator/ObserverMethodConfigurator.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/configurator/ObserverMethodConfigurator.java?rev=1796185&r1=1796184&r2=1796185&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/configurator/ObserverMethodConfigurator.java
(original)
+++ geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/configurator/ObserverMethodConfigurator.java
Thu May 25 19:49:10 2017
@@ -22,14 +22,12 @@ package javax.enterprise.inject.spi.conf
 import javax.enterprise.event.Reception;
 import javax.enterprise.event.TransactionPhase;
 import javax.enterprise.inject.spi.AnnotatedMethod;
-import javax.enterprise.inject.spi.EventMetadata;
+import javax.enterprise.inject.spi.EventContext;
 import javax.enterprise.inject.spi.ObserverMethod;
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Method;
 import java.lang.reflect.Type;
 import java.util.Set;
-import java.util.function.BiConsumer;
-import java.util.function.Consumer;
 
 public interface ObserverMethodConfigurator<T> {
 
@@ -144,22 +142,24 @@ public interface ObserverMethodConfigura
      * @param callback to call for the event notification
      * @return self
      */
-    ObserverMethodConfigurator<T> notifyWith(Consumer<T> callback);
+    ObserverMethodConfigurator<T> notifyWith(EventConsumer<T> callback);
 
     /**
-     * Defines a BiConsumer to call when event is notified
+     * Allows modification of the asynchronous status of the observer to build.
      *
-     * @param callback a BiConsumer taking an event type and an EventMetadata as type parameters
+     * @param async async status
      * @return self
      */
-    ObserverMethodConfigurator<T> notifyWith(BiConsumer<T, EventMetadata> callback);
+    ObserverMethodConfigurator<T> async(boolean async);
 
     /**
-     * Allows modification of the asynchronous status of the observer to build.
      *
-     * @param async async status
-     * @return self
+     * @param <T> type of the event
      */
-    ObserverMethodConfigurator<T> async(boolean async);
+    @FunctionalInterface
+    interface EventConsumer<T>
+    {
+        void accept(EventContext<T> eventContext) throws Exception;
+    }
 }
 



Mime
View raw message