directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r793625 - /directory/shared/trunk/client-api/src/main/java/org/apache/directory/shared/ldap/client/api/LdapConnection.java
Date Mon, 13 Jul 2009 16:54:27 GMT
Author: kayyagari
Date: Mon Jul 13 16:54:26 2009
New Revision: 793625

URL: http://svn.apache.org/viewvc?rev=793625&view=rev
Log:
o fixed an issue with cancelling a async operation's Future

Modified:
    directory/shared/trunk/client-api/src/main/java/org/apache/directory/shared/ldap/client/api/LdapConnection.java

Modified: directory/shared/trunk/client-api/src/main/java/org/apache/directory/shared/ldap/client/api/LdapConnection.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/client-api/src/main/java/org/apache/directory/shared/ldap/client/api/LdapConnection.java?rev=793625&r1=793624&r2=793625&view=diff
==============================================================================
--- directory/shared/trunk/client-api/src/main/java/org/apache/directory/shared/ldap/client/api/LdapConnection.java
(original)
+++ directory/shared/trunk/client-api/src/main/java/org/apache/directory/shared/ldap/client/api/LdapConnection.java
Mon Jul 13 16:54:26 2009
@@ -835,23 +835,27 @@
         int abandonId = abandonRequest.getAbandonedMessageId();
 
         ResponseFuture rf = futureMap.remove( abandonId );
-        if( rf != null )
-        {
-            LOG.debug( "sending cancel signal to future" );
-            rf.cancel( true );
-        }
-        else
-        {
-            LOG.error( "There is no future asscoiated with operation message ID {}, perhaps
the operation would have been completed", abandonId );
-        }
-        
         OperationResponseListener listener = listenerMap.remove( abandonId );
 
+        // if the listener is not null, this is a async operation and no need to
+        // send cancel signal on future, sending so will leave a dangling poision object
in the corresponding queue
         if( listener != null )
         {
-            LOG.error( "removed the listener associated with the abandoned operation with
id {}", abandonId );
+            LOG.debug( "removed the listener associated with the abandoned operation with
id {}", abandonId );
+        }
+        else // this is a sync operation send cancel signal to the corresponding ResponseFuture
+        {
+            if( rf != null )
+            {
+                LOG.debug( "sending cancel signal to future" );
+                rf.cancel( true );
+            }
+            else
+            {
+                // this shouldn't happen
+                LOG.error( "There is no future asscoiated with operation message ID {}, perhaps
the operation would have been completed", abandonId );
+            }
         }
-
     }
     
     



Mime
View raw message