openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r1435912 - in /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component: AbstractBean.java AbstractOwbBean.java BeanAttributesImpl.java
Date Sun, 20 Jan 2013 19:04:11 GMT
Author: arne
Date: Sun Jan 20 19:04:11 2013
New Revision: 1435912

URL: http://svn.apache.org/viewvc?rev=1435912&view=rev
Log:
OWB-765: Implemented (without actually using the interface to stay CDI-1.0 compatible)

Added:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/BeanAttributesImpl.java
      - copied, changed from r1435910, openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractBean.java
Removed:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractBean.java
Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractOwbBean.java

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractOwbBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractOwbBean.java?rev=1435912&r1=1435911&r2=1435912&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractOwbBean.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractOwbBean.java
Sun Jan 20 19:04:11 2013
@@ -52,7 +52,7 @@ import org.apache.webbeans.logger.WebBea
  * @see javax.enterprise.inject.spi.Bean
  * 
  */
-public abstract class AbstractOwbBean<T> extends AbstractBean<T> implements OwbBean<T>
+public abstract class AbstractOwbBean<T> extends BeanAttributesImpl<T> implements
OwbBean<T>
 {
     /**Logger instance*/
     protected Logger logger = null;
@@ -60,6 +60,9 @@ public abstract class AbstractOwbBean<T>
     /** Web Beans type */
     protected WebBeansType webBeansType;
 
+    /** the bean class */
+    private final Class<?> beanClass;
+
     /**This bean is specialized or not*/
     protected boolean specializedBean;
 
@@ -113,8 +116,9 @@ public abstract class AbstractOwbBean<T>
                               Set<Class<? extends Annotation>> stereotypes,
                               boolean alternative)
     {
-        super(types, qualifiers, scope, name, nullable, beanClass, stereotypes, alternative);
+        super(types, qualifiers, scope, name, nullable, stereotypes, alternative);
         this.webBeansType = webBeansType;
+        this.beanClass = beanClass;
         this.webBeansContext = webBeansContext;
     }
 
@@ -137,6 +141,12 @@ public abstract class AbstractOwbBean<T>
     {
         return webBeansContext.getBeanManagerImpl();
     }
+
+    @Override
+    public Class<?> getBeanClass()
+    {
+        return beanClass;
+    }
     
     public Producer<T> getProducer()
     {
@@ -146,7 +156,6 @@ public abstract class AbstractOwbBean<T>
     /**
      * {@inheritDoc}
      */
-    @SuppressWarnings("unchecked")
     public T create(CreationalContext<T> creationalContext)
     {
         try

Copied: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/BeanAttributesImpl.java
(from r1435910, openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractBean.java)
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/BeanAttributesImpl.java?p2=openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/BeanAttributesImpl.java&p1=openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractBean.java&r1=1435910&r2=1435912&rev=1435912&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractBean.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/BeanAttributesImpl.java
Sun Jan 20 19:04:11 2013
@@ -24,35 +24,29 @@ import java.util.Collections;
 import java.util.HashSet;
 import java.util.Set;
 
-import javax.enterprise.inject.spi.Bean;
-import javax.enterprise.inject.spi.InjectionPoint;
-
-public abstract class AbstractBean<T> implements Bean<T>
+public class BeanAttributesImpl<T>
 {
     private final Set<Type> types;
     private final Set<Annotation> qualifiers;
     private final Class<? extends Annotation> scope;
     private final String name;
     private final boolean nullable;
-    private final Class<?> beanClass;
     private final Set<Class<? extends Annotation>> stereotypes;
     private final boolean alternative;
 
-    public AbstractBean(Set<Type> types,
+    public BeanAttributesImpl(Set<Type> types,
                         Set<Annotation> qualifiers,
                         Class<? extends Annotation> scope,
-                        Class<?> beanClass,
                         Set<Class<? extends Annotation>> stereotypes)
     {
-        this(types, qualifiers, scope, null, false, beanClass, stereotypes, false);
+        this(types, qualifiers, scope, null, false, stereotypes, false);
     }
 
-    public AbstractBean(Set<Type> types,
+    public BeanAttributesImpl(Set<Type> types,
                         Set<Annotation> qualifiers,
                         Class<? extends Annotation> scope,
                         String name,
                         boolean nullable,
-                        Class<?> beanClass,
                         Set<Class<? extends Annotation>> stereotypes,
                         boolean alternative)
     {
@@ -61,62 +55,42 @@ public abstract class AbstractBean<T> im
         this.scope = scope;
         this.name = name;
         this.nullable = nullable;
-        this.beanClass = beanClass;
         this.stereotypes = stereotypes == null
                 ? Collections.<Class<? extends Annotation>>emptySet()
                 : Collections.unmodifiableSet(new HashSet<Class<? extends Annotation>>(stereotypes));
         this.alternative = alternative;
     }
 
-    @Override
     public Set<Type> getTypes()
     {
         return types;
     }
 
-    @Override
     public Set<Annotation> getQualifiers()
     {
         return qualifiers;
     }
 
-    @Override
     public Class<? extends Annotation> getScope()
     {
         return scope;
     }
 
-    @Override
     public String getName()
     {
         return name;
     }
 
-    @Override
     public boolean isNullable()
     {
         return nullable;
     }
 
-    @Override
-    public Set<InjectionPoint> getInjectionPoints()
-    {
-        return Collections.EMPTY_SET;
-    }
-
-    @Override
-    public Class<?> getBeanClass()
-    {
-        return beanClass;
-    }
-
-    @Override
     public Set<Class<? extends Annotation>> getStereotypes()
     {
         return stereotypes;
     }
 
-    @Override
     public boolean isAlternative()
     {
         return alternative;



Mime
View raw message