You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by ka...@apache.org on 2010/02/08 13:52:40 UTC
svn commit: r907643 -
/directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapConnection.java
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();
+ }
}