You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwebbeans.apache.org by st...@apache.org on 2012/07/15 12:29:12 UTC

svn commit: r1361680 - /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DelegateHandler.java

Author: struberg
Date: Sun Jul 15 10:29:12 2012
New Revision: 1361680

URL: http://svn.apache.org/viewvc?rev=1361680&view=rev
Log:
OWB-672 the actual instance gets passed. We do not need to serialize it

We should actually get rid of all the actualInstance storing. 
This is just needed because we wrongly inject the decorated instance
via proxy and not directly atm.

Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DelegateHandler.java

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DelegateHandler.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DelegateHandler.java?rev=1361680&r1=1361679&r2=1361680&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DelegateHandler.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DelegateHandler.java Sun Jul 15 10:29:12 2012
@@ -46,7 +46,7 @@ public class DelegateHandler implements 
     private transient List<Object> decorators;
     private transient int position = 0;
 
-    private transient Object actualBean = null;
+    private transient Object actualInstance = null;
     
     private transient OwbBean<?> bean = null;
     
@@ -72,9 +72,9 @@ public class DelegateHandler implements 
     public Object invoke(Object instance, Method method, Method proceed, Object[] arguments) throws Exception
     {
         // Tuck away a reference to the bean being Decorated
-        if (actualBean == null)
+        if (actualInstance == null)
         {
-            actualBean = instance;
+            actualInstance = instance;
         }
 
         while (position < decorators.size())
@@ -151,7 +151,7 @@ public class DelegateHandler implements 
         
         if(!(bean instanceof EnterpriseBeanMarker))
         {
-            result = method.invoke(actualBean, arguments);
+            result = method.invoke(actualInstance, arguments);
         }
         else
         {
@@ -219,7 +219,6 @@ public class DelegateHandler implements 
         if (id != null) 
         {
             out.writeObject(id);
-            out.writeObject(actualBean);
             out.writeObject(decorators);
         }
         else 
@@ -239,7 +238,6 @@ public class DelegateHandler implements 
             return;
         }
         bean = (OwbBean<?>) WebBeansContext.currentInstance().getBeanManagerImpl().getPassivationCapableBean(id);
-        actualBean = in.readObject();
         decorators = (List<Object>) in.readObject();
     }    
 }