directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1152275 - /directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplConsumer.java
Date Fri, 29 Jul 2011 15:42:14 GMT
Author: elecharny
Date: Fri Jul 29 15:42:13 2011
New Revision: 1152275

URL: http://svn.apache.org/viewvc?rev=1152275&view=rev
Log:
o Renamed the disconnet() method to disconnect()
o Fixed a potential race condition

Modified:
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplConsumer.java

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplConsumer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplConsumer.java?rev=1152275&r1=1152274&r2=1152275&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplConsumer.java
(original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplConsumer.java
Fri Jul 29 15:42:13 2011
@@ -46,7 +46,6 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.extras.controls.SyncStateTypeEnum;
 import org.apache.directory.shared.ldap.extras.controls.SyncStateValue;
 import org.apache.directory.shared.ldap.extras.controls.SynchronizationModeEnum;
-import org.apache.directory.shared.ldap.extras.controls.syncrepl_impl.SyncInfoValueDecorator;
 import org.apache.directory.shared.ldap.extras.controls.syncrepl_impl.SyncRequestValueDecorator;
 import org.apache.directory.shared.ldap.model.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.model.entry.Attribute;
@@ -229,6 +228,7 @@ public class SyncReplConsumer implements
             try
             {
                 connection.bind( config.getReplUserDn(), Strings.utf8ToString( config.getReplUserPassword()
) );
+                disconnected = false;
                 return true;
             }
             catch ( LdapException le )
@@ -521,7 +521,7 @@ public class SyncReplConsumer implements
      */
     public void stop()
     {
-        disconnet();
+        disconnect();
     }
 
     
@@ -559,7 +559,7 @@ public class SyncReplConsumer implements
 
         Response resp = sf.get();
 
-        while ( !( resp instanceof SearchResultDone ) && !sf.isCancelled() )
+        while ( !( resp instanceof SearchResultDone ) && !sf.isCancelled() &&
!disconnected )
         {
             if ( resp instanceof SearchResultEntry )
             {
@@ -587,7 +587,7 @@ public class SyncReplConsumer implements
             if ( syncType == SynchronizationModeEnum.REFRESH_AND_PERSIST )
             {
                 LOG.warn( "disconnecting the consumer running in refreshAndPersist mode from
the provider" );
-                disconnet();
+                disconnect();
             }
         }
         else if ( resultCode == ResultCodeEnum.E_SYNC_REFRESH_REQUIRED )
@@ -611,7 +611,7 @@ public class SyncReplConsumer implements
     }
 
 
-    public void disconnet()
+    public void disconnect()
     {
         disconnected = true;
 



Mime
View raw message