openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r1437893 [3/3] - in /openwebbeans/trunk: webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/component/ webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/util/ webbeans-impl/src/main/java/org/apache/webbeans/component/ webbean...
Date Thu, 24 Jan 2013 08:27:27 GMT
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=1437893&r1=1437892&r2=1437893&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
Thu Jan 24 08:27:26 2013
@@ -30,7 +30,9 @@ import java.lang.reflect.Type;
 import java.lang.reflect.TypeVariable;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Collections;
 import java.util.Comparator;
+import java.util.EnumSet;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
@@ -71,6 +73,8 @@ import javax.inject.Inject;
 import javax.inject.Named;
 
 import org.apache.webbeans.annotation.AnnotationManager;
+import org.apache.webbeans.annotation.NewLiteral;
+import org.apache.webbeans.component.BeanAttributesImpl;
 import org.apache.webbeans.component.InjectionTargetBean;
 import org.apache.webbeans.component.AbstractOwbBean;
 import org.apache.webbeans.component.AbstractProducerBean;
@@ -88,14 +92,12 @@ import org.apache.webbeans.component.Owb
 import org.apache.webbeans.component.ProducerFieldBean;
 import org.apache.webbeans.component.ProducerMethodBean;
 import org.apache.webbeans.component.ResourceBean;
+import org.apache.webbeans.component.WebBeansType;
 import org.apache.webbeans.component.creation.AnnotatedTypeBeanBuilder;
+import org.apache.webbeans.component.creation.BeanAttributesBuilder;
 import org.apache.webbeans.component.creation.ExtensionBeanBuilder;
 import org.apache.webbeans.component.creation.ManagedBeanBuilder;
-import org.apache.webbeans.component.creation.NewEjbBeanBuilder;
-import org.apache.webbeans.component.creation.NewManagedBeanBuilder;
 import org.apache.webbeans.component.creation.ProducerMethodProducerBuilder;
-import org.apache.webbeans.config.EJBWebBeansConfigurator;
-import org.apache.webbeans.config.OWBLogConst;
 import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.container.BeanManagerImpl;
 import org.apache.webbeans.container.InjectionResolver;
@@ -103,7 +105,6 @@ import org.apache.webbeans.exception.Web
 import org.apache.webbeans.exception.inject.DefinitionException;
 import org.apache.webbeans.exception.inject.InconsistentSpecializationException;
 import org.apache.webbeans.inject.AlternativesManager;
-import org.apache.webbeans.logger.WebBeansLoggerFacade;
 import org.apache.webbeans.plugins.PluginLoader;
 import org.apache.webbeans.portable.ProducerFieldProducer;
 import org.apache.webbeans.portable.ProducerMethodProducer;
@@ -426,6 +427,23 @@ public final class WebBeansUtil
         return false;
     }
 
+    public <T> NewManagedBean<T> createNewComponent(Class<T> type)
+    {
+        Asserts.nullCheckForClass(type);
+
+        AnnotatedType<T> annotatedType = webBeansContext.getAnnotatedElementFactory().newAnnotatedType(type);
+        BeanAttributesImpl<T> defaultBeanAttributes = BeanAttributesBuilder.forContext(webBeansContext).newBeanAttibutes(annotatedType).build();
+        BeanAttributesImpl<T> newBeanAttributes = new BeanAttributesImpl<T>(defaultBeanAttributes.getTypes(),
Collections.<Annotation>singleton(new NewLiteral(type)));
+        // TODO replace this by InjectionPointBuilder
+        ManagedBeanBuilder<T, ManagedBean<T>> beanBuilder = new ManagedBeanBuilder<T,
ManagedBean<T>>(webBeansContext, annotatedType, newBeanAttributes);
+        beanBuilder.defineInjectedFields();
+        beanBuilder.defineInjectedMethods();
+        beanBuilder.defineConstructor();
+        NewManagedBean<T> newBean
+            = new NewManagedBean<T>(webBeansContext, WebBeansType.MANAGED, annotatedType,
newBeanAttributes, type, beanBuilder.getBean().getInjectionPoints());
+        return newBean;
+    }
+    
     /**
      * New WebBeans component class.
      *
@@ -433,39 +451,20 @@ public final class WebBeansUtil
      * @param clazz impl. class
      * @return the new component
      */
-    public <T> NewManagedBean<T> createNewComponent(Class<T> clazz, Type
apiType)
+    public <T> NewManagedBean<T> createNewComponent(OwbBean<T> bean, Class<T>
type)
     {
-        Asserts.nullCheckForClass(clazz);
-
-        NewManagedBean<T> comp;
-
-        if (webBeansContext.getWebBeansUtil().isManagedBean(clazz))
-        {
-            NewManagedBeanBuilder<T> newBeanCreator
-                = new NewManagedBeanBuilder<T>(webBeansContext, webBeansContext.getAnnotatedElementFactory().newAnnotatedType(clazz));
-            newBeanCreator.defineApiType();
-            newBeanCreator.defineScopeType("");
-            newBeanCreator.defineConstructor();
-            newBeanCreator.defineInjectedFields();
-            newBeanCreator.defineInjectedMethods();
-            newBeanCreator.defineDisposalMethods();
-            comp = newBeanCreator.getBean();
-        }
-        else if (EJBWebBeansConfigurator.isSessionBean(clazz, webBeansContext))
-        {
-            NewEjbBeanBuilder<T> newBeanCreator
-                = new NewEjbBeanBuilder<T>(webBeansContext, webBeansContext.getAnnotatedElementFactory().newAnnotatedType(clazz));
-            newBeanCreator.defineApiType();
-            newBeanCreator.defineInjectedFields();
-            newBeanCreator.defineInjectedMethods();
-            comp = newBeanCreator.getBean();
-        }
-        else
+        Asserts.assertNotNull(bean, "bean may not be null");
+        if (!EnumSet.of(WebBeansType.MANAGED, WebBeansType.ENTERPRISE, WebBeansType.PRODUCERMETHOD,
WebBeansType.PRODUCERFIELD).contains(bean.getWebBeansType()))
         {
-            throw new WebBeansConfigurationException("@New annotation on type : " + clazz.getName()
-                                                     + " must defined as a simple or an enterprise
web bean");
+            throw new WebBeansConfigurationException("@New annotation on type : " + bean.getBeanClass()
+                    + " must defined as a simple or an enterprise web bean");
         }
-        return comp;
+
+        AnnotatedType<T> annotatedType = webBeansContext.getAnnotatedElementFactory().newAnnotatedType(type);
+        BeanAttributesImpl<T> newBeanAttributes = new BeanAttributesImpl<T>(bean.getTypes(),
Collections.<Annotation>singleton(new NewLiteral(type)));
+        NewManagedBean<T> newBean = new NewManagedBean<T>(bean.getWebBeansContext(),
bean.getWebBeansType(), annotatedType, newBeanAttributes, type, bean.getInjectionPoints());
+        //TODO XXX set producer
+        return newBean;
     }
 
     /**
@@ -1597,24 +1596,12 @@ public final class WebBeansUtil
      */
     public <T> ManagedBean<T> defineManagedBeanWithoutFireEvents(AnnotatedType<T>
type)
     {
-        Class<T> clazz = type.getJavaClass();
-
-        ManagedBeanBuilder<T, ManagedBean<T>> managedBeanCreator = new ManagedBeanBuilder<T,
ManagedBean<T>>(webBeansContext, type);
-
-        managedBeanCreator.defineApiType();
-
-        //Define meta-data
-        managedBeanCreator.defineStereoTypes();
-
-        //Scope type
-        managedBeanCreator.defineScopeType(WebBeansLoggerFacade.getTokenString(OWBLogConst.TEXT_MB_IMPL)
+ clazz.getName() +
-                WebBeansLoggerFacade.getTokenString(OWBLogConst.TEXT_SAME_SCOPE));
+        BeanAttributesImpl<T> beanAttributes = BeanAttributesBuilder.forContext(webBeansContext).newBeanAttibutes(type).build();
+        ManagedBeanBuilder<T, ManagedBean<T>> managedBeanCreator = new ManagedBeanBuilder<T,
ManagedBean<T>>(webBeansContext, type, beanAttributes);
 
         //Check for Enabled via Alternative
         setInjectionTargetBeanEnableFlag(managedBeanCreator.getBean());
         managedBeanCreator.checkCreateConditions();
-        managedBeanCreator.defineName();
-        managedBeanCreator.defineQualifiers();
         managedBeanCreator.defineConstructor();
         managedBeanCreator.defineInjectedFields();
         managedBeanCreator.defineInjectedMethods();
@@ -1746,22 +1733,12 @@ public final class WebBeansUtil
     {
         Class<T> clazz = type.getJavaClass();
 
-        AnnotatedTypeBeanBuilder<T> managedBeanCreator = new AnnotatedTypeBeanBuilder<T>(type,
webBeansContext);
-
-        managedBeanCreator.defineApiType();
-
-        //Define meta-data
-        managedBeanCreator.defineStereoTypes();
-
-        //Scope type
-        managedBeanCreator.defineScopeType(WebBeansLoggerFacade.getTokenString(OWBLogConst.TEXT_MB_IMPL)
+ clazz.getName()
-                                           + WebBeansLoggerFacade.getTokenString(OWBLogConst.TEXT_SAME_SCOPE));
+        BeanAttributesImpl<T> beanAttributes = BeanAttributesBuilder.forContext(webBeansContext).newBeanAttibutes(type).build();
+        AnnotatedTypeBeanBuilder<T> managedBeanCreator = new AnnotatedTypeBeanBuilder<T>(type,
webBeansContext, beanAttributes);
 
         //Check for Enabled via Alternative
         managedBeanCreator.defineEnabled();
         managedBeanCreator.checkCreateConditions();
-        managedBeanCreator.defineName();
-        managedBeanCreator.defineQualifiers();
         managedBeanCreator.defineConstructor();
         managedBeanCreator.defineInjectedFields();
         managedBeanCreator.defineInjectedMethods();

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/resolution/CdiInterceptorBeanBuilderTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/resolution/CdiInterceptorBeanBuilderTest.java?rev=1437893&r1=1437892&r2=1437893&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/resolution/CdiInterceptorBeanBuilderTest.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/resolution/CdiInterceptorBeanBuilderTest.java
Thu Jan 24 08:27:26 2013
@@ -26,7 +26,9 @@ import javax.enterprise.inject.spi.Inter
 import java.util.ArrayList;
 import java.util.Collection;
 
+import org.apache.webbeans.component.BeanAttributesImpl;
 import org.apache.webbeans.component.InterceptorBean;
+import org.apache.webbeans.component.creation.BeanAttributesBuilder;
 import org.apache.webbeans.component.creation.CdiInterceptorBeanBuilder;
 import org.apache.webbeans.newtests.AbstractUnitTest;
 import org.apache.webbeans.newtests.interceptors.factory.beans.ClassInterceptedClass;
@@ -65,17 +67,19 @@ public class CdiInterceptorBeanBuilderTe
         {
             // take an Interceptor class which is not listed in beans.xml and verify that
is is not enabled
             AnnotatedType<SecureAndTransactionalInterceptor> annotatedType = getBeanManager().createAnnotatedType(SecureAndTransactionalInterceptor.class);
+            BeanAttributesImpl<SecureAndTransactionalInterceptor> beanAttributes =
BeanAttributesBuilder.forContext(getWebBeansContext()).newBeanAttibutes(annotatedType).build();
 
             CdiInterceptorBeanBuilder<SecureAndTransactionalInterceptor> ibb
-                    = new CdiInterceptorBeanBuilder<SecureAndTransactionalInterceptor>(getWebBeansContext(),
annotatedType);
+                    = new CdiInterceptorBeanBuilder<SecureAndTransactionalInterceptor>(getWebBeansContext(),
annotatedType, beanAttributes);
             Assert.assertFalse(ibb.isInterceptorEnabled());
         }
 
         {
             AnnotatedType<TransactionalInterceptor> annotatedType = getBeanManager().createAnnotatedType(TransactionalInterceptor.class);
+            BeanAttributesImpl<TransactionalInterceptor> beanAttributes = BeanAttributesBuilder.forContext(getWebBeansContext()).newBeanAttibutes(annotatedType).build();
 
             CdiInterceptorBeanBuilder<TransactionalInterceptor> ibb
-                    = new CdiInterceptorBeanBuilder<TransactionalInterceptor>(getWebBeansContext(),
annotatedType);
+                    = new CdiInterceptorBeanBuilder<TransactionalInterceptor>(getWebBeansContext(),
annotatedType, beanAttributes);
             ibb.defineCdiInterceptorRules();
             Interceptor<TransactionalInterceptor> bean = ibb.getBean();
             Assert.assertNotNull(bean);
@@ -107,9 +111,10 @@ public class CdiInterceptorBeanBuilderTe
         startContainer(beanClasses, beanXmls);
 
         AnnotatedType<TestInterceptor1> annotatedType = getBeanManager().createAnnotatedType(TestInterceptor1.class);
+        BeanAttributesImpl<TestInterceptor1> beanAttributes = BeanAttributesBuilder.forContext(getWebBeansContext()).newBeanAttibutes(annotatedType).build();
 
         CdiInterceptorBeanBuilder<TestInterceptor1> ibb
-                = new CdiInterceptorBeanBuilder<TestInterceptor1>(getWebBeansContext(),
annotatedType);
+                = new CdiInterceptorBeanBuilder<TestInterceptor1>(getWebBeansContext(),
annotatedType, beanAttributes);
         ibb.defineCdiInterceptorRules();
         InterceptorBean<TestInterceptor1> bean = ibb.getBean();
         Assert.assertNotNull(bean);

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/resolution/EjbInterceptorBeanBuilderTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/resolution/EjbInterceptorBeanBuilderTest.java?rev=1437893&r1=1437892&r2=1437893&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/resolution/EjbInterceptorBeanBuilderTest.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/resolution/EjbInterceptorBeanBuilderTest.java
Thu Jan 24 08:27:26 2013
@@ -25,7 +25,9 @@ import javax.enterprise.inject.spi.Inter
 import java.util.ArrayList;
 import java.util.Collection;
 
+import org.apache.webbeans.component.BeanAttributesImpl;
 import org.apache.webbeans.component.InterceptorBean;
+import org.apache.webbeans.component.creation.BeanAttributesBuilder;
 import org.apache.webbeans.component.creation.EjbInterceptorBeanBuilder;
 import org.apache.webbeans.newtests.AbstractUnitTest;
 
@@ -53,8 +55,9 @@ public class EjbInterceptorBeanBuilderTe
 
         AnnotatedType<EjbInterceptor> annotatedType = getBeanManager().createAnnotatedType(EjbInterceptor.class);
 
+        BeanAttributesImpl<EjbInterceptor> beanAttributes = BeanAttributesBuilder.forContext(getWebBeansContext()).newBeanAttibutes(annotatedType).build();
         EjbInterceptorBeanBuilder<EjbInterceptor> ibb
-                = new EjbInterceptorBeanBuilder<EjbInterceptor>(getWebBeansContext(),
annotatedType);
+                = new EjbInterceptorBeanBuilder<EjbInterceptor>(getWebBeansContext(),
annotatedType, beanAttributes);
         ibb.defineEjbInterceptorRules();
         InterceptorBean<EjbInterceptor> bean = ibb.getBean();
         Assert.assertNotNull(bean);

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/resolution/SelfInterceptorBeanBuilderTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/resolution/SelfInterceptorBeanBuilderTest.java?rev=1437893&r1=1437892&r2=1437893&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/resolution/SelfInterceptorBeanBuilderTest.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/resolution/SelfInterceptorBeanBuilderTest.java
Thu Jan 24 08:27:26 2013
@@ -22,7 +22,9 @@ import javax.enterprise.inject.spi.Annot
 import java.util.ArrayList;
 import java.util.Collection;
 
+import org.apache.webbeans.component.BeanAttributesImpl;
 import org.apache.webbeans.component.InterceptorBean;
+import org.apache.webbeans.component.creation.BeanAttributesBuilder;
 import org.apache.webbeans.component.creation.SelfInterceptorBeanBuilder;
 import org.apache.webbeans.newtests.AbstractUnitTest;
 import org.apache.webbeans.newtests.interceptors.resolution.interceptors.SelfInterceptedClass;
@@ -45,8 +47,10 @@ public class SelfInterceptorBeanBuilderT
 
         AnnotatedType<SelfInterceptedClass> annotatedType = getBeanManager().createAnnotatedType(SelfInterceptedClass.class);
 
+        BeanAttributesImpl<SelfInterceptedClass> beanAttributes = BeanAttributesBuilder.forContext(getWebBeansContext()).newBeanAttibutes(annotatedType).build();
+
         SelfInterceptorBeanBuilder<SelfInterceptedClass> ibb
-                = new SelfInterceptorBeanBuilder<SelfInterceptedClass>(getWebBeansContext(),
annotatedType);
+                = new SelfInterceptorBeanBuilder<SelfInterceptedClass>(getWebBeansContext(),
annotatedType, beanAttributes);
         ibb.defineSelfInterceptorRules();
         InterceptorBean<SelfInterceptedClass> bean = ibb.getBean();
         Assert.assertNotNull(bean);

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=1437893&r1=1437892&r2=1437893&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
Thu Jan 24 08:27:26 2013
@@ -40,6 +40,7 @@ import javax.enterprise.inject.spi.BeanM
 import javax.interceptor.Interceptor;
 
 import org.apache.webbeans.component.AbstractOwbBean;
+import org.apache.webbeans.component.BeanAttributesImpl;
 import org.apache.webbeans.component.CdiInterceptorBean;
 import org.apache.webbeans.component.DecoratorBean;
 import org.apache.webbeans.component.InjectionTargetBean;
@@ -48,6 +49,7 @@ import org.apache.webbeans.component.Man
 import org.apache.webbeans.component.ProducerFieldBean;
 import org.apache.webbeans.component.ProducerMethodBean;
 import org.apache.webbeans.component.WebBeansType;
+import org.apache.webbeans.component.creation.BeanAttributesBuilder;
 import org.apache.webbeans.component.creation.CdiInterceptorBeanBuilder;
 import org.apache.webbeans.component.creation.DecoratorBeanBuilder;
 import org.apache.webbeans.component.creation.ManagedBeanBuilder;
@@ -67,6 +69,7 @@ import org.apache.webbeans.test.componen
 import org.apache.webbeans.test.component.decorator.clean.LargeTransactionDecorator;
 import org.apache.webbeans.test.component.decorator.clean.ServiceDecorator;
 import org.apache.webbeans.test.component.intercept.webbeans.ActionInterceptor;
+import org.apache.webbeans.test.component.intercept.webbeans.SecureAndTransactionalInterceptor;
 import org.apache.webbeans.test.component.intercept.webbeans.TransactionalInterceptor2;
 import org.apache.webbeans.test.containertests.ComponentResolutionByTypeTest;
 import org.apache.webbeans.test.mock.MockManager;
@@ -313,8 +316,9 @@ public abstract class TestContext implem
         webBeansContext.getWebBeansUtil().checkManagedBeanCondition(clazz);
 
         webBeansContext.getInterceptorsManager().addEnabledInterceptorClass(clazz);
-        AnnotatedType annotatedType = webBeansContext.getAnnotatedElementFactory().newAnnotatedType(clazz);
-        CdiInterceptorBeanBuilder<T> ibb = new CdiInterceptorBeanBuilder<T>(webBeansContext,
annotatedType);
+        AnnotatedType<T> annotatedType = webBeansContext.getAnnotatedElementFactory().newAnnotatedType(clazz);
+        BeanAttributesImpl<T> beanAttributes = BeanAttributesBuilder.forContext(getWebBeansContext()).newBeanAttibutes(annotatedType).build();
+        CdiInterceptorBeanBuilder<T> ibb = new CdiInterceptorBeanBuilder<T>(webBeansContext,
annotatedType, beanAttributes);
         ibb.defineCdiInterceptorRules();
         CdiInterceptorBean<T> bean = ibb.getBean();
         webBeansContext.getInterceptorsManager().addCdiInterceptor(bean);
@@ -334,7 +338,8 @@ public abstract class TestContext implem
         if (webBeansContext.getDecoratorsManager().isDecoratorEnabled(clazz))
         {
             AnnotatedType<T> annotatedType = webBeansContext.getBeanManagerImpl().createAnnotatedType(clazz);
-            DecoratorBeanBuilder<T> dbb = new DecoratorBeanBuilder<T>(webBeansContext,
annotatedType);
+            BeanAttributesImpl<T> beanAttributes = BeanAttributesBuilder.forContext(webBeansContext).newBeanAttibutes(annotatedType).build();
+            DecoratorBeanBuilder<T> dbb = new DecoratorBeanBuilder<T>(webBeansContext,
annotatedType, beanAttributes);
             dbb.defineDecoratorRules();
 
             DecoratorBean<T> bean = dbb.getBean();
@@ -495,7 +500,7 @@ public abstract class TestContext implem
      * @return the newly created Simple WebBean Component
      * @throws WebBeansConfigurationException if any configuration exception occurs
      */
-    private <T> ManagedBean<T> define(Class<T> clazz, WebBeansType type,
AnnotatedType<T> anntotatedType) throws WebBeansConfigurationException
+    private <T> ManagedBean<T> define(Class<T> clazz, WebBeansType type,
AnnotatedType<T> annotatedType) throws WebBeansConfigurationException
     {
         WebBeansContext webBeansContext = WebBeansContext.currentInstance();
         BeanManagerImpl manager = webBeansContext.getBeanManagerImpl();
@@ -518,16 +523,9 @@ public abstract class TestContext implem
             throw new WebBeansConfigurationException("ManagedBean implementation class :
" + clazz.getName() + " may not _defined as interface");
         }
 
-        ManagedBeanBuilder<T, ManagedBean<T>> managedBeanCreator = new ManagedBeanBuilder<T,
ManagedBean<T>>(webBeansContext, anntotatedType);
-        managedBeanCreator.defineStereoTypes();
-        
-        managedBeanCreator.defineApiType();
-        managedBeanCreator.defineScopeType("Simple WebBean Component implementation class
: " + clazz.getName()
-                + " stereotypes must declare same @Scope annotations");
-        
+        BeanAttributesImpl<T> beanAttributes = BeanAttributesBuilder.forContext(getWebBeansContext()).newBeanAttibutes(annotatedType).build();
+        ManagedBeanBuilder<T, ManagedBean<T>> managedBeanCreator = new ManagedBeanBuilder<T,
ManagedBean<T>>(webBeansContext, annotatedType, beanAttributes);
         managedBeanCreator.checkCreateConditions();
-        managedBeanCreator.defineName();
-        managedBeanCreator.defineQualifiers();
         managedBeanCreator.defineEnabled();
         managedBeanCreator.defineConstructor();
         managedBeanCreator.defineInjectedFields();

Modified: openwebbeans/trunk/webbeans-jms/src/main/java/org/apache/webbeans/jms/component/JmsBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-jms/src/main/java/org/apache/webbeans/jms/component/JmsBean.java?rev=1437893&r1=1437892&r2=1437893&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-jms/src/main/java/org/apache/webbeans/jms/component/JmsBean.java
(original)
+++ openwebbeans/trunk/webbeans-jms/src/main/java/org/apache/webbeans/jms/component/JmsBean.java
Thu Jan 24 08:27:26 2013
@@ -18,15 +18,10 @@
  */
 package org.apache.webbeans.jms.component;
 
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import java.util.Collections;
-import java.util.Set;
-
-import javax.enterprise.context.Dependent;
 import javax.jms.Destination;
 
 import org.apache.webbeans.component.AbstractOwbBean;
+import org.apache.webbeans.component.BeanAttributesImpl;
 import org.apache.webbeans.component.JmsBeanMarker;
 import org.apache.webbeans.component.WebBeansType;
 import org.apache.webbeans.config.WebBeansContext;
@@ -36,9 +31,9 @@ public class JmsBean<T> extends Abstract
 {
     private JMSModel jmsModel = null;
     
-    JmsBean(WebBeansContext webBeansContext, JMSModel jmsModel, Set<Type> types, Set<Annotation>
qualifiers)
+    JmsBean(WebBeansContext webBeansContext, JMSModel jmsModel, BeanAttributesImpl<T>
beanAttributes)
     {
-        super(webBeansContext, WebBeansType.JMS, types, qualifiers, Dependent.class, Destination.class,
Collections.<Class<? extends Annotation>>emptySet());
+        super(webBeansContext, WebBeansType.JMS, beanAttributes, Destination.class);
         this.jmsModel = jmsModel;
     }
         

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=1437893&r1=1437892&r2=1437893&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
Thu Jan 24 08:27:26 2013
@@ -34,6 +34,7 @@ import javax.jms.TopicPublisher;
 import javax.jms.TopicSession;
 import javax.jms.TopicSubscriber;
 
+import org.apache.webbeans.component.BeanAttributesImpl;
 import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.jms.JMSModel;
 import org.apache.webbeans.jms.JMSModel.JMSType;
@@ -84,6 +85,6 @@ public final class JmsComponentFactory
             qualifiers.add(a);
         }
         
-        return new JmsBean<T>(webBeansContext, model, apiTypes, qualifiers);
+        return new JmsBean<T>(webBeansContext, model, new BeanAttributesImpl<T>(apiTypes,
qualifiers));
     }
 }



Mime
View raw message