openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r1475685 - in /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container: AbstractBeanManager.java BeanManagerImpl.java InjectableBeanManager.java
Date Thu, 25 Apr 2013 09:45:49 GMT
Author: arne
Date: Thu Apr 25 09:45:48 2013
New Revision: 1475685

URL: http://svn.apache.org/r1475685
Log:
OWB-765: Moved createBeanAttributes to AbstractBeanManager

Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/AbstractBeanManager.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/InjectableBeanManager.java

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/AbstractBeanManager.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/AbstractBeanManager.java?rev=1475685&r1=1475684&r2=1475685&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/AbstractBeanManager.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/AbstractBeanManager.java
Thu Apr 25 09:45:48 2013
@@ -21,6 +21,7 @@ package org.apache.webbeans.container;
 import java.lang.annotation.Annotation;
 
 import javax.enterprise.inject.spi.AnnotatedField;
+import javax.enterprise.inject.spi.AnnotatedMember;
 import javax.enterprise.inject.spi.AnnotatedMethod;
 import javax.enterprise.inject.spi.AnnotatedParameter;
 import javax.enterprise.inject.spi.AnnotatedType;
@@ -28,8 +29,10 @@ import javax.enterprise.inject.spi.Bean;
 import javax.enterprise.inject.spi.BeanManager;
 import javax.enterprise.inject.spi.InjectionPoint;
 
+import org.apache.webbeans.component.creation.BeanAttributesBuilder;
 import org.apache.webbeans.component.creation.FieldProducerFactory;
 import org.apache.webbeans.component.creation.MethodProducerFactory;
+import org.apache.webbeans.component.spi.BeanAttributes;
 import org.apache.webbeans.component.spi.InjectionTargetFactory;
 import org.apache.webbeans.component.spi.ProducerFactory;
 import org.apache.webbeans.config.WebBeansContext;
@@ -60,6 +63,33 @@ public abstract class AbstractBeanManage
         return AnnotationUtil.getCdiAnnotationHashCode(annotation);
     }
 
+    /**
+     * {@inheritDoc}
+     */
+    public <T> BeanAttributes<T> createBeanAttributes(AnnotatedType<T>
type)
+    {
+        return BeanAttributesBuilder.forContext(getWebBeansContext()).newBeanAttibutes(type).build();
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public BeanAttributes<?> createBeanAttributes(AnnotatedMember<?> member)
+    {
+        if (member instanceof AnnotatedField)
+        {
+            return BeanAttributesBuilder.forContext(getWebBeansContext()).newBeanAttibutes((AnnotatedField<?>)member).build();
+        }
+        else if (member instanceof AnnotatedMethod)
+        {
+            return BeanAttributesBuilder.forContext(getWebBeansContext()).newBeanAttibutes((AnnotatedMethod<?>)member).build();
+        }
+        else
+        {
+            throw new IllegalArgumentException("Unsupported member type " + member.getClass().getName());
+        }
+    }
+
     public InjectionPoint createInjectionPoint(AnnotatedField<?> field)
     {
         return getWebBeansContext().getInjectionPointFactory().buildInjectionPoint(null,
field);

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java?rev=1475685&r1=1475684&r2=1475685&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java
Thu Apr 25 09:45:48 2013
@@ -65,13 +65,11 @@ import javax.naming.Referenceable;
 import javax.naming.StringRefAddr;
 
 import org.apache.webbeans.component.AbstractOwbBean;
-import org.apache.webbeans.component.BeanAttributesImpl;
 import org.apache.webbeans.component.EnterpriseBeanMarker;
 import org.apache.webbeans.component.InjectionTargetBean;
 import org.apache.webbeans.component.JmsBeanMarker;
 import org.apache.webbeans.component.NewBean;
 import org.apache.webbeans.component.OwbBean;
-import org.apache.webbeans.component.creation.BeanAttributesBuilder;
 import org.apache.webbeans.component.third.ThirdpartyBeanImpl;
 import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.context.creational.CreationalContextImpl;
@@ -531,33 +529,6 @@ public class BeanManagerImpl extends Abs
     /**
      * {@inheritDoc}
      */
-    public <T> BeanAttributesImpl<T> createBeanAttributes(AnnotatedType<T>
type)
-    {
-        return BeanAttributesBuilder.forContext(webBeansContext).newBeanAttibutes(type).build();
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-//    public <T> BeanAttributes<T> createBeanAttributes(AnnotatedMember<?>
member)
-//    {
-//        if (member instanceof AnnotatedField)
-//        {
-//            return BeanAttributesBuilder.forContext(webBeansContext).newBeanAttibutes((AnnotatedField<T>)member).build();
-//        }
-//        else if (member instanceof AnnotatedMethod)
-//        {
-//            return BeanAttributesBuilder.forContext(webBeansContext).newBeanAttibutes((AnnotatedMethod<T>)member).build();
-//        }
-//        else
-//        {
-//            throw new IllegalArgumentException("Unsupported member type " + member.getClass().getName());
-//        }
-//    }
-
-    /**
-     * {@inheritDoc}
-     */
     public <T> CreationalContextImpl<T> createCreationalContext(Contextual<T>
contextual)
     {
         if (contextual instanceof SerializableBean)

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/InjectableBeanManager.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/InjectableBeanManager.java?rev=1475685&r1=1475684&r2=1475685&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/InjectableBeanManager.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/InjectableBeanManager.java
Thu Apr 25 09:45:48 2013
@@ -43,7 +43,6 @@ import javax.enterprise.inject.spi.Inter
 import javax.enterprise.inject.spi.Interceptor;
 import javax.enterprise.inject.spi.ObserverMethod;
 
-import org.apache.webbeans.component.spi.BeanAttributes;
 import org.apache.webbeans.config.WebBeansContext;
 
 /**
@@ -206,11 +205,6 @@ public class InjectableBeanManager exten
         return bm.wrapExpressionFactory(expressionFactory);
     }
 
-    public <X> BeanAttributes<X> createBeanAttributes(AnnotatedType<X>
annotatedType)
-    {
-        return bm.createBeanAttributes(annotatedType);
-    }
-
     public void writeExternal(ObjectOutput out) throws IOException 
     {    
     }



Mime
View raw message