CVS update: JGroups/src/org/jgroups/protocols RELAY.java
"Bela Ban" <[email protected]>
| Newsgroups | gmane.comp.java.javagroups.cvs |
|---|---|
| Message-ID | <[email protected]> |
User: belaban
Date: 10/08/18 13:07:03
Modified: src/org/jgroups/protocols RELAY.java
Log:
ns
Revision Changes Path
1.4 +24 -6 JGroups/src/org/jgroups/protocols/RELAY.java
Index: RELAY.java
===================================================================
RCS file: /cvsroot/javagroups/JGroups/src/org/jgroups/protocols/RELAY.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- RELAY.java 18 Aug 2010 12:42:08 -0000 1.3
+++ RELAY.java 18 Aug 2010 13:07:03 -0000 1.4
@@ -1,10 +1,7 @@
package org.jgroups.protocols;
import org.jgroups.*;
-import org.jgroups.annotations.Experimental;
-import org.jgroups.annotations.MBean;
-import org.jgroups.annotations.Property;
-import org.jgroups.annotations.Unsupported;
+import org.jgroups.annotations.*;
import org.jgroups.stack.Protocol;
import org.jgroups.util.TimeScheduler;
import org.jgroups.util.Util;
@@ -15,14 +12,25 @@
/**
* Simple relaying protocol: RELAY is added to the top of the stack, creates a channel to a bridge cluster,
- * and - if coordinator - relays all multicast messages via the bridge cluster to the remote relay.
+ * and - if coordinator - relays all multicast messages via the bridge cluster to the remote cluster.<p/>
+ *
+ * This is <em>not</em> a big virtual cluster, e.g. consisting of {A,B,C,X,Y,Z}, but 2 clusters {A,B,C} and {X,Y,Z},
+ * bridged together by RELAY. For example, when B multicasts a message M, A (if it happens to be the coord) relays M
+ * to X (which happens to be the other cluster's coordinator). X then re-broadcasts M, but under its own address, so
+ * M.src = X (<em>not</em> B !)<p/>
+ *
+ * See [1] and [2] for details.<p/>
+ * [1] https://jira.jboss.org/browse/JGRP-747<p/>
+ * [2] doc/design/DataCenterReplication.txt
+ *
* @author Bela Ban
- * @version $Id: RELAY.java,v 1.3 2010/08/18 12:42:08 belaban Exp $
+ * @version $Id: RELAY.java,v 1.4 2010/08/18 13:07:03 belaban Exp $
*/
@Experimental @Unsupported
@MBean(description="RELAY protocol")
public class RELAY extends Protocol {
+ /* ------------------------------------------ Properties ---------------------------------------------- */
@Property(description="Properties of the bridge cluster (e.g. tcp.xml)")
protected String props=null;
@@ -36,8 +44,11 @@
"unidirectional replication from one cluster to another, but not back. Can be changed at runtime")
protected boolean relay=true;
+
+ /* --------------------------------------------- Fields ------------------------------------------------ */
protected Address local_addr;
+ @ManagedAttribute
protected volatile boolean is_coord=false;
protected JChannel ch;
@@ -45,6 +56,13 @@
protected TimeScheduler timer;
+
+
+ @ManagedOperation
+ public void setRelay(boolean relay) {
+ this.relay=relay;
+ }
+
public void init() throws Exception {
timer=getTransport().getTimer();
}
------------------------------------------------------------------------------
This SF.net email is sponsored by
Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev