directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1154495 - in /directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication: ReplicaEventLog.java ReplicaEventLogCursor.java
Date Sat, 06 Aug 2011 11:54:40 GMT
Author: elecharny
Date: Sat Aug  6 11:54:39 2011
New Revision: 1154495

URL: http://svn.apache.org/viewvc?rev=1154495&view=rev
Log:
o Updated Javadoc

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

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/ReplicaEventLog.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/ReplicaEventLog.java?rev=1154495&r1=1154494&r2=1154495&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/ReplicaEventLog.java
(original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/ReplicaEventLog.java
Sat Aug  6 11:54:39 2011
@@ -35,7 +35,7 @@ import org.slf4j.LoggerFactory;
 
 
 /**
- * A structure storing the configuration on each consumer registred on a producer. It stores

+ * A structure storing the configuration on each consumer registered on a producer. It stores

  * the following informations :
  * <ul>
  * <li>replicaId : the internal ID associated with the consumer</li>
@@ -45,7 +45,8 @@ import org.slf4j.LoggerFactory;
  * <li>refreshNPersist : a flag indicating that the consumer is processing in Refresh
and presist mode</li>
  * <li></li>
  * </ul>
- * A separate log is maintained for each syncrepl consumer  
+ * A separate log is maintained for each syncrepl consumer.<br/>
+ * We also associate a Queue with each structure, which will store the messages to send to
the consumer.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
@@ -96,7 +97,7 @@ public class ReplicaEventLog implements 
 
 
     /**
-     * Create a new instance of EventLog for a replica
+     * Creates a new instance of EventLog for a replica
      * @param replicaId The replica ID
      */
     public ReplicaEventLog( int replicaId )
@@ -108,11 +109,11 @@ public class ReplicaEventLog implements 
 
 
     /**
-     * Instantiates a message queue and corresponding producer for storing DIT changes  
+     * Instantiates a message queue and corresponding producer for storing DIT changes.
      *
      * @param amqConnection ActiveMQ connection
      * @param brokerService ActiveMQ's broker service
-     * @throws Exception
+     * @throws Exception If the queue can't be created
      */
     public void configure( final ActiveMQConnection amqConnection, final BrokerService brokerService
) throws Exception
     {
@@ -140,6 +141,7 @@ public class ReplicaEventLog implements 
             
             ActiveMQObjectMessage ObjectMessage = ( ActiveMQObjectMessage ) amqSession.createObjectMessage();
             ObjectMessage.setObject( message );
+            
             producer.send( ObjectMessage );
         }
         catch ( Exception e )
@@ -153,7 +155,7 @@ public class ReplicaEventLog implements 
      * Deletes the queue (to remove the log) and recreates a new queue instance
      * with the same queue name. Also creates the corresponding message producer
      *
-     * @throws Exception
+     * @throws Exception If the queue can't be deleted
      */
     public void truncate() throws Exception
     {
@@ -185,7 +187,7 @@ public class ReplicaEventLog implements 
      */
     public void stop() throws Exception
     {
-        // then close the producer and session, DO NOT close connection 
+        // Close the producer and session, DO NOT close connection 
         producer.close();
         amqSession.close();
     }

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/ReplicaEventLogCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/ReplicaEventLogCursor.java?rev=1154495&r1=1154494&r2=1154495&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/ReplicaEventLogCursor.java
(original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/ReplicaEventLogCursor.java
Sat Aug  6 11:54:39 2011
@@ -32,65 +32,93 @@ import org.slf4j.LoggerFactory;
 
 
 /**
+ * Define a cursor on top of a message queue.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 class ReplicaEventLogCursor extends AbstractCursor<ReplicaEventMessage>
 {
-
+    /** Logger for this class */
     private static final Logger LOG = LoggerFactory.getLogger( ReplicaEventLogCursor.class
);
     
+    /** A browser on top of the queue */
     private ActiveMQQueueBrowser browser;
 
+    /** The queue on top of which we will build the cursor */
     private Queue regionQueue;
 
 
+    /**
+     * Creates a cursor on top of the given queue
+     * @param session The session
+     * @param queue The queue
+     * @param regionQueue ???
+     * @throws Exception If we can't create a browser on top of the queue
+     */
     public ReplicaEventLogCursor( ActiveMQSession session, ActiveMQQueue queue, Queue regionQueue
) throws Exception
     {
-        // commit before starting browser, to see the latest view of the Queue data
-//        session.commit();
-        
         browser = ( ActiveMQQueueBrowser ) session.createBrowser( queue );
         
         this.regionQueue = regionQueue;
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public void after( ReplicaEventMessage arg0 ) throws Exception
     {
         throw new UnsupportedOperationException();
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public void afterLast() throws Exception
     {
         throw new UnsupportedOperationException();
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean available()
     {
         return browser.hasMoreElements();
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public void before( ReplicaEventMessage arg0 ) throws Exception
     {
         throw new UnsupportedOperationException();
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public void beforeFirst() throws Exception
     {
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean first() throws Exception
     {
         throw new UnsupportedOperationException();
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public ReplicaEventMessage get() throws Exception
     {
         ActiveMQObjectMessage amqObj = ( ActiveMQObjectMessage ) browser.nextElement();
@@ -102,24 +130,36 @@ class ReplicaEventLogCursor extends Abst
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean last() throws Exception
     {
         throw new UnsupportedOperationException();
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean next() throws Exception
     {
         return browser.hasMoreElements();
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean previous() throws Exception
     {
         throw new UnsupportedOperationException();
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     @Override
     public void close() throws Exception
     {
@@ -128,6 +168,9 @@ class ReplicaEventLogCursor extends Abst
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     @Override
     public void close( Exception cause ) throws Exception
     {
@@ -136,6 +179,9 @@ class ReplicaEventLogCursor extends Abst
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     @Override
     public Iterator<ReplicaEventMessage> iterator()
     {



Mime
View raw message