openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1080801 - /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ManagedBean.java
Date Fri, 11 Mar 2011 23:47:14 GMT
Author: struberg
Date: Fri Mar 11 23:47:14 2011
New Revision: 1080801

URL: http://svn.apache.org/viewvc?rev=1080801&view=rev
Log:
OWB-503 cache isBeanSerializable information

Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ManagedBean.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=1080801&r1=1080800&r2=1080801&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 Mar 11 23:47:14 2011
@@ -159,16 +159,21 @@ public class ManagedBean<T> extends Abst
     
     public boolean isPassivationCapable()
     {
+        if (isPassivationCapable != null)
+        {
+            return isPassivationCapable.booleanValue();
+        }
         if(Serializable.class.isAssignableFrom(this.returnType))
         {
             for(Decorator<?> dec : this.decorators)
             {
                 if(dec.getBeanClass() != null && !Serializable.class.isAssignableFrom(dec.getBeanClass()))
                 {
+                    isPassivationCapable = Boolean.FALSE;
                     return false;
                 }
             }
-            
+
             for(InterceptorData interceptorData : this.interceptorStack)
             {
                 if(interceptorData.isDefinedInInterceptorClass())
@@ -176,16 +181,22 @@ public class ManagedBean<T> extends Abst
                     Class<?> interceptor = interceptorData.getInterceptorClass();
                     if(!Serializable.class.isAssignableFrom(interceptor))
                     {
+                        isPassivationCapable = Boolean.FALSE;
                         return false;
-                    }                    
+                    }
                 }
             }
-            
+
+            isPassivationCapable = Boolean.TRUE;
             return true;
         }
-        
+
+        isPassivationCapable = Boolean.FALSE;
         return false;
     }
+
+    /** cache previously calculated result */
+    private Boolean isPassivationCapable = null;
     
     public void setIsAbstractDecorator(boolean flag)
     {



Mime
View raw message