directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1417804 - /directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/consumer/ReplicationConsumerImpl.java
Date Thu, 06 Dec 2012 11:16:11 GMT
Author: elecharny
Date: Thu Dec  6 11:16:11 2012
New Revision: 1417804

URL: http://svn.apache.org/viewvc?rev=1417804&view=rev
Log:
Removed the 'stop' flag, we now use the disconnected flag only

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

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/consumer/ReplicationConsumerImpl.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/consumer/ReplicationConsumerImpl.java?rev=1417804&r1=1417803&r2=1417804&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/consumer/ReplicationConsumerImpl.java
(original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/consumer/ReplicationConsumerImpl.java
Thu Dec  6 11:16:11 2012
@@ -128,9 +128,6 @@ public class ReplicationConsumerImpl imp
     /** flag to indicate whether the consumer was disconnected */
     private boolean disconnected;
 
-    /** A field used to tell the RefreshOnly method it should stop */
-    private volatile boolean stop = false;
-
     /** the core session */
     private CoreSession session;
 
@@ -543,25 +540,13 @@ public class ReplicationConsumerImpl imp
         
         // Cleanup
         disconnected = true;
-
-        try
-        {
-            stopRefreshing();
-
-            connection = null;
-        }
-        catch ( Exception e )
-        {
-            LOG.error( "Failed to close the connection", e );
-        }
-        finally
-        {
-            // persist the cookie
-            storeCookie();
-            
-            // reset the cookie
-            syncCookie = null;
-        }
+        connection = null;
+        
+        // persist the cookie
+        storeCookie();
+        
+        // reset the cookie
+        syncCookie = null;
         
         return;
     }
@@ -600,7 +585,7 @@ public class ReplicationConsumerImpl imp
     
     private ReplicationStatusEnum doRefreshOnly()
     {
-        while ( !stop )
+        while ( !disconnected )
         {
             LOG.debug( "==================== Refresh Only ==========" );
 
@@ -891,8 +876,6 @@ public class ReplicationConsumerImpl imp
         {
             try
             {
-                stopRefreshing();
-    
                 connection.unBind();
                 LOG.info( "Unbound from the server {}", config.getProducer() );
                 
@@ -1367,7 +1350,7 @@ public class ReplicationConsumerImpl imp
      */
     private void stopRefreshing()
     {
-        stop = true;
+        disconnect();
     }
     
     



Mime
View raw message