openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r1429574 - in /openwebbeans/trunk: webbeans-ee-common/src/main/java/org/apache/webbeans/ee/common/beans/ webbeans-ee/src/main/java/org/apache/webbeans/ee/beans/ webbeans-impl/src/main/java/org/apache/webbeans/component/ webbeans-impl/src/ma...
Date Sun, 06 Jan 2013 19:26:23 GMT
Author: arne
Date: Sun Jan  6 19:26:23 2013
New Revision: 1429574

URL: http://svn.apache.org/viewvc?rev=1429574&view=rev
Log:
OWB-745: Delayed setting of scope

Modified:
    openwebbeans/trunk/webbeans-ee-common/src/main/java/org/apache/webbeans/ee/common/beans/PrincipalBean.java
    openwebbeans/trunk/webbeans-ee/src/main/java/org/apache/webbeans/ee/beans/UserTransactionBean.java
    openwebbeans/trunk/webbeans-ee/src/main/java/org/apache/webbeans/ee/beans/ValidatorBean.java
    openwebbeans/trunk/webbeans-ee/src/main/java/org/apache/webbeans/ee/beans/ValidatorFactoryBean.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractOwbBean.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/BeanManagerBean.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ExtensionBean.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/InjectionPointBean.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/OwbBean.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/AbstractBeanCreator.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/AbstractInjecionTargetBeanCreator.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/AbstractProducerBeanCreator.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/ExtensionBeanCreatorImpl.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/ManagedBeanCreatorImpl.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/NewManagedBeanCreatorImpl.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/ProducerFieldBeanCreator.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/ProducerMethodBeanCreator.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/TestContext.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/pfield/ProducerFieldComponentTest.java
    openwebbeans/trunk/webbeans-jms/src/main/java/org/apache/webbeans/jms/component/JmsComponentFactory.java

Modified: openwebbeans/trunk/webbeans-ee-common/src/main/java/org/apache/webbeans/ee/common/beans/PrincipalBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-ee-common/src/main/java/org/apache/webbeans/ee/common/beans/PrincipalBean.java?rev=1429574&r1=1429573&r2=1429574&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-ee-common/src/main/java/org/apache/webbeans/ee/common/beans/PrincipalBean.java (original)
+++ openwebbeans/trunk/webbeans-ee-common/src/main/java/org/apache/webbeans/ee/common/beans/PrincipalBean.java Sun Jan  6 19:26:23 2013
@@ -20,10 +20,10 @@ package org.apache.webbeans.ee.common.be
 
 import java.security.Principal;
 
+import javax.enterprise.context.Dependent;
 import javax.enterprise.context.spi.CreationalContext;
 
 import org.apache.webbeans.annotation.DefaultLiteral;
-import org.apache.webbeans.annotation.DependentScopeLiteral;
 import org.apache.webbeans.component.BuildInOwbBean;
 import org.apache.webbeans.component.WebBeansType;
 import org.apache.webbeans.spi.SecurityService;
@@ -37,7 +37,7 @@ public class PrincipalBean extends Build
         addApiType(Object.class);
         addApiType(Principal.class);
         addQualifier(new DefaultLiteral());
-        setImplScopeType(new DependentScopeLiteral());
+        setImplScopeType(Dependent.class);
     }
 
     @Override

Modified: openwebbeans/trunk/webbeans-ee/src/main/java/org/apache/webbeans/ee/beans/UserTransactionBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-ee/src/main/java/org/apache/webbeans/ee/beans/UserTransactionBean.java?rev=1429574&r1=1429573&r2=1429574&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-ee/src/main/java/org/apache/webbeans/ee/beans/UserTransactionBean.java (original)
+++ openwebbeans/trunk/webbeans-ee/src/main/java/org/apache/webbeans/ee/beans/UserTransactionBean.java Sun Jan  6 19:26:23 2013
@@ -18,11 +18,11 @@
  */
 package org.apache.webbeans.ee.beans;
 
+import javax.enterprise.context.Dependent;
 import javax.enterprise.context.spi.CreationalContext;
 import javax.transaction.UserTransaction;
 
 import org.apache.webbeans.annotation.DefaultLiteral;
-import org.apache.webbeans.annotation.DependentScopeLiteral;
 import org.apache.webbeans.component.BuildInOwbBean;
 import org.apache.webbeans.component.WebBeansType;
 import org.apache.webbeans.spi.TransactionService;
@@ -36,7 +36,7 @@ public class UserTransactionBean extends
         addApiType(Object.class);
         addApiType(UserTransaction.class);
         addQualifier(new DefaultLiteral());
-        setImplScopeType(new DependentScopeLiteral());
+        setImplScopeType(Dependent.class);
     }
 
     @Override

Modified: openwebbeans/trunk/webbeans-ee/src/main/java/org/apache/webbeans/ee/beans/ValidatorBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-ee/src/main/java/org/apache/webbeans/ee/beans/ValidatorBean.java?rev=1429574&r1=1429573&r2=1429574&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-ee/src/main/java/org/apache/webbeans/ee/beans/ValidatorBean.java (original)
+++ openwebbeans/trunk/webbeans-ee/src/main/java/org/apache/webbeans/ee/beans/ValidatorBean.java Sun Jan  6 19:26:23 2013
@@ -18,11 +18,11 @@
  */
 package org.apache.webbeans.ee.beans;
 
+import javax.enterprise.context.Dependent;
 import javax.enterprise.context.spi.CreationalContext;
 import javax.validation.Validator;
 
 import org.apache.webbeans.annotation.DefaultLiteral;
-import org.apache.webbeans.annotation.DependentScopeLiteral;
 import org.apache.webbeans.component.BuildInOwbBean;
 import org.apache.webbeans.component.WebBeansType;
 import org.apache.webbeans.spi.ValidatorService;
@@ -36,7 +36,7 @@ public class ValidatorBean extends Build
         addApiType(Object.class);
         addApiType(Validator.class);
         addQualifier(new DefaultLiteral());
-        setImplScopeType(new DependentScopeLiteral());
+        setImplScopeType(Dependent.class);
     }
 
     @Override

Modified: openwebbeans/trunk/webbeans-ee/src/main/java/org/apache/webbeans/ee/beans/ValidatorFactoryBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-ee/src/main/java/org/apache/webbeans/ee/beans/ValidatorFactoryBean.java?rev=1429574&r1=1429573&r2=1429574&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-ee/src/main/java/org/apache/webbeans/ee/beans/ValidatorFactoryBean.java (original)
+++ openwebbeans/trunk/webbeans-ee/src/main/java/org/apache/webbeans/ee/beans/ValidatorFactoryBean.java Sun Jan  6 19:26:23 2013
@@ -18,11 +18,11 @@
  */
 package org.apache.webbeans.ee.beans;
 
+import javax.enterprise.context.Dependent;
 import javax.enterprise.context.spi.CreationalContext;
 import javax.validation.ValidatorFactory;
 
 import org.apache.webbeans.annotation.DefaultLiteral;
-import org.apache.webbeans.annotation.DependentScopeLiteral;
 import org.apache.webbeans.component.BuildInOwbBean;
 import org.apache.webbeans.component.WebBeansType;
 import org.apache.webbeans.spi.ValidatorService;
@@ -36,7 +36,7 @@ public class ValidatorFactoryBean extend
         addApiType(Object.class);
         addApiType(ValidatorFactory.class);
         addQualifier(new DefaultLiteral());
-        setImplScopeType(new DependentScopeLiteral());
+        setImplScopeType(Dependent.class);
     }
 
     @Override

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=1429574&r1=1429573&r2=1429574&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  6 19:26:23 2013
@@ -357,10 +357,13 @@ public abstract class AbstractOwbBean<T>
      * 
      * @param scopeType scope type
      */
-    public void setImplScopeType(Annotation scopeType)
+    public void setImplScopeType(Class<? extends Annotation> scopeType)
     {
-        scopeClass = scopeType.annotationType();
-        cachedHashCode = 0;
+        if (scopeType != null)
+        {
+            scopeClass = scopeType;
+            cachedHashCode = 0;
+        }
     }
 
     /**

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/BeanManagerBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/BeanManagerBean.java?rev=1429574&r1=1429573&r2=1429574&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/BeanManagerBean.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/BeanManagerBean.java Sun Jan  6 19:26:23 2013
@@ -18,10 +18,10 @@
  */
 package org.apache.webbeans.component;
 
+import javax.enterprise.context.ApplicationScoped;
 import javax.enterprise.context.spi.CreationalContext;
 import javax.enterprise.inject.spi.BeanManager;
 
-import org.apache.webbeans.annotation.ApplicationScopeLiteral;
 import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.container.InjectableBeanManager;
 
@@ -32,7 +32,7 @@ public class BeanManagerBean extends Abs
     public BeanManagerBean(WebBeansContext webBeansContext)
     {
         super(WebBeansType.MANAGER, BeanManager.class, webBeansContext);
-        setImplScopeType(new ApplicationScopeLiteral());
+        setImplScopeType(ApplicationScoped.class);
     }
 
     @Override

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ExtensionBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ExtensionBean.java?rev=1429574&r1=1429573&r2=1429574&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ExtensionBean.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ExtensionBean.java Sun Jan  6 19:26:23 2013
@@ -20,7 +20,6 @@ package org.apache.webbeans.component;
 
 import javax.enterprise.context.spi.CreationalContext;
 
-import org.apache.webbeans.annotation.ApplicationScopeLiteral;
 import org.apache.webbeans.annotation.DefaultLiteral;
 import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.portable.events.ExtensionLoader;
@@ -44,7 +43,6 @@ public class ExtensionBean<T> extends Ab
     {
         super(WebBeansType.EXTENSION, returnType, webBeansContext.getAnnotatedElementFactory().newAnnotatedType(returnType), webBeansContext);
         setEnabled(true);
-        setImplScopeType(new ApplicationScopeLiteral());
         getTypes().addAll(getAnnotatedType().getTypeClosure());
         addQualifier(new DefaultLiteral());
     }

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/InjectionPointBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/InjectionPointBean.java?rev=1429574&r1=1429573&r2=1429574&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/InjectionPointBean.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/InjectionPointBean.java Sun Jan  6 19:26:23 2013
@@ -19,10 +19,11 @@
 package org.apache.webbeans.component;
 
 import java.util.Stack;
+
+import javax.enterprise.context.Dependent;
 import javax.enterprise.context.spi.CreationalContext;
 import javax.enterprise.inject.spi.InjectionPoint;
 import org.apache.webbeans.annotation.DefaultLiteral;
-import org.apache.webbeans.annotation.DependentScopeLiteral;
 import org.apache.webbeans.config.WebBeansContext;
 
 public class InjectionPointBean extends AbstractOwbBean<InjectionPoint>
@@ -67,7 +68,7 @@ public class InjectionPointBean extends 
         super(WebBeansType.INJECTIONPOINT,InjectionPoint.class, webBeansContext);
         
         addQualifier(new DefaultLiteral());
-        setImplScopeType(new DependentScopeLiteral());
+        setImplScopeType(Dependent.class);
         addApiType(InjectionPoint.class);
         addApiType(Object.class);
     }

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/OwbBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/OwbBean.java?rev=1429574&r1=1429573&r2=1429574&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/OwbBean.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/OwbBean.java Sun Jan  6 19:26:23 2013
@@ -48,7 +48,7 @@ public interface OwbBean<T> extends Bean
      * 
      * @param scopeType bean scope type annotation
      */
-    public void setImplScopeType(Annotation scopeType);    
+    public void setImplScopeType(Class<? extends Annotation> scopeType);    
 
     /**
      * Returns bean type.

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/AbstractBeanCreator.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/AbstractBeanCreator.java?rev=1429574&r1=1429573&r2=1429574&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/AbstractBeanCreator.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/AbstractBeanCreator.java Sun Jan  6 19:26:23 2013
@@ -18,15 +18,20 @@
  */
 package org.apache.webbeans.component.creation;
 
+import static org.apache.webbeans.util.InjectionExceptionUtils.throwUnproxyableResolutionException;
+
 import java.io.Serializable;
 import java.lang.annotation.Annotation;
+import java.lang.reflect.Constructor;
 import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
 import java.lang.reflect.Type;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
 
+import javax.enterprise.context.Dependent;
 import javax.enterprise.context.NormalScope;
 import javax.enterprise.inject.Any;
 import javax.enterprise.inject.spi.Annotated;
@@ -39,7 +44,6 @@ import javax.inject.Scope;
 import org.apache.webbeans.annotation.AnnotationManager;
 import org.apache.webbeans.annotation.AnyLiteral;
 import org.apache.webbeans.annotation.DefaultLiteral;
-import org.apache.webbeans.annotation.DependentScopeLiteral;
 import org.apache.webbeans.annotation.NamedLiteral;
 import org.apache.webbeans.component.AbstractOwbBean;
 import org.apache.webbeans.component.InjectionTargetBean;
@@ -49,9 +53,11 @@ import org.apache.webbeans.config.inheri
 import org.apache.webbeans.container.ExternalScope;
 import org.apache.webbeans.event.EventUtil;
 import org.apache.webbeans.exception.WebBeansConfigurationException;
+import org.apache.webbeans.exception.helper.ViolationMessageBuilder;
 import org.apache.webbeans.util.AnnotationUtil;
 import org.apache.webbeans.util.Asserts;
 import org.apache.webbeans.util.ClassUtil;
+import org.apache.webbeans.util.SecurityUtil;
 import org.apache.webbeans.util.WebBeansUtil;
 
 /**
@@ -61,7 +67,7 @@ import org.apache.webbeans.util.WebBeans
  *
  * @param <T> bean class info
  */
-public class AbstractBeanCreator<T>
+public abstract class AbstractBeanCreator<T>
 {
     /**Bean instance*/
     private final AbstractOwbBean<T> bean;    
@@ -71,29 +77,32 @@ public class AbstractBeanCreator<T>
     private WebBeansContext webBeansContext;
     
     private String beanName;
+    
+    private Class<? extends Annotation> scope;
 
     private Set<Annotation> qualifiers = new HashSet<Annotation>();
     
     private Set<Class<? extends Annotation>> stereotypes = new HashSet<Class<? extends Annotation>>();
-    
+
+    public AbstractBeanCreator(AbstractOwbBean<T> bean, Annotated annotated)
+    {
+        this(bean, annotated, null);
+    }
+
     /**
      * Creates a bean instance.
      * 
      * @param bean bean instance
      * @param annotated
      */
-    public AbstractBeanCreator(AbstractOwbBean<T> bean, Annotated annotated)
+    public AbstractBeanCreator(AbstractOwbBean<T> bean, Annotated annotated, Class<? extends Annotation> scopeType)
     {
         this.bean = bean;
         this.annotated = annotated;
+        this.scope = scopeType;
         this.webBeansContext = bean.getWebBeansContext();
     }
 
-    protected Set<Annotation> getQualifiers()
-    {
-        return qualifiers;
-    }
-
     /**
      * {@inheritDoc}
      */
@@ -204,7 +213,7 @@ public class AbstractBeanCreator<T>
             }
         }
         
-        configureInheritedQualifiers();
+        defineInheritedQualifiers(qualifiers);
 
         // No-binding annotation
         if (qualifiers.size() == 0 )
@@ -228,9 +237,15 @@ public class AbstractBeanCreator<T>
         
     }
 
-    protected void configureInheritedQualifiers()
+    protected void defineInheritedQualifiers(Set<Annotation> qualifiers)
+    {
+        // hook for subclasses
+    }
+    
+    protected Class<? extends Annotation> defineInheritedScope()
     {
         // hook for subclasses
+        return null;
     }
 
     /**
@@ -289,7 +304,7 @@ public class AbstractBeanCreator<T>
             {
                 if(pseudo != null)
                 {
-                    throw new WebBeansConfigurationException("Not to define both @Scope and @NormalScope on bean : " + getBean());
+                    throw new WebBeansConfigurationException("Not to define both @Scope and @NormalScope on bean : " + getBeanType().getName());
                 }
                 
                 if (found)
@@ -298,7 +313,7 @@ public class AbstractBeanCreator<T>
                 }
 
                 found = true;
-                getBean().setImplScopeType(annotation);
+                scope = annotation.annotationType();
             }
             else
             {
@@ -310,7 +325,7 @@ public class AbstractBeanCreator<T>
                     }
 
                     found = true;
-                    getBean().setImplScopeType(annotation);
+                    scope = annotation.annotationType();
                 }
             }
         }
@@ -324,29 +339,14 @@ public class AbstractBeanCreator<T>
 
     private void defineDefaultScopeType(String exceptionMessage, boolean allowLazyInit)
     {
-        // Frist look for inherited scope
-        IBeanInheritedMetaData metaData = null;
-        if(getBean() instanceof InjectionTargetBean)
-        {
-            metaData = ((InjectionTargetBean<?>)getBean()).getInheritedMetaData();
-        }
-        boolean found = false;
-        if (metaData != null)
-        {
-            Annotation inheritedScope = metaData.getInheritedScopeType();
-            if (inheritedScope != null)
-            {
-                found = true;
-                getBean().setImplScopeType(inheritedScope);
-            }
-        }
-
-        if (!found)
+        scope = defineInheritedScope();
+        
+        if (scope == null)
         {
             Set<Class<? extends Annotation>> stereos = stereotypes;
             if (stereos.size() == 0)
             {
-                getBean().setImplScopeType(new DependentScopeLiteral());
+                scope = Dependent.class;
 
                 if (allowLazyInit && getBean() instanceof ManagedBean && isPurePojoBean(webBeansContext, getBean().getBeanClass()))
                 {
@@ -393,13 +393,13 @@ public class AbstractBeanCreator<T>
 
                 if (defined != null)
                 {
-                    getBean().setImplScopeType(defined);
+                    scope = defined.annotationType();
                 }
                 else
                 {
-                    getBean().setImplScopeType(new DependentScopeLiteral());
+                    scope = Dependent.class;
 
-                    if (allowLazyInit && getBean() instanceof ManagedBean && isPurePojoBean(webBeansContext, getBean().getBeanClass()))
+                    if (allowLazyInit && getBean() instanceof ManagedBean && isPurePojoBean(webBeansContext, getBeanType()))
                     {
                         // take the bean as Dependent but we could lazily initialize it
                         // because the bean doesn't contains any CDI feature
@@ -445,6 +445,73 @@ public class AbstractBeanCreator<T>
     }
 
     /**
+     * Checks the unproxiable condition.
+     * @param bean managed bean
+     * @param scopeType scope type
+     * @throws WebBeansConfigurationException if
+     *  bean is not proxied by the container
+     */
+    protected void checkUnproxiableApiType()
+    {
+        //Unproxiable test for NormalScoped beans
+        if (webBeansContext.getWebBeansUtil().isScopeTypeNormal(scope))
+        {
+            ViolationMessageBuilder violationMessage = ViolationMessageBuilder.newViolation();
+
+            Class<?> beanClass = getBean().getReturnType();
+            
+            if(!beanClass.isInterface() && beanClass != Object.class)
+            {
+                if(beanClass.isPrimitive())
+                {
+                    violationMessage.addLine("It isn't possible to proxy a primitive type (" + beanClass.getName(), ")");
+                }
+
+                if(beanClass.isArray())
+                {
+                    violationMessage.addLine("It isn't possible to proxy an array type (", beanClass.getName(), ")");
+                }
+
+                if(!violationMessage.containsViolation())
+                {
+                    if (Modifier.isFinal(beanClass.getModifiers()))
+                    {
+                        violationMessage.addLine(beanClass.getName(), " is a final class! CDI doesn't allow to proxy that.");
+                    }
+
+                    Method[] methods = SecurityUtil.doPrivilegedGetDeclaredMethods(beanClass);
+                    for (Method m : methods)
+                    {
+                        int modifiers = m.getModifiers();
+                        if (Modifier.isFinal(modifiers) && !Modifier.isPrivate(modifiers) &&
+                            !m.isSynthetic() && !m.isBridge())
+                        {
+                            violationMessage.addLine(beanClass.getName(), " has final method "+ m + " CDI doesn't allow to proxy that.");
+                        }
+                    }
+
+                    Constructor<?> cons = webBeansContext.getWebBeansUtil().getNoArgConstructor(beanClass);
+                    if (cons == null)
+                    {
+                        violationMessage.addLine(beanClass.getName(), " has no explicit no-arg constructor!",
+                                "A public or protected constructor without args is required!");
+                    }
+                    else if (Modifier.isPrivate(cons.getModifiers()))
+                    {
+                        violationMessage.addLine(beanClass.getName(), " has a >private< no-arg constructor! CDI doesn't allow to proxy that.");
+                    }
+                }
+
+                //Throw Exception
+                if(violationMessage.containsViolation())
+                {
+                    throwUnproxyableResolutionException(violationMessage);
+                }
+            }
+        }
+    }
+
+    /**
      * {@inheritDoc}
      */
     public void defineSerializable()
@@ -529,6 +596,7 @@ public class AbstractBeanCreator<T>
     public AbstractOwbBean<T> getBean()
     {
         bean.setName(beanName);
+        bean.setImplScopeType(scope);
         bean.getQualifiers().addAll(qualifiers);
         bean.getStereotypes().addAll(stereotypes);
         return bean;
@@ -538,4 +606,6 @@ public class AbstractBeanCreator<T>
     {
         return annotated;
     }
+    
+    protected abstract Class<?> getBeanType();
 }

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/AbstractInjecionTargetBeanCreator.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/AbstractInjecionTargetBeanCreator.java?rev=1429574&r1=1429573&r2=1429574&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/AbstractInjecionTargetBeanCreator.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/AbstractInjecionTargetBeanCreator.java Sun Jan  6 19:26:23 2013
@@ -48,7 +48,6 @@ import javax.inject.Inject;
 import javax.inject.Named;
 
 import org.apache.webbeans.annotation.AnnotationManager;
-import org.apache.webbeans.annotation.DependentScopeLiteral;
 import org.apache.webbeans.component.AbstractInjectionTargetBean;
 import org.apache.webbeans.component.ProducerFieldBean;
 import org.apache.webbeans.component.ProducerMethodBean;
@@ -80,12 +79,17 @@ public abstract class AbstractInjecionTa
      * 
      * @param bean bean instance
      */
-    public AbstractInjecionTargetBeanCreator(AbstractInjectionTargetBean<T> bean)
+    public AbstractInjecionTargetBeanCreator(AbstractInjectionTargetBean<T> bean, Class<? extends Annotation> scopeType)
     {
-        super(bean, bean.getAnnotatedType());
+        super(bean, bean.getAnnotatedType(), scopeType);
         webBeansContext = bean.getWebBeansContext();
     }
         
+    public AbstractInjecionTargetBeanCreator(AbstractInjectionTargetBean<T> bean)
+    {
+        this(bean, null);
+    }
+
     /**
      * {@inheritDoc}
      */
@@ -471,7 +475,7 @@ public abstract class AbstractInjecionTa
                         
                         resourceBean.getTypes().addAll(annotatedField.getTypeClosure());
                         resourceBeanCreator.defineQualifiers();
-                        resourceBean.setImplScopeType(new DependentScopeLiteral());
+                        resourceBean.setImplScopeType(Dependent.class);
                         resourceBean.setProducerField(field);
                         
                         producerBeans.add(resourceBean);                                            
@@ -502,8 +506,7 @@ public abstract class AbstractInjecionTa
                         producerFieldBean.getTypes().addAll(annotatedField.getTypeClosure());
                     }
                     producerFieldBeanCreator.defineScopeType("Annotated producer field: " + annotatedField +  "must declare default @Scope annotation", false);
-                    webBeansContext.getWebBeansUtil().checkUnproxiableApiType(producerFieldBean,
-                                                                                             producerFieldBean.getScope());
+                    producerFieldBeanCreator.checkUnproxiableApiType();
                     WebBeansUtil.checkProducerGenericType(producerFieldBean,annotatedField.getJavaMember());
                     producerFieldBeanCreator.defineQualifiers();
                     producerFieldBeanCreator.defineName(WebBeansUtil.getProducerDefaultName(annotatedField.getJavaMember().getName()));
@@ -572,9 +575,8 @@ public abstract class AbstractInjecionTa
                 }
                 producerMethodBeanCreator.defineScopeType("Annotated producer method : " + annotatedMethod
                                                           +  "must declare default @Scope annotation", false);
-                webBeansContext.getWebBeansUtil().checkUnproxiableApiType(producerMethodBean,
-                                                                                         producerMethodBean.getScope());
-                WebBeansUtil.checkProducerGenericType(producerMethodBean,annotatedMethod.getJavaMember());
+                producerMethodBeanCreator.checkUnproxiableApiType();
+                WebBeansUtil.checkProducerGenericType(producerMethodBeanCreator.getBean(), annotatedMethod.getJavaMember());
                 producerMethodBeanCreator.defineName(WebBeansUtil.getProducerDefaultName(annotatedMethod.getJavaMember().getName()));
                 producerMethodBeanCreator.defineQualifiers();
                 
@@ -629,7 +631,8 @@ public abstract class AbstractInjecionTa
         return (AnnotatedType<T>) super.getAnnotated();
     }
 
-    protected void configureInheritedQualifiers()
+    @Override
+    protected void defineInheritedQualifiers(Set<Annotation> qualifiers)
     {
         // Adding inherited qualifiers
         IBeanInheritedMetaData inheritedMetaData = getBean().getInheritedMetaData();
@@ -640,7 +643,7 @@ public abstract class AbstractInjecionTa
             for (Annotation inherited : inheritedTypes)
             {
                 boolean found = false;
-                for (Annotation existQualifier : getQualifiers())
+                for (Annotation existQualifier : qualifiers)
                 {
                     if (existQualifier.annotationType().equals(inherited.annotationType()))
                     {
@@ -650,9 +653,30 @@ public abstract class AbstractInjecionTa
                 }
                 if (!found)
                 {
-                    getQualifiers().add(inherited);
+                    qualifiers.add(inherited);
                 }
             }
         }
     }
+
+    @Override
+    protected Class<? extends Annotation> defineInheritedScope()
+    {
+        IBeanInheritedMetaData metaData = getBean().getInheritedMetaData();
+        if (metaData != null)
+        {
+            Annotation inheritedScope = metaData.getInheritedScopeType();
+            if (inheritedScope != null)
+            {
+                return inheritedScope.annotationType();
+            }
+        }
+        return null;
+    }
+
+    @Override
+    protected Class<?> getBeanType()
+    {
+        return getAnnotated().getJavaClass();
+    }
 }

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/AbstractProducerBeanCreator.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/AbstractProducerBeanCreator.java?rev=1429574&r1=1429573&r2=1429574&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/AbstractProducerBeanCreator.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/AbstractProducerBeanCreator.java Sun Jan  6 19:26:23 2013
@@ -22,7 +22,7 @@ import javax.enterprise.inject.spi.Annot
 
 import org.apache.webbeans.component.AbstractProducerBean;
 
-public class AbstractProducerBeanCreator<T> extends AbstractBeanCreator<T>
+public abstract class AbstractProducerBeanCreator<T> extends AbstractBeanCreator<T>
 {
 
     public AbstractProducerBeanCreator(AbstractProducerBean<T> bean, Annotated annotated)

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/ExtensionBeanCreatorImpl.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/ExtensionBeanCreatorImpl.java?rev=1429574&r1=1429573&r2=1429574&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/ExtensionBeanCreatorImpl.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/ExtensionBeanCreatorImpl.java Sun Jan  6 19:26:23 2013
@@ -18,6 +18,8 @@
  */
 package org.apache.webbeans.component.creation;
 
+import javax.enterprise.context.ApplicationScoped;
+
 import org.apache.webbeans.component.ExtensionBean;
 import org.apache.webbeans.config.WebBeansContext;
 
@@ -26,7 +28,7 @@ public class ExtensionBeanCreatorImpl<T>
 
     public ExtensionBeanCreatorImpl(Class<T> type, WebBeansContext webBeansContext)
     {
-        super(new ExtensionBean<T>(type, webBeansContext));
+        super(new ExtensionBean<T>(type, webBeansContext), ApplicationScoped.class);
     }
 
     /**

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/ManagedBeanCreatorImpl.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/ManagedBeanCreatorImpl.java?rev=1429574&r1=1429573&r2=1429574&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/ManagedBeanCreatorImpl.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/ManagedBeanCreatorImpl.java Sun Jan  6 19:26:23 2013
@@ -76,12 +76,12 @@ public class ManagedBeanCreatorImpl<T> e
      */
     public ManagedBeanCreatorImpl(AnnotatedType<T> annotatedType, WebBeansContext webBeansContext)
     {
-        this(new ManagedBean<T>(annotatedType.getJavaClass(), annotatedType, webBeansContext));
+        this(new ManagedBean<T>(annotatedType.getJavaClass(), annotatedType, webBeansContext), null);
     }
-    
-    protected ManagedBeanCreatorImpl(ManagedBean<T> managedBean)
+
+    protected ManagedBeanCreatorImpl(ManagedBean<T> managedBean, Class<? extends Annotation> scopeType)
     {
-        super(managedBean);
+        super(managedBean, scopeType);
         webBeansContext = managedBean.getWebBeansContext();
     }
 
@@ -94,7 +94,7 @@ public class ManagedBeanCreatorImpl<T> e
         webBeansContext.getWebBeansUtil().checkManagedBeanCondition(getAnnotated());
         WebBeansUtil.checkGenericType(getBean());
         //Check Unproxiable
-        webBeansContext.getWebBeansUtil().checkUnproxiableApiType(getBean(), getBean().getScope());
+        checkUnproxiableApiType();
     }
 
 
@@ -116,7 +116,7 @@ public class ManagedBeanCreatorImpl<T> e
 
     public static <T> void lazyInitializeManagedBean(ManagedBean<T> bean)
     {
-        ManagedBeanCreatorImpl<T> managedBeanCreator = new ManagedBeanCreatorImpl<T>(bean);
+        ManagedBeanCreatorImpl<T> managedBeanCreator = new ManagedBeanCreatorImpl<T>(bean, bean.getScope());
 
         managedBeanCreator.lazyInitializeManagedBean(bean.getBeanClass(), bean);
     }

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/NewManagedBeanCreatorImpl.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/NewManagedBeanCreatorImpl.java?rev=1429574&r1=1429573&r2=1429574&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/NewManagedBeanCreatorImpl.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/NewManagedBeanCreatorImpl.java Sun Jan  6 19:26:23 2013
@@ -18,6 +18,7 @@
  */
 package org.apache.webbeans.component.creation;
 
+import javax.enterprise.context.Dependent;
 import javax.enterprise.inject.spi.AnnotatedType;
 
 import org.apache.webbeans.component.NewManagedBean;
@@ -29,7 +30,7 @@ public class NewManagedBeanCreatorImpl<T
 
     public NewManagedBeanCreatorImpl(AnnotatedType<T> annotatedType, WebBeansContext webBeansContext)
     {
-        super(new NewManagedBean<T>(annotatedType.getJavaClass(), WebBeansType.MANAGED, annotatedType, webBeansContext));
+        super(new NewManagedBean<T>(annotatedType.getJavaClass(), WebBeansType.MANAGED, annotatedType, webBeansContext), Dependent.class);
     }
 
     /**

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/ProducerFieldBeanCreator.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/ProducerFieldBeanCreator.java?rev=1429574&r1=1429573&r2=1429574&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/ProducerFieldBeanCreator.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/ProducerFieldBeanCreator.java Sun Jan  6 19:26:23 2013
@@ -44,4 +44,10 @@ public class ProducerFieldBeanCreator<T>
     {
         return (ProducerFieldBean<T>) super.getBean();
     }
+
+    @Override
+    protected Class<?> getBeanType()
+    {
+        return ((AnnotatedField<T>)getAnnotated()).getJavaMember().getType();
+    }
 }

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/ProducerMethodBeanCreator.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/ProducerMethodBeanCreator.java?rev=1429574&r1=1429573&r2=1429574&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/ProducerMethodBeanCreator.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/ProducerMethodBeanCreator.java Sun Jan  6 19:26:23 2013
@@ -87,4 +87,10 @@ public class ProducerMethodBeanCreator<T
         
         getBean().setSpecializedBean(true);        
     }
+
+    @Override
+    protected Class<?> getBeanType()
+    {
+        return ((AnnotatedMethod<T>)getAnnotated()).getJavaMember().getReturnType();
+    }
 }

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=1429574&r1=1429573&r2=1429574&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 Sun Jan  6 19:26:23 2013
@@ -18,8 +18,6 @@
  */
 package org.apache.webbeans.util;
 
-import static org.apache.webbeans.util.InjectionExceptionUtils.throwUnproxyableResolutionException;
-
 import java.io.Serializable;
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Constructor;
@@ -47,6 +45,7 @@ import javax.decorator.Decorator;
 import javax.enterprise.context.Conversation;
 import javax.enterprise.context.Dependent;
 import javax.enterprise.context.NormalScope;
+import javax.enterprise.context.RequestScoped;
 import javax.enterprise.context.spi.Contextual;
 import javax.enterprise.event.Event;
 import javax.enterprise.event.Observes;
@@ -94,9 +93,7 @@ import javax.interceptor.InvocationConte
 import org.apache.webbeans.annotation.AnnotationManager;
 import org.apache.webbeans.annotation.AnyLiteral;
 import org.apache.webbeans.annotation.DefaultLiteral;
-import org.apache.webbeans.annotation.DependentScopeLiteral;
 import org.apache.webbeans.annotation.NewLiteral;
-import org.apache.webbeans.annotation.RequestedScopeLiteral;
 import org.apache.webbeans.component.AbstractInjectionTargetBean;
 import org.apache.webbeans.component.AbstractOwbBean;
 import org.apache.webbeans.component.AbstractProducerBean;
@@ -131,7 +128,6 @@ import org.apache.webbeans.container.Inj
 import org.apache.webbeans.conversation.ConversationImpl;
 import org.apache.webbeans.decorator.WebBeansDecoratorConfig;
 import org.apache.webbeans.exception.WebBeansConfigurationException;
-import org.apache.webbeans.exception.helper.ViolationMessageBuilder;
 import org.apache.webbeans.exception.inject.DefinitionException;
 import org.apache.webbeans.exception.inject.InconsistentSpecializationException;
 import org.apache.webbeans.inject.AlternativesManager;
@@ -601,7 +597,7 @@ public final class WebBeansUtil
             NewManagedBeanCreatorImpl<T> newBeanCreator
                 = new NewManagedBeanCreatorImpl<T>(webBeansContext.getAnnotatedElementFactory().newAnnotatedType(clazz), webBeansContext);
             comp = newBeanCreator.getBean();
-            comp.setImplScopeType(new DependentScopeLiteral());
+            comp.setImplScopeType(Dependent.class);
             comp.setConstructor(defineConstructor(clazz));
             newBeanCreator.addConstructorInjectionPointMetaData(comp.getConstructor());
 
@@ -611,7 +607,7 @@ public final class WebBeansUtil
         else if (EJBWebBeansConfigurator.isSessionBean(clazz, webBeansContext))
         {
             comp = new NewManagedBean<T>(clazz, WebBeansType.ENTERPRISE, webBeansContext.getAnnotatedElementFactory().getAnnotatedType(clazz), webBeansContext);
-            comp.setImplScopeType(new DependentScopeLiteral());
+            comp.setImplScopeType(Dependent.class);
         }
         else
         {
@@ -659,7 +655,7 @@ public final class WebBeansUtil
     {
         BeanManagerBean managerComponent = new BeanManagerBean(webBeansContext);
 
-        managerComponent.setImplScopeType(new DependentScopeLiteral());
+        managerComponent.setImplScopeType(Dependent.class);
         managerComponent.addQualifier(new DefaultLiteral());
         managerComponent.addQualifier(new AnyLiteral());
         managerComponent.addApiType(BeanManager.class);
@@ -682,7 +678,7 @@ public final class WebBeansUtil
         instanceBean.addApiType(Object.class);
 
         instanceBean.addQualifier(new AnyLiteral());
-        instanceBean.setImplScopeType(new DependentScopeLiteral());
+        instanceBean.setImplScopeType(Dependent.class);
         instanceBean.setName(null);
 
         return instanceBean;
@@ -701,7 +697,7 @@ public final class WebBeansUtil
         eventBean.addApiType(Object.class);
 
         eventBean.addQualifier(new AnyLiteral());
-        eventBean.setImplScopeType(new DependentScopeLiteral());
+        eventBean.setImplScopeType(Dependent.class);
         eventBean.setName(null);
 
         return eventBean;
@@ -720,7 +716,7 @@ public final class WebBeansUtil
         conversationComp.addApiType(Conversation.class);
         conversationComp.addApiType(ConversationImpl.class);
         conversationComp.addApiType(Object.class);
-        conversationComp.setImplScopeType(new RequestedScopeLiteral());
+        conversationComp.setImplScopeType(RequestScoped.class);
         conversationComp.addQualifier(new DefaultLiteral());
         conversationComp.addQualifier(new AnyLiteral());
         conversationComp.setName("javax.enterprise.context.conversation");
@@ -1701,85 +1697,7 @@ public final class WebBeansUtil
         return beans;
     }
 
-    /**
-     * Checks the unproxiable condition.
-     * @param bean managed bean
-     * @param scopeType scope type
-     * @throws WebBeansConfigurationException if
-     *  bean is not proxied by the container
-     */
-    public void checkUnproxiableApiType(Bean<?> bean, Class<? extends Annotation> scopeType)
-    {
-        Asserts.assertNotNull("bean", "bean parameter can not be null");
-        Asserts.assertNotNull(scopeType, "scopeType parameter can not be null");
-
-        //Unproxiable test for NormalScoped beans
-        if (isScopeTypeNormal(scopeType))
-        {
-            ViolationMessageBuilder violationMessage = ViolationMessageBuilder.newViolation();
-
-            Class<?> beanClass;
-            if (bean instanceof OwbBean) 
-            {
-                beanClass = ((OwbBean)bean).getReturnType();
-            }
-            else 
-            {
-                beanClass = bean.getBeanClass();
-            }
-            
-            if(!beanClass.isInterface() && beanClass != Object.class)
-            {
-                if(beanClass.isPrimitive())
-                {
-                    violationMessage.addLine("It isn't possible to proxy a primitive type (" + beanClass.getName(), ")");
-                }
-
-                if(beanClass.isArray())
-                {
-                    violationMessage.addLine("It isn't possible to proxy an array type (", beanClass.getName(), ")");
-                }
-
-                if(!violationMessage.containsViolation())
-                {
-                    if (Modifier.isFinal(beanClass.getModifiers()))
-                    {
-                        violationMessage.addLine(beanClass.getName(), " is a final class! CDI doesn't allow to proxy that.");
-                    }
-
-                    Method[] methods = SecurityUtil.doPrivilegedGetDeclaredMethods(beanClass);
-                    for (Method m : methods)
-                    {
-                        int modifiers = m.getModifiers();
-                        if (Modifier.isFinal(modifiers) && !Modifier.isPrivate(modifiers) &&
-                            !m.isSynthetic() && !m.isBridge())
-                        {
-                            violationMessage.addLine(beanClass.getName(), " has final method "+ m + " CDI doesn't allow to proxy that.");
-                        }
-                    }
-
-                    Constructor<?> cons = getNoArgConstructor(beanClass);
-                    if (cons == null)
-                    {
-                        violationMessage.addLine(beanClass.getName(), " has no explicit no-arg constructor!",
-                                "A public or protected constructor without args is required!");
-                    }
-                    else if (Modifier.isPrivate(cons.getModifiers()))
-                    {
-                        violationMessage.addLine(beanClass.getName(), " has a >private< no-arg constructor! CDI doesn't allow to proxy that.");
-                    }
-                }
-
-                //Throw Exception
-                if(violationMessage.containsViolation())
-                {
-                    throwUnproxyableResolutionException(violationMessage);
-                }
-            }
-        }
-    }
-
-    private <T> Constructor<T> getNoArgConstructor(Class<T> clazz)
+    public <T> Constructor<T> getNoArgConstructor(Class<T> clazz)
     {
         return webBeansContext.getSecurityService().doPrivilegedGetDeclaredConstructor(clazz);
     }

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/TestContext.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/TestContext.java?rev=1429574&r1=1429573&r2=1429574&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/TestContext.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/TestContext.java Sun Jan  6 19:26:23 2013
@@ -539,7 +539,7 @@ public abstract class TestContext implem
         // we fully initialize the bean in this case.
         component.setFullInit(true);
 
-        WebBeansUtil.checkGenericType(component);
+        WebBeansUtil.checkGenericType(managedBeanCreator.getBean());
         managedBeanCreator.defineName();
         managedBeanCreator.defineQualifiers();
 

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/pfield/ProducerFieldComponentTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/pfield/ProducerFieldComponentTest.java?rev=1429574&r1=1429573&r2=1429574&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/pfield/ProducerFieldComponentTest.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/pfield/ProducerFieldComponentTest.java Sun Jan  6 19:26:23 2013
@@ -110,6 +110,7 @@ public class ProducerFieldComponentTest 
             defineManagedBean(TypeVariableProducerField.class);
         }
         catch(Exception caught){
+            caught.printStackTrace();
             System.out.println(caught.getMessage());
             expected = caught;
         }

Modified: openwebbeans/trunk/webbeans-jms/src/main/java/org/apache/webbeans/jms/component/JmsComponentFactory.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-jms/src/main/java/org/apache/webbeans/jms/component/JmsComponentFactory.java?rev=1429574&r1=1429573&r2=1429574&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-jms/src/main/java/org/apache/webbeans/jms/component/JmsComponentFactory.java (original)
+++ openwebbeans/trunk/webbeans-jms/src/main/java/org/apache/webbeans/jms/component/JmsComponentFactory.java Sun Jan  6 19:26:23 2013
@@ -20,6 +20,7 @@ package org.apache.webbeans.jms.componen
 
 import java.lang.annotation.Annotation;
 
+import javax.enterprise.context.Dependent;
 import javax.jms.Queue;
 import javax.jms.QueueConnection;
 import javax.jms.QueueReceiver;
@@ -31,7 +32,6 @@ import javax.jms.TopicPublisher;
 import javax.jms.TopicSession;
 import javax.jms.TopicSubscriber;
 
-import org.apache.webbeans.annotation.DependentScopeLiteral;
 import org.apache.webbeans.jms.JMSModel;
 import org.apache.webbeans.jms.JMSModel.JMSType;
 import org.apache.webbeans.util.Asserts;
@@ -73,7 +73,7 @@ public final class JmsComponentFactory
             component.addApiType(TopicSubscriber.class);
         }
         
-        component.setImplScopeType(new DependentScopeLiteral());
+        component.setImplScopeType(Dependent.class);
         
         Annotation[] anns = model.getBindings();
         



Mime
View raw message