openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r1429007 - in /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans: component/creation/ config/ util/
Date Fri, 04 Jan 2013 18:05:03 GMT
Author: arne
Date: Fri Jan  4 18:05:03 2013
New Revision: 1429007

URL: http://svn.apache.org/viewvc?rev=1429007&view=rev
Log:
OWB-745: Removed DefinitionUtil.defineInjectedMethods

Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/AbstractInjectedTargetBeanCreator.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/DefinitionUtil.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/ManagedBeanConfigurator.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansAnnotatedTypeUtil.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/AbstractInjectedTargetBeanCreator.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/AbstractInjectedTargetBeanCreator.java?rev=1429007&r1=1429006&r2=1429007&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/AbstractInjectedTargetBeanCreator.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/AbstractInjectedTargetBeanCreator.java
Fri Jan  4 18:05:03 2013
@@ -72,16 +72,7 @@ public abstract class AbstractInjectedTa
      */
     public void defineInjectedMethods()
     {
-        AbstractInjectionTargetBean bean = getBean();
-        if(isDefaultMetaDataProvider())
-        {
-            bean.getWebBeansContext().getDefinitionUtil().defineInjectedMethods(bean);
-        }
-        else
-        {
-            bean.getWebBeansContext().getAnnotatedTypeUtil().defineInjectedMethods(bean,
getAnnotatedType());
-        }
-        
+        webBeansContext.getAnnotatedTypeUtil().defineInjectedMethods(getBean(), getAnnotatedType());
     }
 
     /**

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/DefinitionUtil.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/DefinitionUtil.java?rev=1429007&r1=1429006&r2=1429007&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/DefinitionUtil.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/DefinitionUtil.java
Fri Jan  4 18:05:03 2013
@@ -26,7 +26,6 @@ import java.lang.reflect.Method;
 import java.lang.reflect.Modifier;
 import java.lang.reflect.ParameterizedType;
 import java.lang.reflect.Type;
-import java.lang.reflect.TypeVariable;
 import java.util.ArrayList;
 import java.util.HashSet;
 import java.util.Iterator;
@@ -829,122 +828,6 @@ public final class DefinitionUtil
         return component;
     }
 
-    public <T> void defineInjectedMethods(AbstractInjectionTargetBean<T> bean)
-    {
-        Asserts.assertNotNull(bean, "bean parameter can not be null");
-
-        Class<T> clazz = bean.getReturnType();
-
-        // From bean class definition
-        defineInternalInjectedMethods(bean, clazz, false);
-
-        // From inheritance hierarchy
-        defineInternalInjectedMethodsRecursively(bean, clazz);
-    }
-
-    public <T> void defineInternalInjectedMethodsRecursively(AbstractInjectionTargetBean<T>
component, Class<T> clazz)
-    {
-        // From inheritance
-        Class<?> superClazz = clazz.getSuperclass();
-        if (!superClazz.equals(Object.class))
-        {
-            // From super class
-            defineInternalInjectedMethods(component, (Class<T>) superClazz, true);
-
-            // From super class type hierarchy
-            defineInternalInjectedMethodsRecursively(component, (Class<T>) superClazz);
-        }
-
-    }
-
-    private <T> void defineInternalInjectedMethods(AbstractInjectionTargetBean<T>
component, Class<T> clazz, boolean fromInherited)
-    {
-
-        Method[] methods = webBeansContext.getSecurityService().doPrivilegedGetDeclaredMethods(clazz);
-        
-        for (Method method : methods)
-        {
-            boolean isInitializer = AnnotationUtil.hasMethodAnnotation(method, Inject.class);
-            
-            if (isInitializer)
-            {
-                //Do not support static
-                if(Modifier.isStatic(method.getModifiers()))
-                {
-                    continue;
-                }
-                
-                checkForInjectedInitializerMethod(clazz, method, webBeansContext);
-            }
-            else
-            {
-                continue;
-            }
-
-            if (!Modifier.isStatic(method.getModifiers()))
-            {
-                if (!fromInherited)
-                {
-                    component.addInjectedMethod(method);
-                    addMethodInjectionPointMetaData(component, method);
-                }
-                else
-                {                    
-                    Method[] beanMethods = webBeansContext.getSecurityService().doPrivilegedGetDeclaredMethods(component.getReturnType());
-                    boolean defined = false;
-                    for (Method beanMethod : beanMethods)
-                    {
-                        if(ClassUtil.isOverridden(beanMethod, method))                  
     
-                        {
-                            defined = true;
-                            break;
-                        }
-                    }
-                    
-                    if(!defined)
-                    {
-                        component.addInjectedMethodToSuper(method);
-                        addMethodInjectionPointMetaData(component, method);             
          
-                    }
-                }
-            }
-        }
-
-    }
-
-    /**
-     * add the definitions for a &#x0040;Initializer method.
-     */
-    private static <T> void checkForInjectedInitializerMethod(Class<T> clazz,
Method method,
-                                                              WebBeansContext webBeansContext)
-    {
-        TypeVariable<?>[] args = method.getTypeParameters();
-        if(args.length > 0)
-        {
-            throw new WebBeansConfigurationException("Initializer methods must not be generic
but method : " + method.getName() + " in bean class : "
-                                                     + clazz + " is defined as generic");
-        }
-        
-        Annotation[][] anns = method.getParameterAnnotations();
-        Type[] type = method.getGenericParameterTypes();
-        for (int i = 0; i < anns.length; i++)
-        {
-            Annotation[] a = anns[i];
-            Type t = type[i];
-            webBeansContext.getAnnotationManager().checkForNewQualifierForDeployment(t, clazz,
method.getName(), a);
-        }
-
-        if (method.getAnnotation(Produces.class) == null)
-        {
-            WebBeansUtil.checkInjectedMethodParameterConditions(method, clazz);
-        }
-        else
-        {
-            throw new WebBeansConfigurationException("Initializer method : " + method.getName()
+ " in class : " + clazz.getName()
-                                                     + " can not be annotated with @Produces");
-        }
-    }
-
     /**
      * Configure bean instance interceptor stack.
      * @param bean bean instance

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/ManagedBeanConfigurator.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/ManagedBeanConfigurator.java?rev=1429007&r1=1429006&r2=1429007&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/ManagedBeanConfigurator.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/ManagedBeanConfigurator.java
Fri Jan  4 18:05:03 2013
@@ -178,7 +178,7 @@ public final class ManagedBeanConfigurat
 
         webBeansContext.getAnnotatedTypeUtil().defineDisposalMethods(component, component.getAnnotatedType());
         webBeansContext.getAnnotatedTypeUtil().defineInjectedFields(component, component.getAnnotatedType());
-        definitionUtil.defineInjectedMethods(component);
+        webBeansContext.getAnnotatedTypeUtil().defineInjectedMethods(component, component.getAnnotatedType());
         definitionUtil.defineObserverMethods(component, clazz);
 
         return component;

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansAnnotatedTypeUtil.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansAnnotatedTypeUtil.java?rev=1429007&r1=1429006&r2=1429007&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansAnnotatedTypeUtil.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansAnnotatedTypeUtil.java
Fri Jan  4 18:05:03 2013
@@ -335,8 +335,6 @@ public final class WebBeansAnnotatedType
                 addMethodInjectionPointMetaData(bean, annotatedMethod);
             }
         }
-        
-        webBeansContext.getDefinitionUtil().defineInternalInjectedMethodsRecursively(bean,
annotatedType.getJavaClass());
     }
     
     public <X> void defineInjectedFields(AbstractInjectionTargetBean<X> bean,AnnotatedType<X>
annotatedType)

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java?rev=1429007&r1=1429006&r2=1429007&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java
Fri Jan  4 18:05:03 2013
@@ -586,7 +586,7 @@ public final class WebBeansUtil
             definitionUtil.addConstructorInjectionPointMetaData(comp, comp.getConstructor());
 
             webBeansContext.getAnnotatedTypeUtil().defineInjectedFields(comp, comp.getAnnotatedType());
-            definitionUtil.defineInjectedMethods(comp);
+            webBeansContext.getAnnotatedTypeUtil().defineInjectedMethods(comp, comp.getAnnotatedType());
         }
         else if (EJBWebBeansConfigurator.isSessionBean(clazz, webBeansContext))
         {



Mime
View raw message