directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r366625 - /directory/trunk/ldap-protocol/src/main/java/org/apache/ldap/server/protocol/SessionRegistry.java
Date Sat, 07 Jan 2006 01:43:49 GMT
Author: akarasulu
Date: Fri Jan  6 17:43:48 2006
New Revision: 366625

URL: http://svn.apache.org/viewcvs?rev=366625&view=rev
Log:
added some cleanup code when clients drop off without cancelling outstanding operations

Modified:
    directory/trunk/ldap-protocol/src/main/java/org/apache/ldap/server/protocol/SessionRegistry.java

Modified: directory/trunk/ldap-protocol/src/main/java/org/apache/ldap/server/protocol/SessionRegistry.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-protocol/src/main/java/org/apache/ldap/server/protocol/SessionRegistry.java?rev=366625&r1=366624&r2=366625&view=diff
==============================================================================
--- directory/trunk/ldap-protocol/src/main/java/org/apache/ldap/server/protocol/SessionRegistry.java
(original)
+++ directory/trunk/ldap-protocol/src/main/java/org/apache/ldap/server/protocol/SessionRegistry.java
Fri Jan  6 17:43:48 2006
@@ -20,6 +20,7 @@
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.Hashtable;
+import java.util.Iterator;
 import java.util.Map;
 
 import javax.naming.Context;
@@ -30,6 +31,7 @@
 import javax.naming.spi.InitialContextFactory;
 
 import org.apache.ldap.common.exception.LdapNoPermissionException;
+import org.apache.ldap.common.message.AbandonableRequest;
 import org.apache.ldap.common.message.Request;
 import org.apache.ldap.server.configuration.Configuration;
 import org.apache.ldap.server.configuration.StartupConfiguration;
@@ -367,6 +369,28 @@
         synchronized( contexts )
         {
             contexts.remove( session );
+        }
+        
+        Map reqmap = null;
+        synchronized( requests )
+        {
+            reqmap = ( Map ) requests.remove( session );
+        }
+        
+        if ( reqmap == null || reqmap.isEmpty() )
+        {
+            return;
+        }
+        
+        Iterator list = reqmap.values().iterator();
+        while ( list.hasNext() )
+        {
+            Object request = list.next();
+            
+            if ( request instanceof AbandonableRequest )
+            {
+                ( ( AbandonableRequest ) request ).abandon();
+            }
         }
     }
 



Mime
View raw message