mina-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mw...@apache.org
Subject svn commit: r550073 - /mina/trunk/core/src/main/java/org/apache/mina/filter/ConnectionThrottleFilter.java
Date Sat, 23 Jun 2007 18:04:14 GMT
Author: mwebb
Date: Sat Jun 23 11:04:14 2007
New Revision: 550073

URL: http://svn.apache.org/viewvc?view=rev&rev=550073
Log:
Changed clients to a ConcurrentHashMap.  

Modified:
    mina/trunk/core/src/main/java/org/apache/mina/filter/ConnectionThrottleFilter.java

Modified: mina/trunk/core/src/main/java/org/apache/mina/filter/ConnectionThrottleFilter.java
URL: http://svn.apache.org/viewvc/mina/trunk/core/src/main/java/org/apache/mina/filter/ConnectionThrottleFilter.java?view=diff&rev=550073&r1=550072&r2=550073
==============================================================================
--- mina/trunk/core/src/main/java/org/apache/mina/filter/ConnectionThrottleFilter.java (original)
+++ mina/trunk/core/src/main/java/org/apache/mina/filter/ConnectionThrottleFilter.java Sat
Jun 23 11:04:14 2007
@@ -21,9 +21,8 @@
 
 import java.net.InetSocketAddress;
 import java.net.SocketAddress;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
 
 import org.apache.mina.common.IoFilter;
 import org.apache.mina.common.IoFilterAdapter;
@@ -59,7 +58,7 @@
      */
     public ConnectionThrottleFilter( long allowedInterval ){
         this.allowedInterval = allowedInterval;
-        clients = Collections.synchronizedMap( new HashMap<String,Long>());
+        clients = new ConcurrentHashMap<String,Long>();
     }
 
     /**
@@ -74,7 +73,7 @@
         this.allowedInterval = allowedInterval;
     }
 
-    private synchronized boolean isConnectionOk( IoSession session ){
+    private boolean isConnectionOk( IoSession session ){
         SocketAddress remoteAddress = session.getRemoteAddress();
         if( remoteAddress instanceof InetSocketAddress )
         {



Mime
View raw message