openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1431301 - 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/creation/ webb...
Date Thu, 10 Jan 2013 11:47:52 GMT
Author: struberg
Date: Thu Jan 10 11:47:51 2013
New Revision: 1431301

URL: http://svn.apache.org/viewvc?rev=1431301&view=rev
Log:
OWB-753 remove lazy bean initialisation

Modified:
    openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/component/EjbBeanBuilder.java
    openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/util/EjbUtility.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/AbstractBeanBuilder.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/AbstractInjectionTargetBeanBuilder.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/ManagedBeanBuilder.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.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

Modified: openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/component/EjbBeanBuilder.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/component/EjbBeanBuilder.java?rev=1431301&r1=1431300&r2=1431301&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/component/EjbBeanBuilder.java
(original)
+++ openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/component/EjbBeanBuilder.java
Thu Jan 10 11:47:51 2013
@@ -48,14 +48,11 @@ public class EjbBeanBuilder<T> extends A
     {        
         EjbValidator.validateDecoratorOrInterceptor(getBeanType());
     }
-    
-    /**
-     * {@inheritDoc}
-     */
+
     @Override
     public void defineScopeType(String errorMessage, boolean allowLazyInit)
     {
-        super.defineScopeType(errorMessage, allowLazyInit);
+        super.defineScopeType(errorMessage);
 
         EjbValidator.validateEjbScopeType(getBean());
         EjbValidator.validateGenericBeanType(getBeanType(), getScope());

Modified: openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/util/EjbUtility.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/util/EjbUtility.java?rev=1431301&r1=1431300&r2=1431301&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/util/EjbUtility.java
(original)
+++ openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/util/EjbUtility.java
Thu Jan 10 11:47:51 2013
@@ -80,7 +80,7 @@ public final class EjbUtility
         ejbBeanCreator.defineSerializable();
         ejbBeanCreator.defineStereoTypes();
         ejbBeanCreator.defineApiType();
-        ejbBeanCreator.defineScopeType("Session Bean implementation class : " + clazz.getName()
+ " stereotypes must declare same @ScopeType annotations", false);
+        ejbBeanCreator.defineScopeType("Session Bean implementation class : " + clazz.getName()
+ " stereotypes must declare same @ScopeType annotations");
         ejbBeanCreator.defineName();            
         ejbBeanCreator.defineQualifiers();
         Set<ProducerMethodBean<?>> producerMethodBeans = ejbBeanCreator.defineProducerMethods();
       

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/AbstractBeanBuilder.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/AbstractBeanBuilder.java?rev=1431301&r1=1431300&r2=1431301&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/AbstractBeanBuilder.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/AbstractBeanBuilder.java
Thu Jan 10 11:47:51 2013
@@ -264,7 +264,6 @@ public abstract class AbstractBeanBuilde
     /**
      * Returns true if any binding exist
      * 
-     * @param bean bean
      * @return true if any binding exist
      */
     private boolean hasAnyQualifier()
@@ -272,8 +271,13 @@ public abstract class AbstractBeanBuilde
         return AnnotationUtil.getAnnotation(qualifiers, Any.class) != null;
     }
 
+    public void defineScopeType(String errorMessage)
+    {
+        defineScopeType(errorMessage, false);
+    }
+
     /**
-     * {@inheritDoc}
+     * @deprecated as we need to get rid of allowLazyInit
      */
     public void defineScopeType(String errorMessage, boolean allowLazyInit)
     {
@@ -459,10 +463,7 @@ public abstract class AbstractBeanBuilde
 
     /**
      * Checks the unproxiable condition.
-     * @param bean managed bean
-     * @param scopeType scope type
-     * @throws WebBeansConfigurationException if
-     *  bean is not proxied by the container
+     * @throws WebBeansConfigurationException if bean is not proxied by the container
      */
     protected void checkUnproxiableApiType()
     {

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/AbstractInjectionTargetBeanBuilder.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/AbstractInjectionTargetBeanBuilder.java?rev=1431301&r1=1431300&r2=1431301&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/AbstractInjectionTargetBeanBuilder.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/AbstractInjectionTargetBeanBuilder.java
Thu Jan 10 11:47:51 2013
@@ -504,7 +504,7 @@ public abstract class AbstractInjectionT
                     {
                         producerFieldBean.getTypes().addAll(annotatedField.getTypeClosure());
                     }
-                    producerFieldBeanCreator.defineScopeType("Annotated producer field: "
+ annotatedField +  "must declare default @Scope annotation", false);
+                    producerFieldBeanCreator.defineScopeType("Annotated producer field: "
+ annotatedField +  "must declare default @Scope annotation");
                     producerFieldBeanCreator.checkUnproxiableApiType();
                     WebBeansUtil.checkProducerGenericType(producerFieldBean,annotatedField.getJavaMember());
                     producerFieldBeanCreator.defineQualifiers();
@@ -573,7 +573,7 @@ public abstract class AbstractInjectionT
                     producerMethodBean.getTypes().addAll(annotatedMethod.getTypeClosure());
                 }
                 producerMethodBeanCreator.defineScopeType("Annotated producer method : "
+ annotatedMethod
-                                                          +  "must declare default @Scope
annotation", false);
+                                                          +  "must declare default @Scope
annotation");
                 producerMethodBeanCreator.checkUnproxiableApiType();
                 WebBeansUtil.checkProducerGenericType(producerMethodBeanCreator.getBean(),
annotatedMethod.getJavaMember());
                 producerMethodBeanCreator.defineName(WebBeansUtil.getProducerDefaultName(annotatedMethod.getJavaMember().getName()));

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/ManagedBeanBuilder.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/ManagedBeanBuilder.java?rev=1431301&r1=1431300&r2=1431301&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/ManagedBeanBuilder.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/ManagedBeanBuilder.java
Thu Jan 10 11:47:51 2013
@@ -118,6 +118,9 @@ public class ManagedBeanBuilder<T> exten
         return bean;
     }
 
+    /**
+     * @deprecated makes no sense as only Beans without any annotations are lazy inited.
And they don'T have anything to handle...
+     */
     public static <T> void lazyInitializeManagedBean(ManagedBean<T> bean)
     {
         ManagedBeanBuilder<T> managedBeanCreator = new ManagedBeanBuilder<T>(bean,
bean.getScope());
@@ -125,6 +128,9 @@ public class ManagedBeanBuilder<T> exten
         managedBeanCreator.lazyInitializeManagedBean(bean.getBeanClass(), bean);
     }
 
+    /**
+     * @deprecated makes no sense as only Beans without any annotations are lazy inited.
And they don'T have anything to handle...
+     */
     public void lazyInitializeManagedBean(Class<?> clazz, ManagedBean<?> managedBean)
     {
         defineConstructor();
@@ -139,7 +145,7 @@ public class ManagedBeanBuilder<T> exten
         defineDisposalMethods(); //Define disposal method after adding producers
     }
 
-    public ManagedBean<T> defineManagedBean(ProcessInjectionTarget<T> processInjectionTargetEvent,
boolean allowLazyInit)
+    public ManagedBean<T> defineManagedBean(ProcessInjectionTarget<T> processInjectionTargetEvent)
     {
         //Annotated type
         AnnotatedType<T> annotatedType = processInjectionTargetEvent.getAnnotatedType();
@@ -153,7 +159,7 @@ public class ManagedBeanBuilder<T> exten
         defineStereoTypes();
         //Scope type
         defineScopeType(WebBeansLoggerFacade.getTokenString(OWBLogConst.TEXT_MB_IMPL) + clazz.getName()
+
-                WebBeansLoggerFacade.getTokenString(OWBLogConst.TEXT_SAME_SCOPE), allowLazyInit);
+                WebBeansLoggerFacade.getTokenString(OWBLogConst.TEXT_SAME_SCOPE));
 
         defineSerializable();
 
@@ -291,7 +297,7 @@ public class ManagedBeanBuilder<T> exten
             ManagedBean<T> component;
 
             webBeansContext.getInterceptorUtil().checkInterceptorConditions(annotatedType);
-            component = defineManagedBean(injectionTargetEvent, false);
+            component = defineManagedBean(injectionTargetEvent);
 
             if (component != null)
             {
@@ -412,7 +418,7 @@ public class ManagedBeanBuilder<T> exten
             }
             else
             {
-                delegate = defineManagedBean(processInjectionTargetEvent, false);
+                delegate = defineManagedBean(processInjectionTargetEvent);
             }
 
             if (delegate != null)
@@ -436,7 +442,7 @@ public class ManagedBeanBuilder<T> exten
     private ManagedBean<T> defineAbstractDecorator(ProcessInjectionTarget<T>
processInjectionTargetEvent)
     {
 
-        ManagedBean<T> bean = defineManagedBean(processInjectionTargetEvent, false);
+        ManagedBean<T> bean = defineManagedBean(processInjectionTargetEvent);
         if (bean == null)
         {
             // TODO could probably be a bit more descriptive

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java?rev=1431301&r1=1431300&r2=1431301&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java
Thu Jan 10 11:47:51 2013
@@ -889,7 +889,7 @@ public class BeansDeployer
                 {
                     logger.log(Level.FINE, "Found Managed Bean with class name : [{0}]",
annotatedType.getJavaClass().getName());
                 }
-                managedBeanCreator.defineManagedBean(processInjectionTargetEvent, true);
+                managedBeanCreator.defineManagedBean(processInjectionTargetEvent);
             }
 
             if(processInjectionTarget != null)

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=1431301&r1=1431300&r2=1431301&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 10 11:47:51 2013
@@ -2342,7 +2342,7 @@ public final class WebBeansUtil
 
         //Scope type
         managedBeanCreator.defineScopeType(WebBeansLoggerFacade.getTokenString(OWBLogConst.TEXT_MB_IMPL)
+ clazz.getName() +
-                WebBeansLoggerFacade.getTokenString(OWBLogConst.TEXT_SAME_SCOPE), false);
+                WebBeansLoggerFacade.getTokenString(OWBLogConst.TEXT_SAME_SCOPE));
 
         managedBeanCreator.defineSerializable();
 
@@ -2486,7 +2486,7 @@ public final class WebBeansUtil
 
         //Scope type
         managedBeanCreator.defineScopeType(WebBeansLoggerFacade.getTokenString(OWBLogConst.TEXT_MB_IMPL)
+ clazz.getName()
-                                           + WebBeansLoggerFacade.getTokenString(OWBLogConst.TEXT_SAME_SCOPE),
false);
+                                           + WebBeansLoggerFacade.getTokenString(OWBLogConst.TEXT_SAME_SCOPE));
 
         managedBeanCreator.defineSerializable();
 

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=1431301&r1=1431300&r2=1431301&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 10 11:47:51 2013
@@ -534,7 +534,7 @@ public abstract class TestContext implem
 
         defineApiTypes(component, clazz);
         managedBeanCreator.defineScopeType("Simple WebBean Component implementation class
: " + clazz.getName()
-                                           + " stereotypes must declare same @Scope annotations",
false);
+                                           + " stereotypes must declare same @Scope annotations");
         // we fully initialize the bean in this case.
         component.setFullInit(true);
 



Mime
View raw message