[weld-commits] Weld SVN: r5367 - core/trunk/impl/src/main/java/org/jboss/weld/bean.

weld-commits at lists.jboss.org weld-commits at lists.jboss.org
Thu Dec 24 09:29:15 EST 2009


Author: dallen6
Date: 2009-12-24 09:29:14 -0500 (Thu, 24 Dec 2009)
New Revision: 5367

Modified:
   core/trunk/impl/src/main/java/org/jboss/weld/bean/ManagedBean.java
Log:
WELD-313

Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/ManagedBean.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/ManagedBean.java	2009-12-24 08:28:18 UTC (rev 5366)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/ManagedBean.java	2009-12-24 14:29:14 UTC (rev 5367)
@@ -140,14 +140,7 @@
    {
       T instance = getInjectionTarget().produce(creationalContext);
       getInjectionTarget().inject(instance, creationalContext);
-      if (isInterceptionCandidate() && (hasCdiBoundInterceptors() || hasDirectlyDefinedInterceptors()))
-      {
-         InterceptionUtils.executePostConstruct(instance);
-      }
-      else
-      {
-         getInjectionTarget().postConstruct(instance);
-      }
+      getInjectionTarget().postConstruct(instance);
       return instance;
    }
 
@@ -171,14 +164,7 @@
    {
       try
       {
-         if (!isInterceptionCandidate() || !(hasCdiBoundInterceptors() || hasDirectlyDefinedInterceptors()))
-         {
-            getInjectionTarget().preDestroy(instance);
-         }
-         else
-         {
-            InterceptionUtils.executePredestroy(instance);
-         }
+         getInjectionTarget().preDestroy(instance);
          creationalContext.release();
       }
       catch (Exception e)
@@ -225,12 +211,26 @@
 
             public void postConstruct(T instance)
             {
-               defaultPostConstruct(instance);
+               if (isInterceptionCandidate() && (hasCdiBoundInterceptors() || hasDirectlyDefinedInterceptors()))
+               {
+                  InterceptionUtils.executePostConstruct(instance);
+               }
+               else
+               {
+                  defaultPostConstruct(instance);
+               }
             }
 
             public void preDestroy(T instance)
             {
-               defaultPreDestroy(instance);
+               if (!isInterceptionCandidate() || !(hasCdiBoundInterceptors() || hasDirectlyDefinedInterceptors()))
+               {
+                  defaultPreDestroy(instance);
+               }
+               else
+               {
+                  InterceptionUtils.executePredestroy(instance);
+               }
             }
 
             public void dispose(T instance)



More information about the weld-commits mailing list