Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2010-09-22 08:22:07 +0000
committerEike Stepper2010-09-22 08:22:07 +0000
commit5dbb47549b1e46b1a49e35d242d6d847b0e48139 (patch)
tree5b7a437ab7126938a1e9a30bc1862ab8b1a411d5 /plugins/org.eclipse.emf.cdo.examples/src
parent4b6e0c127bf8fff569460c78c13273a7c4056539 (diff)
downloadcdo-5dbb47549b1e46b1a49e35d242d6d847b0e48139.tar.gz
cdo-5dbb47549b1e46b1a49e35d242d6d847b0e48139.tar.xz
cdo-5dbb47549b1e46b1a49e35d242d6d847b0e48139.zip
[325928] Provide FailoverMonitor server and FailoverAgents to coordinate fail-over scenarios
https://bugs.eclipse.org/bugs/show_bug.cgi?id=325928
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.examples/src')
-rw-r--r--plugins/org.eclipse.emf.cdo.examples/src/org/eclipse/emf/cdo/examples/server/FailoverExample.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/plugins/org.eclipse.emf.cdo.examples/src/org/eclipse/emf/cdo/examples/server/FailoverExample.java b/plugins/org.eclipse.emf.cdo.examples/src/org/eclipse/emf/cdo/examples/server/FailoverExample.java
index acc933ce81..6875cd129f 100644
--- a/plugins/org.eclipse.emf.cdo.examples/src/org/eclipse/emf/cdo/examples/server/FailoverExample.java
+++ b/plugins/org.eclipse.emf.cdo.examples/src/org/eclipse/emf/cdo/examples/server/FailoverExample.java
@@ -404,6 +404,8 @@ public abstract class FailoverExample
{
public static final String REPOSITORY_MONITOR_GROUP = "ExampleGroup";
+ public static final int REPOSITORY_MONITOR_PORT = 2038;
+
protected String host;
public Monitored(String host, int port, String name)
@@ -435,7 +437,7 @@ public abstract class FailoverExample
}
};
- agent.setMonitorConnector(createConnector("localhost:2038"));
+ agent.setMonitorConnector(createConnector("localhost:" + REPOSITORY_MONITOR_PORT));
agent.setConnectorDescription(host + ":" + port);
agent.setRepository(repository);
agent.setGroup(REPOSITORY_MONITOR_GROUP);
@@ -476,8 +478,8 @@ public abstract class FailoverExample
System.out.println(event + " agent " + format(agent));
for (Entry<Protocol, Pair<String, String>> entry : monitor.getAgents().entrySet())
{
- System.out.println(" " + (entry.getKey() == monitor.getMasterAgent() ? "MASTER: " : "BACKUP: ")
- + format(entry.getValue()));
+ String type = entry.getKey() == monitor.getMasterAgent() ? "MASTER: " : "BACKUP: ";
+ System.out.println(" " + type + format(entry.getValue()));
}
}
@@ -487,7 +489,7 @@ public abstract class FailoverExample
}
});
- container.getElement("org.eclipse.net4j.acceptors", TRANSPORT_TYPE, "0.0.0.0:2038");
+ container.getElement("org.eclipse.net4j.acceptors", TRANSPORT_TYPE, "0.0.0.0:" + REPOSITORY_MONITOR_PORT);
System.out.println("Monitoring...");
for (;;)

Back to the top