openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1797990 - in /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans: config/ configurator/ portable/ portable/events/ portable/events/discovery/
Date Wed, 07 Jun 2017 19:37:08 GMT
Author: struberg
Date: Wed Jun  7 19:37:07 2017
New Revision: 1797990

URL: http://svn.apache.org/viewvc?rev=1797990&view=rev
Log:
OWB-1189 store back the AT modified via Configurator

Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/configurator/AnnotatedConstructorConfiguratorImpl.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/configurator/AnnotatedMethodConfiguratorImpl.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/configurator/AnnotatedParameterConfiguratorImpl.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/configurator/AnnotatedTypeConfiguratorImpl.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/AnnotatedConstructorImpl.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/AnnotatedMethodImpl.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/AnnotatedParameterImpl.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/AnnotatedTypeImpl.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/ProcessAnnotatedTypeImpl.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/discovery/AfterTypeDiscoveryImpl.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/discovery/AnnotatedTypeConfiguratorHolder.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/discovery/BeforeBeanDiscoveryImpl.java

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java?rev=1797990&r1=1797989&r2=1797990&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java
Wed Jun  7 19:37:07 2017
@@ -38,6 +38,7 @@ import org.apache.webbeans.component.cre
 import org.apache.webbeans.component.creation.ObserverMethodsBuilder;
 import org.apache.webbeans.component.creation.ProducerFieldBeansBuilder;
 import org.apache.webbeans.component.creation.ProducerMethodBeansBuilder;
+import org.apache.webbeans.configurator.AnnotatedTypeConfiguratorImpl;
 import org.apache.webbeans.container.BeanManagerImpl;
 import org.apache.webbeans.container.InjectableBeanManager;
 import org.apache.webbeans.container.InjectionResolver;
@@ -104,7 +105,6 @@ import javax.enterprise.inject.spi.Injec
 import javax.enterprise.inject.spi.Interceptor;
 import javax.enterprise.inject.spi.ObserverMethod;
 import javax.enterprise.inject.spi.Producer;
-import javax.enterprise.inject.spi.configurator.AnnotatedTypeConfigurator;
 
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Constructor;
@@ -731,18 +731,18 @@ public class BeansDeployer
         {
             manager.addAdditionalAnnotatedType(
                 holder.getExtension(),
-                holder.getAnnotatedTypeConfigurator().getAnnotated(),
+                holder.getAnnotatedTypeConfigurator().getNewAnnotatedType(),
                 holder.getId());
         }
 
-        for (AnnotatedTypeConfigurator<?> interceptorATC : event.getInterceptorBindingConfigurators())
+        for (AnnotatedTypeConfiguratorImpl<?> interceptorATC : event.getInterceptorBindingConfigurators())
         {
-            webBeansContext.getInterceptorsManager().addInterceptorBindingType((AnnotatedType)
interceptorATC.getAnnotated());
+            webBeansContext.getInterceptorsManager().addInterceptorBindingType((AnnotatedType)
interceptorATC.getNewAnnotatedType());
         }
 
-        for (AnnotatedTypeConfigurator<?> qualifierAt : event.getQualifierConfigurators())
+        for (AnnotatedTypeConfiguratorImpl<?> qualifierAt : event.getQualifierConfigurators())
         {
-            webBeansContext.getBeanManagerImpl().addAdditionalQualifier((AnnotatedType) qualifierAt.getAnnotated());
+            webBeansContext.getBeanManagerImpl().addAdditionalQualifier((AnnotatedType) qualifierAt.getNewAnnotatedType());
 
         }
 
@@ -793,7 +793,7 @@ public class BeansDeployer
 
         for (AnnotatedTypeConfiguratorHolder holder : event.getAnnotatedTypeConfigurators())
         {
-            AnnotatedType<?> at = holder.getAnnotatedTypeConfigurator().getAnnotated();
+            AnnotatedType<?> at = holder.getAnnotatedTypeConfigurator().getNewAnnotatedType();
             manager.addAdditionalAnnotatedType(
                 holder.getExtension(),
                 at,

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/configurator/AnnotatedConstructorConfiguratorImpl.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/configurator/AnnotatedConstructorConfiguratorImpl.java?rev=1797990&r1=1797989&r2=1797990&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/configurator/AnnotatedConstructorConfiguratorImpl.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/configurator/AnnotatedConstructorConfiguratorImpl.java
Wed Jun  7 19:37:07 2017
@@ -24,43 +24,55 @@ import javax.enterprise.inject.spi.confi
 import java.lang.annotation.Annotation;
 import java.util.List;
 import java.util.function.Predicate;
-import java.util.stream.Stream;
+import java.util.stream.Collectors;
+
+import org.apache.webbeans.portable.AnnotatedConstructorImpl;
 
 public class AnnotatedConstructorConfiguratorImpl<T> implements AnnotatedConstructorConfigurator<T>
 {
+    private final AnnotatedConstructorImpl<T> annotatedConstructor;
+    private final List<AnnotatedParameterConfigurator<T>> annotatedParameterConfigurators;
+
+
+    public AnnotatedConstructorConfiguratorImpl(AnnotatedConstructorImpl<T> annotatedConstructor)
+    {
+        this.annotatedConstructor = annotatedConstructor;
+
+        annotatedParameterConfigurators = annotatedConstructor.getParameters().stream()
+            .map(m -> new AnnotatedParameterConfiguratorImpl<>(m))
+            .collect(Collectors.toList());
+    }
+
     @Override
     public AnnotatedConstructor<T> getAnnotated()
     {
-        throw new UnsupportedOperationException("TODO implement CDI 2.0");
+        return annotatedConstructor;
     }
 
     @Override
     public AnnotatedConstructorConfigurator<T> add(Annotation annotation)
     {
-        throw new UnsupportedOperationException("TODO implement CDI 2.0");
+        annotatedConstructor.addAnnotation(annotation);
+        return this;
     }
 
     @Override
-    public AnnotatedConstructorConfigurator<T> remove(Predicate annotation)
+    public AnnotatedConstructorConfigurator<T> remove(Predicate predicate)
     {
-        throw new UnsupportedOperationException("TODO implement CDI 2.0");
+        annotatedConstructor.getAnnotations().removeIf(predicate);
+        return this;
     }
 
     @Override
     public AnnotatedConstructorConfigurator<T> removeAll()
     {
-        throw new UnsupportedOperationException("TODO implement CDI 2.0");
+        annotatedConstructor.getAnnotations().clear();
+        return this;
     }
 
     @Override
     public List<AnnotatedParameterConfigurator<T>> params()
     {
-        throw new UnsupportedOperationException("TODO implement CDI 2.0");
-    }
-
-    @Override
-    public Stream<AnnotatedParameterConfigurator<T>> filterParams(Predicate predicate)
-    {
-        throw new UnsupportedOperationException("TODO implement CDI 2.0");
+        return annotatedParameterConfigurators;
     }
 }

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/configurator/AnnotatedMethodConfiguratorImpl.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/configurator/AnnotatedMethodConfiguratorImpl.java?rev=1797990&r1=1797989&r2=1797990&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/configurator/AnnotatedMethodConfiguratorImpl.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/configurator/AnnotatedMethodConfiguratorImpl.java
Wed Jun  7 19:37:07 2017
@@ -24,6 +24,7 @@ import javax.enterprise.inject.spi.confi
 import java.lang.annotation.Annotation;
 import java.util.List;
 import java.util.function.Predicate;
+import java.util.stream.Collectors;
 
 import org.apache.webbeans.portable.AnnotatedMethodImpl;
 
@@ -32,9 +33,15 @@ public class AnnotatedMethodConfigurator
 {
     private final AnnotatedMethodImpl<T> annotatedMethod;
 
+    private final List<AnnotatedParameterConfigurator<T>> annotatedParameterConfigurators;
+
     public AnnotatedMethodConfiguratorImpl(AnnotatedMethodImpl<T> annotatedMethod)
     {
         this.annotatedMethod = annotatedMethod;
+
+        annotatedParameterConfigurators = annotatedMethod.getParameters().stream()
+            .map(m -> new AnnotatedParameterConfiguratorImpl<>(m))
+            .collect(Collectors.toList());
     }
 
     @Override
@@ -67,7 +74,7 @@ public class AnnotatedMethodConfigurator
     @Override
     public List<AnnotatedParameterConfigurator<T>> params()
     {
-        throw new UnsupportedOperationException("TODO implement CDI 2.0");
+        return annotatedParameterConfigurators;
     }
 
 }

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/configurator/AnnotatedParameterConfiguratorImpl.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/configurator/AnnotatedParameterConfiguratorImpl.java?rev=1797990&r1=1797989&r2=1797990&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/configurator/AnnotatedParameterConfiguratorImpl.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/configurator/AnnotatedParameterConfiguratorImpl.java
Wed Jun  7 19:37:07 2017
@@ -25,27 +25,37 @@ import java.util.function.Predicate;
 
 public class AnnotatedParameterConfiguratorImpl<T> implements AnnotatedParameterConfigurator<T>
 {
+    private final AnnotatedParameter<T> annotatedParameter;
+
+    public AnnotatedParameterConfiguratorImpl(AnnotatedParameter<T> annotatedParameter)
+    {
+        this.annotatedParameter = annotatedParameter;
+    }
+
     @Override
     public AnnotatedParameter<T> getAnnotated()
     {
-        throw new UnsupportedOperationException("TODO implement CDI 2.0");
+        return annotatedParameter;
     }
 
     @Override
     public AnnotatedParameterConfigurator<T> add(Annotation annotation)
     {
-        throw new UnsupportedOperationException("TODO implement CDI 2.0");
+        annotatedParameter.getAnnotations().add(annotation);
+        return this;
     }
 
     @Override
-    public AnnotatedParameterConfigurator<T> remove(Predicate annotation)
+    public AnnotatedParameterConfigurator<T> remove(Predicate predicate)
     {
-        throw new UnsupportedOperationException("TODO implement CDI 2.0");
+        annotatedParameter.getAnnotations().removeIf(predicate);
+        return this;
     }
 
     @Override
     public AnnotatedParameterConfigurator<T> removeAll()
     {
-        throw new UnsupportedOperationException("TODO implement CDI 2.0");
+        annotatedParameter.getAnnotations().clear();
+        return this;
     }
 }

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/configurator/AnnotatedTypeConfiguratorImpl.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/configurator/AnnotatedTypeConfiguratorImpl.java?rev=1797990&r1=1797989&r2=1797990&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/configurator/AnnotatedTypeConfiguratorImpl.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/configurator/AnnotatedTypeConfiguratorImpl.java
Wed Jun  7 19:37:07 2017
@@ -19,6 +19,7 @@
 package org.apache.webbeans.configurator;
 
 import org.apache.webbeans.config.WebBeansContext;
+import org.apache.webbeans.portable.AnnotatedConstructorImpl;
 import org.apache.webbeans.portable.AnnotatedFieldImpl;
 import org.apache.webbeans.portable.AnnotatedMethodImpl;
 import org.apache.webbeans.portable.AnnotatedTypeImpl;
@@ -36,20 +37,27 @@ import java.util.stream.Collectors;
 public class AnnotatedTypeConfiguratorImpl<T> implements AnnotatedTypeConfigurator<T>
 {
 
-    private final AnnotatedTypeImpl<T> annotatedType;
+    private final AnnotatedType<T> originalAnnotatedType;
+    private final AnnotatedTypeImpl<T> newAnnotatedType;
+    private Set<AnnotatedConstructorConfigurator<T>> annotatedConstructorConfigurators;
     private Set<AnnotatedMethodConfigurator<? super T>> annotatedMethodConfigurators;
     private Set<AnnotatedFieldConfigurator<? super T>> annotatedFieldConfigurators;
 
 
     public AnnotatedTypeConfiguratorImpl(WebBeansContext webBeansContext, AnnotatedType<T>
originalAnnotatedType)
     {
-        this.annotatedType = new AnnotatedTypeImpl<>(webBeansContext, originalAnnotatedType);
+        this.originalAnnotatedType = originalAnnotatedType;
+        this.newAnnotatedType = new AnnotatedTypeImpl<>(webBeansContext, originalAnnotatedType);
 
-        annotatedMethodConfigurators = annotatedType.getMethods().stream()
+        annotatedConstructorConfigurators = newAnnotatedType.getConstructors().stream()
+            .map(m -> new AnnotatedConstructorConfiguratorImpl<>((AnnotatedConstructorImpl<T>)
m))
+            .collect(Collectors.toSet());
+
+        annotatedMethodConfigurators = newAnnotatedType.getMethods().stream()
             .map(m -> new AnnotatedMethodConfiguratorImpl<>((AnnotatedMethodImpl<T>)
m))
             .collect(Collectors.toSet());
 
-        annotatedFieldConfigurators = annotatedType.getFields().stream()
+        annotatedFieldConfigurators = newAnnotatedType.getFields().stream()
             .map(m -> new AnnotatedFieldConfiguratorImpl<>((AnnotatedFieldImpl<T>)
m))
             .collect(Collectors.toSet());
     }
@@ -58,27 +66,27 @@ public class AnnotatedTypeConfiguratorIm
     @Override
     public AnnotatedType<T> getAnnotated()
     {
-        return annotatedType;
+        return originalAnnotatedType;
     }
 
     @Override
     public AnnotatedTypeConfigurator<T> add(Annotation annotation)
     {
-        annotatedType.addAnnotation(annotation);
+        newAnnotatedType.addAnnotation(annotation);
         return this;
     }
 
     @Override
     public AnnotatedTypeConfigurator<T> remove(Predicate predicate)
     {
-        annotatedType.getAnnotations().removeIf(predicate);
+        newAnnotatedType.getAnnotations().removeIf(predicate);
         return this;
     }
 
     @Override
     public AnnotatedTypeConfigurator<T> removeAll()
     {
-        annotatedType.clearAnnotations();
+        newAnnotatedType.clearAnnotations();
         return this;
     }
 
@@ -97,7 +105,13 @@ public class AnnotatedTypeConfiguratorIm
     @Override
     public Set<AnnotatedConstructorConfigurator<T>> constructors()
     {
-        throw new UnsupportedOperationException("TODO implement CDI 2.0");
+        return annotatedConstructorConfigurators;
+    }
+
+
+    public AnnotatedTypeImpl<T> getNewAnnotatedType()
+    {
+        return newAnnotatedType;
     }
 
 }

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/AnnotatedConstructorImpl.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/AnnotatedConstructorImpl.java?rev=1797990&r1=1797989&r2=1797990&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/AnnotatedConstructorImpl.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/AnnotatedConstructorImpl.java
Wed Jun  7 19:37:07 2017
@@ -28,6 +28,7 @@ import java.util.HashMap;
 import java.util.Map;
 
 import javax.enterprise.inject.spi.AnnotatedConstructor;
+import javax.enterprise.inject.spi.AnnotatedParameter;
 import javax.enterprise.inject.spi.AnnotatedType;
 
 /**
@@ -51,6 +52,17 @@ public class AnnotatedConstructorImpl<X>
         setAnnotatedParameters(GenericsUtil.resolveParameterTypes(declaringType.getJavaClass(),
javaMember), javaMember.getParameterAnnotations());
     }
 
+    public AnnotatedConstructorImpl(WebBeansContext webBeansContext, AnnotatedConstructor<X>
annotatedConstructor, AnnotatedType<X> declaringType)
+    {
+        super(webBeansContext, annotatedConstructor.getBaseType(), annotatedConstructor.getJavaMember(),
declaringType);
+
+        getAnnotations().addAll(annotatedConstructor.getAnnotations());
+        for (AnnotatedParameter<X> annotatedParameter : annotatedConstructor.getParameters())
+        {
+            getParameters().add(new AnnotatedParameterImpl<>(webBeansContext, annotatedParameter.getBaseType(),
this, annotatedParameter.getPosition()));
+        }
+    }
+
     private static Annotation[] findAnnotations(final Constructor<?> javaMember)
     {
         // I really don't like this code, can make thing not respecting java like

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/AnnotatedMethodImpl.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/AnnotatedMethodImpl.java?rev=1797990&r1=1797989&r2=1797990&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/AnnotatedMethodImpl.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/AnnotatedMethodImpl.java
Wed Jun  7 19:37:07 2017
@@ -26,6 +26,7 @@ import java.lang.reflect.Type;
 import java.util.Set;
 
 import javax.enterprise.inject.spi.AnnotatedMethod;
+import javax.enterprise.inject.spi.AnnotatedParameter;
 import javax.enterprise.inject.spi.AnnotatedType;
 
 /**
@@ -54,11 +55,15 @@ public class AnnotatedMethodImpl<X> exte
     /**
      * Copy ct for Configurators
      */
-    public AnnotatedMethodImpl(WebBeansContext webBeansContext, AnnotatedType<X> declaringType,
AnnotatedMethod<X> originalAnnotatedMethod)
+    public AnnotatedMethodImpl(WebBeansContext webBeansContext, AnnotatedMethod<? super
X> originalAnnotatedMethod, AnnotatedType<X> declaringType)
     {
         super(webBeansContext, originalAnnotatedMethod.getBaseType(), originalAnnotatedMethod.getJavaMember(),
declaringType);
 
-        //X TODO copy AnnotatedParameters
+        getAnnotations().addAll(originalAnnotatedMethod.getAnnotations());
+        for (AnnotatedParameter<? super X> annotatedParameter : originalAnnotatedMethod.getParameters())
+        {
+            getParameters().add(new AnnotatedParameterImpl<>(webBeansContext, annotatedParameter.getBaseType(),
this, annotatedParameter.getPosition()));
+        }
     }
 
     @Override

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/AnnotatedParameterImpl.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/AnnotatedParameterImpl.java?rev=1797990&r1=1797989&r2=1797990&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/AnnotatedParameterImpl.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/AnnotatedParameterImpl.java
Wed Jun  7 19:37:07 2017
@@ -32,7 +32,7 @@ import javax.enterprise.inject.spi.Annot
  *
  * @param <X> declaring class info
  */
-class AnnotatedParameterImpl<X> extends AbstractAnnotated implements AnnotatedParameter<X>
+public class AnnotatedParameterImpl<X> extends AbstractAnnotated implements AnnotatedParameter<X>
 {
     /**Declaring callable*/
     private final AnnotatedCallable<X> declaringCallable;

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/AnnotatedTypeImpl.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/AnnotatedTypeImpl.java?rev=1797990&r1=1797989&r2=1797990&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/AnnotatedTypeImpl.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/AnnotatedTypeImpl.java
Wed Jun  7 19:37:07 2017
@@ -298,7 +298,7 @@ public class AnnotatedTypeImpl<X>
         private State(State otherState)
         {
             constructors = otherState.constructors.stream()
-                .map(af -> new AnnotatedConstructorImpl<>(getWebBeansContext(),
af.getJavaMember(), AnnotatedTypeImpl.this))
+                .map(ac -> new AnnotatedConstructorImpl<>(getWebBeansContext(),
ac, AnnotatedTypeImpl.this))
                 .collect(Collectors.toSet());
 
             fields = otherState.fields.stream()
@@ -306,7 +306,7 @@ public class AnnotatedTypeImpl<X>
                 .collect(Collectors.toSet());
 
             methods = otherState.methods.stream()
-                .map(af -> new AnnotatedMethodImpl<>(getWebBeansContext(), af.getJavaMember(),
AnnotatedTypeImpl.this))
+                .map(am -> new AnnotatedMethodImpl<>(getWebBeansContext(), am, AnnotatedTypeImpl.this))
                 .collect(Collectors.toSet());
         }
     }

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/ProcessAnnotatedTypeImpl.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/ProcessAnnotatedTypeImpl.java?rev=1797990&r1=1797989&r2=1797990&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/ProcessAnnotatedTypeImpl.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/ProcessAnnotatedTypeImpl.java
Wed Jun  7 19:37:07 2017
@@ -49,7 +49,10 @@ public class ProcessAnnotatedTypeImpl<X>
      */
     private boolean modifiedAnnotatedType = false;
 
-    private AnnotatedTypeConfiguratorImpl configurator;
+    /**
+     * Gets set when one makes use the AnnotatedTypeConfigurator
+     */
+    private AnnotatedTypeConfiguratorImpl configurator = null;
 
     /**
      * Creates a new instance with the given annotated type.
@@ -76,7 +79,7 @@ public class ProcessAnnotatedTypeImpl<X>
         }
         else
         {
-            return configurator.getAnnotated();
+            return configurator.getNewAnnotatedType();
         }
     }
 
@@ -102,7 +105,7 @@ public class ProcessAnnotatedTypeImpl<X>
      */
     public boolean isModifiedAnnotatedType()
     {
-        return modifiedAnnotatedType;
+        return modifiedAnnotatedType || configurator != null;
     }
 
     /**

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/discovery/AfterTypeDiscoveryImpl.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/discovery/AfterTypeDiscoveryImpl.java?rev=1797990&r1=1797989&r2=1797990&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/discovery/AfterTypeDiscoveryImpl.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/discovery/AfterTypeDiscoveryImpl.java
Wed Jun  7 19:37:07 2017
@@ -95,7 +95,7 @@ public class AfterTypeDiscoveryImpl exte
         AnnotatedTypeConfiguratorHolder configuratorHolder = annotatedTypeConfigurators.get(key);
         if (configuratorHolder == null)
         {
-            AnnotatedTypeConfigurator<T> configurator = getAnnotatedTypeConfigurator(clazz);
+            AnnotatedTypeConfiguratorImpl<T> configurator = getAnnotatedTypeConfigurator(clazz);
             configuratorHolder = new AnnotatedTypeConfiguratorHolder(extension, id, configurator);
             annotatedTypeConfigurators.put(key, configuratorHolder);
         }
@@ -114,9 +114,9 @@ public class AfterTypeDiscoveryImpl exte
         return annotatedTypeConfigurators.values();
     }
 
-    private <T> AnnotatedTypeConfigurator<T> getAnnotatedTypeConfigurator(Class<T>
clazz)
+    private <T> AnnotatedTypeConfiguratorImpl<T> getAnnotatedTypeConfigurator(Class<T>
clazz)
     {
         AnnotatedType<T> initialAnnotatedType = webBeansContext.getAnnotatedElementFactory().newAnnotatedType(clazz);
-        return (AnnotatedTypeConfigurator<T>) new AnnotatedTypeConfiguratorImpl(webBeansContext,
initialAnnotatedType);
+        return (AnnotatedTypeConfiguratorImpl<T>) new AnnotatedTypeConfiguratorImpl(webBeansContext,
initialAnnotatedType);
     }
 }

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/discovery/AnnotatedTypeConfiguratorHolder.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/discovery/AnnotatedTypeConfiguratorHolder.java?rev=1797990&r1=1797989&r2=1797990&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/discovery/AnnotatedTypeConfiguratorHolder.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/discovery/AnnotatedTypeConfiguratorHolder.java
Wed Jun  7 19:37:07 2017
@@ -19,19 +19,20 @@
 package org.apache.webbeans.portable.events.discovery;
 
 import javax.enterprise.inject.spi.Extension;
-import javax.enterprise.inject.spi.configurator.AnnotatedTypeConfigurator;
+
+import org.apache.webbeans.configurator.AnnotatedTypeConfiguratorImpl;
 
 /**
  * Hold information for lifecycle Events which can modify or add multiple
- * {@link AnnotatedTypeConfigurator}
+ * {@link javax.enterprise.inject.spi.configurator.AnnotatedTypeConfigurator}
  */
 public class AnnotatedTypeConfiguratorHolder<T>
 {
     private final Extension extension;
     private final String id;
-    private final AnnotatedTypeConfigurator<T> annotatedTypeConfigurator;
+    private final AnnotatedTypeConfiguratorImpl<T> annotatedTypeConfigurator;
 
-    public AnnotatedTypeConfiguratorHolder(Extension extension, String id, AnnotatedTypeConfigurator<T>
annotatedTypeConfigurator)
+    public AnnotatedTypeConfiguratorHolder(Extension extension, String id, AnnotatedTypeConfiguratorImpl<T>
annotatedTypeConfigurator)
     {
         this.extension = extension;
         this.id = id;
@@ -48,7 +49,7 @@ public class AnnotatedTypeConfiguratorHo
         return id;
     }
 
-    public AnnotatedTypeConfigurator<T> getAnnotatedTypeConfigurator()
+    public AnnotatedTypeConfiguratorImpl<T> getAnnotatedTypeConfigurator()
     {
         return annotatedTypeConfigurator;
     }

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/discovery/BeforeBeanDiscoveryImpl.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/discovery/BeforeBeanDiscoveryImpl.java?rev=1797990&r1=1797989&r2=1797990&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/discovery/BeforeBeanDiscoveryImpl.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/discovery/BeforeBeanDiscoveryImpl.java
Wed Jun  7 19:37:07 2017
@@ -50,8 +50,8 @@ public class BeforeBeanDiscoveryImpl ext
     private final WebBeansContext webBeansContext;
     private Extension extension;
     private Map<String, AnnotatedTypeConfiguratorHolder> annotatedTypeConfigurators
= new HashMap<>();
-    private Set<AnnotatedTypeConfigurator<?>> interceptorBindingConfigurators
= new HashSet<>();
-    private Set<AnnotatedTypeConfigurator<?>> qualifierConfigurators = new HashSet<>();
+    private Set<AnnotatedTypeConfiguratorImpl<?>> interceptorBindingConfigurators
= new HashSet<>();
+    private Set<AnnotatedTypeConfiguratorImpl<?>> qualifierConfigurators = new
HashSet<>();
 
     public BeforeBeanDiscoveryImpl(WebBeansContext webBeansContext)
     {
@@ -135,7 +135,7 @@ public class BeforeBeanDiscoveryImpl ext
         AnnotatedTypeConfiguratorHolder configuratorHolder = annotatedTypeConfigurators.get(key);
         if (configuratorHolder == null)
         {
-            AnnotatedTypeConfigurator<T> configurator = getAnnotatedTypeConfigurator(clazz);
+            AnnotatedTypeConfiguratorImpl<T> configurator = getAnnotatedTypeConfigurator(clazz);
             configuratorHolder = new AnnotatedTypeConfiguratorHolder(extension, id, configurator);
             annotatedTypeConfigurators.put(key, configuratorHolder);
         }
@@ -148,7 +148,7 @@ public class BeforeBeanDiscoveryImpl ext
     {
         checkState();
 
-        AnnotatedTypeConfigurator<T> configurator = getAnnotatedTypeConfigurator(clazz);
+        AnnotatedTypeConfiguratorImpl<T> configurator = getAnnotatedTypeConfigurator(clazz);
         interceptorBindingConfigurators.add(configurator);
 
         return configurator;
@@ -159,7 +159,7 @@ public class BeforeBeanDiscoveryImpl ext
     {
         checkState();
 
-        AnnotatedTypeConfigurator<T> configurator = getAnnotatedTypeConfigurator(clazz);
+        AnnotatedTypeConfiguratorImpl<T> configurator = getAnnotatedTypeConfigurator(clazz);
         qualifierConfigurators.add(configurator);
 
         return configurator;
@@ -196,19 +196,19 @@ public class BeforeBeanDiscoveryImpl ext
         return annotatedTypeConfigurators.values();
     }
 
-    public Collection<AnnotatedTypeConfigurator<?>> getInterceptorBindingConfigurators()
+    public Collection<AnnotatedTypeConfiguratorImpl<?>> getInterceptorBindingConfigurators()
     {
         return interceptorBindingConfigurators;
     }
 
-    public Collection<AnnotatedTypeConfigurator<?>> getQualifierConfigurators()
+    public Collection<AnnotatedTypeConfiguratorImpl<?>> getQualifierConfigurators()
     {
         return qualifierConfigurators;
     }
 
-    private <T> AnnotatedTypeConfigurator<T> getAnnotatedTypeConfigurator(Class<T>
clazz)
+    private <T> AnnotatedTypeConfiguratorImpl<T> getAnnotatedTypeConfigurator(Class<T>
clazz)
     {
         AnnotatedType<T> initialAnnotatedType = webBeansContext.getAnnotatedElementFactory().newAnnotatedType(clazz);
-        return (AnnotatedTypeConfigurator<T>) new AnnotatedTypeConfiguratorImpl(webBeansContext,
initialAnnotatedType);
+        return (AnnotatedTypeConfiguratorImpl<T>) new AnnotatedTypeConfiguratorImpl(webBeansContext,
initialAnnotatedType);
     }
 }



Mime
View raw message