openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r1428806 - in /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans: component/ManagedBean.java component/creation/ManagedBeanCreatorImpl.java util/WebBeansUtil.java
Date Fri, 04 Jan 2013 11:46:57 GMT
Author: arne
Date: Fri Jan  4 11:46:57 2013
New Revision: 1428806

URL: http://svn.apache.org/viewvc?rev=1428806&view=rev
Log:
OWB-745: Made constructor private

Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ManagedBean.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/util/WebBeansUtil.java

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ManagedBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ManagedBean.java?rev=1428806&r1=1428805&r2=1428806&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ManagedBean.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ManagedBean.java
Fri Jan  4 11:46:57 2013
@@ -108,9 +108,7 @@ public class ManagedBean<T> extends Abst
         if (!fullInit)
         {
             fullInit = true;
-            ManagedBeanCreatorImpl<T> managedBeanCreator = new ManagedBeanCreatorImpl<T>(this);
-
-            managedBeanCreator.lazyInitializeManagedBean(getBeanClass(), this);
+            ManagedBeanCreatorImpl.lazyInitializeManagedBean(this);
         }
     }
 

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=1428806&r1=1428805&r2=1428806&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
Fri Jan  4 11:46:57 2013
@@ -67,11 +67,10 @@ public class ManagedBeanCreatorImpl<T> e
      */
     public ManagedBeanCreatorImpl(AnnotatedType<T> annotatedType, WebBeansContext webBeansContext)
     {
-        super(new ManagedBean<T>(annotatedType.getJavaClass(), annotatedType, webBeansContext));
-        this.webBeansContext = webBeansContext;
+        this(new ManagedBean<T>(annotatedType.getJavaClass(), annotatedType, webBeansContext));
     }
     
-    public ManagedBeanCreatorImpl(ManagedBean<T> managedBean)
+    private ManagedBeanCreatorImpl(ManagedBean<T> managedBean)
     {
         super(managedBean);
         webBeansContext = managedBean.getWebBeansContext();
@@ -128,6 +127,13 @@ public class ManagedBeanCreatorImpl<T> e
         return (ManagedBean<T>)super.getBean();
     }
 
+    public static <T> void lazyInitializeManagedBean(ManagedBean<T> bean)
+    {
+        ManagedBeanCreatorImpl<T> managedBeanCreator = new ManagedBeanCreatorImpl<T>(bean);
+
+        managedBeanCreator.lazyInitializeManagedBean(bean.getBeanClass(), bean);
+    }
+
     public void lazyInitializeManagedBean(Class<?> clazz, ManagedBean<?> managedBean)
     {
         defineConstructor();

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=1428806&r1=1428805&r2=1428806&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
Fri Jan  4 11:46:57 2013
@@ -2526,8 +2526,7 @@ public final class WebBeansUtil
     {
         Class<T> clazz = type.getJavaClass();
 
-        ManagedBean<T> managedBean = new ManagedBean<T>(clazz,WebBeansType.MANAGED,
type, webBeansContext);
-        ManagedBeanCreatorImpl<T> managedBeanCreator = new ManagedBeanCreatorImpl<T>(managedBean);
+        ManagedBeanCreatorImpl<T> managedBeanCreator = new ManagedBeanCreatorImpl<T>(type,
webBeansContext);
 
         managedBeanCreator.defineApiType();
 
@@ -2541,7 +2540,7 @@ public final class WebBeansUtil
         managedBeanCreator.defineSerializable();
 
         //Check for Enabled via Alternative
-        setInjectionTargetBeanEnableFlag(managedBean);
+        setInjectionTargetBeanEnableFlag(managedBeanCreator.getBean());
         managedBeanCreator.checkCreateConditions();
         managedBeanCreator.defineName(WebBeansUtil.getManagedBeanDefaultName(clazz.getSimpleName()));
         managedBeanCreator.defineQualifier();
@@ -2553,12 +2552,12 @@ public final class WebBeansUtil
         managedBeanCreator.defineObserverMethods();
 
         DefinitionUtil definitionUtil = webBeansContext.getDefinitionUtil();
-        definitionUtil.defineDecoratorStack(managedBean);
-        definitionUtil.defineBeanInterceptorStack(managedBean);
+        definitionUtil.defineDecoratorStack(managedBeanCreator.getBean());
+        definitionUtil.defineBeanInterceptorStack(managedBeanCreator.getBean());
 
         managedBeanCreator.defineDisposalMethods();//Define disposal method after adding
producers
 
-        return managedBean;
+        return managedBeanCreator.getBean();
     }
 
 



Mime
View raw message