Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 35343 invoked from network); 10 Dec 2006 13:05:33 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 10 Dec 2006 13:05:33 -0000 Received: (qmail 26774 invoked by uid 500); 10 Dec 2006 13:05:41 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 26727 invoked by uid 500); 10 Dec 2006 13:05:41 -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 26716 invoked by uid 99); 10 Dec 2006 13:05:41 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 10 Dec 2006 05:05:41 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 10 Dec 2006 05:05:31 -0800 Received: by eris.apache.org (Postfix, from userid 65534) id 0E9E61A9846; Sun, 10 Dec 2006 05:04:48 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r485176 - /directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/ReplicationService.java Date: Sun, 10 Dec 2006 13:04:47 -0000 To: commits@directory.apache.org From: trustin@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20061210130448.0E9E61A9846@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: trustin Date: Sun Dec 10 05:04:44 2006 New Revision: 485176 URL: http://svn.apache.org/viewvc?view=rev&rev=485176 Log: Updated documentation for ReplicationService so that people can understand it better Modified: directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/ReplicationService.java Modified: directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/ReplicationService.java URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/ReplicationService.java?view=diff&rev=485176&r1=485175&r2=485176 ============================================================================== --- directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/ReplicationService.java (original) +++ directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/ReplicationService.java Sun Dec 10 05:04:44 2006 @@ -47,6 +47,7 @@ import org.apache.directory.mitosis.operation.OperationFactory; import org.apache.directory.mitosis.service.protocol.codec.ReplicationServerProtocolCodecFactory; import org.apache.directory.mitosis.service.protocol.handler.ReplicationClientContextHandler; +import org.apache.directory.mitosis.service.protocol.handler.ReplicationServerContextHandler; import org.apache.directory.mitosis.service.protocol.handler.ReplicationServerProtocolHandler; import org.apache.directory.mitosis.store.ReplicationStore; import org.apache.directory.server.core.DirectoryServiceConfiguration; @@ -77,24 +78,31 @@ * of each {@link Replica} in the cluster has the same content without any * conflict. *

- * Once an operation is invoked, this interceptor transforms it into more than - * one sub-operations that makes the operation more proper for replication. - * The transformation process is actually just creating an instance of - * {@link Operation}, which abstracts the transformation. + * Once an operation is invoked, this interceptor transforms it into one or + * more operations that makes the requested operation more proper and robust + * for replication. The transformation process is actually just calling a + * respective factory method in {@link OperationFactory}. The methods in + * {@link OperationFactory} returns a new {@link Operation} instance. *

- * Calling + * The newly created {@link Operation} is used for three purposes. + *

    + *
  • To perform the requested operation to the local {@link PartitionNexus} + *
  • To store the created {@link Operation} itself to + * {@link ReplicationStore} so that it can be retrieved later by + * {@link ReplicationLogCleanJob} and {@link ReplicationClientContextHandler} + *
  • To transfer itself to other {@link Replica}s via TCP/IP communication + * between {@link ReplicationClientContextHandler} and + * {@link ReplicationServerContextHandler} + *
+ * The first two actions (modifying the local DIT and storing the + * {@link Operation} to {@link ReplicationStore}) are performed automatically + * when * {@link Operation#execute(PartitionNexus, ReplicationStore, AttributeTypeRegistry)} - * will 1) execute the sub-operations on the specified - * {@link PartitionNexus} and 2) store itself to the specified. The - * first step affects the DIT this interceptor is attached to, and the second - * step is to retrieve the change log of the DIT so they are propagated to - * the other {@link Replica}s. Please refer to each {@link Operation} - * implementations to see how each JNDI operation is transformed into multiple - * operations, and refer to {@link ReplicationClientContextHandler} to see how - * the change logs are propagated to the other {@link Replica}s. - * {@link ClientConnectionManager} is also a good starting point for - * understanding the propagation process in that it's the place that initiates - * the connections to the other {@link Replica}s. + * method is invoked. {@link ReplicationService} always call it instead of + * forwarding the requested operation to the next {@link Interceptor}. + *

+ * The last action takes place by {@link ReplicationClientContextHandler}, + * which handles TCP/IP connection managed by {@link ClientConnectionManager}. *

* There are two special attributes in the entries to be replicated: *