Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 40144 invoked from network); 8 Feb 2010 12:53:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 8 Feb 2010 12:53:02 -0000 Received: (qmail 47341 invoked by uid 500); 8 Feb 2010 12:53:02 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 47285 invoked by uid 500); 8 Feb 2010 12:53:01 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 47276 invoked by uid 99); 8 Feb 2010 12:53:01 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Feb 2010 12:53:01 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Feb 2010 12:53:01 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id E5616238897D; Mon, 8 Feb 2010 12:52:40 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r907643 - /directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapConnection.java Date: Mon, 08 Feb 2010 12:52:40 -0000 To: commits@directory.apache.org From: kayyagari@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100208125240.E5616238897D@eris.apache.org> Author: kayyagari Date: Mon Feb 8 12:52:40 2010 New Revision: 907643 URL: http://svn.apache.org/viewvc?rev=907643&view=rev Log: cleaning of maps used for holding listeners, futures and response queues Modified: directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapConnection.java Modified: directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapConnection.java URL: http://svn.apache.org/viewvc/directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapConnection.java?rev=907643&r1=907642&r2=907643&view=diff ============================================================================== --- directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapConnection.java (original) +++ directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapConnection.java Mon Feb 8 12:52:40 2010 @@ -840,10 +840,11 @@ // remove the associated listener if any int abandonId = abandonRequest.getAbandonedMessageId(); - respQueueMap.remove( abandonId ); ResponseFuture rf = futureMap.remove( abandonId ); OperationResponseListener listener = listenerMap.remove( abandonId ); + clearMaps(); + // 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 ) @@ -1092,6 +1093,9 @@ // value to zero. messageId.set( 0 ); + // clear the mappings if any (in case of a second call to bind() without calling unBind()) + clearMaps(); + // the bind request should always start with message id 1 (One) int newId = messageId.incrementAndGet(); bindRequest.setMessageId( newId ); @@ -1478,6 +1482,9 @@ authenticated = false; + // clear the mappings + clearMaps(); + // We now have to close the session if ( ( ldapSession != null ) && ldapSession.isConnected() ) { @@ -3014,4 +3021,15 @@ futureMap.remove( msgId ); respQueueMap.remove( msgId ); } + + + /** + * clears the async listener, responseQueue and future mapppings to the corresponding request IDs + */ + private void clearMaps() + { + respQueueMap.clear(); + futureMap.clear(); + listenerMap.clear(); + } }