openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gerdo...@apache.org
Subject svn commit: r924936 - in /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context: AbstractContext.java ApplicationContext.java ConversationContext.java RequestContext.java SessionContext.java SingletonContext.java
Date Thu, 18 Mar 2010 18:27:08 GMT
Author: gerdogdu
Date: Thu Mar 18 18:27:07 2010
New Revision: 924936

URL: http://svn.apache.org/viewvc?rev=924936&view=rev
Log:
Using weak hash map instead of normal map.

Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/AbstractContext.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/ApplicationContext.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/ConversationContext.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/RequestContext.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/SessionContext.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/SingletonContext.java

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/AbstractContext.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/AbstractContext.java?rev=924936&r1=924935&r2=924936&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/AbstractContext.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/AbstractContext.java
Thu Mar 18 18:27:07 2010
@@ -14,11 +14,12 @@
 package org.apache.webbeans.context;
 
 import java.lang.annotation.Annotation;
+import java.util.Collections;
 import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
+import java.util.WeakHashMap;
 import java.util.Map.Entry;
-import java.util.concurrent.ConcurrentHashMap;
 
 import javax.enterprise.context.ApplicationScoped;
 import javax.enterprise.context.ContextNotActiveException;
@@ -59,7 +60,8 @@ public abstract class AbstractContext im
     protected Class<? extends Annotation> scopeType;
     
     /**Contextual to CreationalContext Map*/
-    protected final Map<Contextual<?>, CreationalContext<?>> creationalContextMap
= new ConcurrentHashMap<Contextual<?>, CreationalContext<?>>();
+    protected final Map<Contextual<?>, CreationalContext<?>> creationalContextMap
= 
+        Collections.synchronizedMap(new WeakHashMap<Contextual<?>, CreationalContext<?>>());
 
     /**
      * Creates a new context instance

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/ApplicationContext.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/ApplicationContext.java?rev=924936&r1=924935&r2=924936&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/ApplicationContext.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/ApplicationContext.java
Thu Mar 18 18:27:07 2010
@@ -13,7 +13,8 @@
  */
 package org.apache.webbeans.context;
 
-import java.util.concurrent.ConcurrentHashMap;
+import java.util.Collections;
+import java.util.WeakHashMap;
 
 import javax.enterprise.context.spi.Contextual;
 
@@ -33,7 +34,7 @@ public class ApplicationContext extends 
     @Override
     public void setComponentInstanceMap()
     {
-        this.componentInstanceMap = new ConcurrentHashMap<Contextual<?>, Object>();
+        this.componentInstanceMap = Collections.synchronizedMap(new WeakHashMap<Contextual<?>,
Object>());
 
     }
 

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/ConversationContext.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/ConversationContext.java?rev=924936&r1=924935&r2=924936&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/ConversationContext.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/ConversationContext.java
Thu Mar 18 18:27:07 2010
@@ -13,7 +13,8 @@
  */
 package org.apache.webbeans.context;
 
-import java.util.concurrent.ConcurrentHashMap;
+import java.util.Collections;
+import java.util.WeakHashMap;
 
 import javax.enterprise.context.spi.Contextual;
 
@@ -35,8 +36,7 @@ public class ConversationContext extends
     @Override
     public void setComponentInstanceMap()
     {
-        this.componentInstanceMap = new ConcurrentHashMap<Contextual<?>, Object>();
-
+        this.componentInstanceMap = Collections.synchronizedMap(new WeakHashMap<Contextual<?>,
Object>());
     }
 
 }

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/RequestContext.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/RequestContext.java?rev=924936&r1=924935&r2=924936&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/RequestContext.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/RequestContext.java
Thu Mar 18 18:27:07 2010
@@ -13,7 +13,7 @@
  */
 package org.apache.webbeans.context;
 
-import java.util.concurrent.ConcurrentHashMap;
+import java.util.WeakHashMap;
 
 import javax.enterprise.context.spi.Contextual;
 
@@ -38,7 +38,7 @@ public class RequestContext extends Abst
     @Override
     public void setComponentInstanceMap()
     {
-        this.componentInstanceMap = new ConcurrentHashMap<Contextual<?>, Object>();
+        this.componentInstanceMap = new WeakHashMap<Contextual<?>, Object>();
 
     }
 

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/SessionContext.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/SessionContext.java?rev=924936&r1=924935&r2=924936&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/SessionContext.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/SessionContext.java
Thu Mar 18 18:27:07 2010
@@ -13,7 +13,8 @@
  */
 package org.apache.webbeans.context;
 
-import java.util.concurrent.ConcurrentHashMap;
+import java.util.Collections;
+import java.util.WeakHashMap;
 
 import javax.enterprise.context.spi.Contextual;
 
@@ -32,7 +33,7 @@ public class SessionContext extends Abst
     @Override
     public void setComponentInstanceMap()
     {
-        this.componentInstanceMap = new ConcurrentHashMap<Contextual<?>, Object>();
+        this.componentInstanceMap = Collections.synchronizedMap(new WeakHashMap<Contextual<?>,
Object>());
 
     }
 

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/SingletonContext.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/SingletonContext.java?rev=924936&r1=924935&r2=924936&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/SingletonContext.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/SingletonContext.java
Thu Mar 18 18:27:07 2010
@@ -13,7 +13,8 @@
  */
 package org.apache.webbeans.context;
 
-import java.util.concurrent.ConcurrentHashMap;
+import java.util.Collections;
+import java.util.WeakHashMap;
 
 import javax.enterprise.context.spi.Contextual;
 
@@ -33,7 +34,6 @@ public class SingletonContext extends Ab
     @Override
     public void setComponentInstanceMap()
     {
-        this.componentInstanceMap = new ConcurrentHashMap<Contextual<?>, Object>();
-
+        this.componentInstanceMap = Collections.synchronizedMap(new WeakHashMap<Contextual<?>,
Object>());
     }
 }



Mime
View raw message