openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gerdo...@apache.org
Subject svn commit: r936393 - /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java
Date Wed, 21 Apr 2010 17:08:20 GMT
Author: gerdogdu
Date: Wed Apr 21 17:08:20 2010
New Revision: 936393

URL: http://svn.apache.org/viewvc?rev=936393&view=rev
Log:
Becasue no more instance fields in InterceptorHandler, we can safely cache proxy instances
for normal scoped beans.

Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java?rev=936393&r1=936392&r2=936393&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java
Wed Apr 21 17:08:20 2010
@@ -114,6 +114,9 @@ public class BeanManagerImpl implements 
 
     /**Activity interceptors*/
     private Set<Interceptor<?>> webBeansInterceptors = new CopyOnWriteArraySet<Interceptor<?>>();
+    
+    /**Normal scoped cache proxies*/
+    private Map<Contextual<?>, Object> cacheProxies = new ConcurrentHashMap<Contextual<?>,
Object>();
 
     /**Activity decorators*/
     private Set<Decorator<?>> webBeansDecorators = new CopyOnWriteArraySet<Decorator<?>>();
@@ -795,6 +798,12 @@ public class BeanManagerImpl implements 
             {
                 return instance;
             }            
+            
+            if(this.cacheProxies.containsKey(bean))
+            {
+                return this.cacheProxies.get(bean);
+            }
+            
             //Create Managed Bean Proxy
             instance = JavassistProxyFactory.createNormalScopedBeanProxy((AbstractOwbBean<?>)bean,creationalContext);
             



Mime
View raw message