Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2012-11-18 04:39:25 -0500
committerEike Stepper2012-11-18 04:39:25 -0500
commit123962851cf24bd54bb6c5d5b83a69697b997479 (patch)
treeb9ab50553fa1c9e3894f482fc40d7c45f7ae5b63
parentd882450136cc13a89c28a77e60f5eff87f4e8d89 (diff)
downloadcdo-123962851cf24bd54bb6c5d5b83a69697b997479.tar.gz
cdo-123962851cf24bd54bb6c5d5b83a69697b997479.tar.xz
cdo-123962851cf24bd54bb6c5d5b83a69697b997479.zip
[394049] Master/Clone examples don't work any more
https://bugs.eclipse.org/bugs/show_bug.cgi?id=394049
-rw-r--r--.gitignore1
-rw-r--r--plugins/org.eclipse.emf.cdo.examples.client.offline/CDOOfflineExample.launch15
-rw-r--r--plugins/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/nodes/NodeType.java37
-rw-r--r--plugins/org.eclipse.emf.cdo.examples.installer/examples/org.eclipse.emf.cdo.examples.client.offline/CDOOfflineExample.launch17
-rw-r--r--plugins/org.eclipse.emf.cdo.examples.installer/examples/org.eclipse.emf.cdo.examples.client.offline/nodes/client3-failover/node.properties5
-rw-r--r--plugins/org.eclipse.emf.cdo.examples.installer/examples/org.eclipse.emf.cdo.examples.client.offline/nodes/client4-failover/node.properties5
-rw-r--r--plugins/org.eclipse.emf.cdo.examples.installer/examples/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/nodes/NodeType.java37
-rw-r--r--plugins/org.eclipse.emf.cdo.examples/src/org/eclipse/emf/cdo/examples/server/FailoverExample.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/ReplicateRepositoryRawRequest.java7
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBBrowserPage.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreAccessor.java6
-rw-r--r--plugins/org.eclipse.emf.cdo.server.lissome/plugin.xml2
-rw-r--r--plugins/org.eclipse.emf.cdo.server.lissome/src/org/eclipse/emf/cdo/server/internal/lissome/LissomeBrowserPage.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/net4j/FailoverAgent.java64
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Repository.java33
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/TimeStampAuthority.java18
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/FailoverParticipant.java1
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/RepositorySynchronizer.java39
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/SynchronizableRepository.java42
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/CDOServerUtil.java9
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IRepository.java3
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/ISynchronizableRepository.java7
22 files changed, 266 insertions, 88 deletions
diff --git a/.gitignore b/.gitignore
index bc200c8188..351e70182c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,3 +3,4 @@ state/
*~
~*.docx
~*.pptx
+com.chronon.sb.browser.launcher.prefs
diff --git a/plugins/org.eclipse.emf.cdo.examples.client.offline/CDOOfflineExample.launch b/plugins/org.eclipse.emf.cdo.examples.client.offline/CDOOfflineExample.launch
index 867b6a60fd..ccba2654ee 100644
--- a/plugins/org.eclipse.emf.cdo.examples.client.offline/CDOOfflineExample.launch
+++ b/plugins/org.eclipse.emf.cdo.examples.client.offline/CDOOfflineExample.launch
@@ -10,8 +10,17 @@
<booleanAttribute key="clearConfig" value="false"/>
<booleanAttribute key="clearws" value="false"/>
<booleanAttribute key="clearwslog" value="false"/>
+<listAttribute key="com.chronon.sb.browser.launcher.launchattrs.excludePatterns"/>
+<listAttribute key="com.chronon.sb.browser.launcher.launchattrs.includePatterns">
+<listEntry value="org.eclipse.emf.cdo.**"/>
+<listEntry value="org.eclipse.internal.net4j.**"/>
+<listEntry value="org.eclipse.spi.net4j.**"/>
+<listEntry value="org.eclipse.emf.spi.cdo.**"/>
+<listEntry value="org.eclipse.emf.internal.cdo.**"/>
+<listEntry value="org.eclipse.net4j.**"/>
+</listAttribute>
<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/CDOOfflineExample"/>
-<booleanAttribute key="default" value="false"/>
+<booleanAttribute key="default" value="true"/>
<booleanAttribute key="includeOptional" value="false"/>
<stringAttribute key="location" value="${workspace_loc}/../CDOOfflineExample.rt"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog"/>
@@ -19,8 +28,8 @@
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms1024m -Xmx1024m&#13;&#10;-Dnode.manager.root=${resource_loc:/org.eclipse.emf.cdo.examples.client.offline}/nodes"/>
<booleanAttribute key="pde.generated.config" value="false"/>
<stringAttribute key="pde.version" value="3.3"/>
-<stringAttribute key="product" value="org.eclipse.b3.cli.product"/>
-<stringAttribute key="selected_target_plugins" value="com.ibm.icu@default:default,org.eclipse.compare.core@default:default,org.eclipse.core.commands@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.core.databinding.observable@default:default,org.eclipse.core.databinding.property@default:default,org.eclipse.core.databinding@default:default,org.eclipse.core.expressions@default:default,org.eclipse.core.jobs@default:default,org.eclipse.core.runtime.compatibility.registry@default:false,org.eclipse.core.runtime@default:true,org.eclipse.core.variables@default:default,org.eclipse.emf.common.ui@default:default,org.eclipse.emf.common@default:default,org.eclipse.emf.ecore.change@default:default,org.eclipse.emf.ecore.edit@default:default,org.eclipse.emf.ecore.xmi@default:default,org.eclipse.emf.ecore@default:default,org.eclipse.emf.edit.ui@default:default,org.eclipse.emf.edit@default:default,org.eclipse.equinox.app@default:default,org.eclipse.equinox.common@2:true,org.eclipse.equinox.preferences@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.help@default:default,org.eclipse.jface.databinding@default:default,org.eclipse.jface.text@default:default,org.eclipse.jface@default:default,org.eclipse.osgi@-1:true,org.eclipse.swt.win32.win32.x86_64@default:false,org.eclipse.swt@default:default,org.eclipse.text@default:default,org.eclipse.ui.views@default:default,org.eclipse.ui.workbench.texteditor@default:default,org.eclipse.ui.workbench@default:default,org.eclipse.ui@default:default,org.h2@default:default"/>
+<stringAttribute key="product" value="org.eclipse.platform.ide"/>
+<stringAttribute key="selected_target_plugins" value="com.ibm.icu@default:default,org.eclipse.compare.core@default:default,org.eclipse.core.commands@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.core.databinding.observable@default:default,org.eclipse.core.databinding.property@default:default,org.eclipse.core.databinding@default:default,org.eclipse.core.expressions@default:default,org.eclipse.core.filebuffers@default:default,org.eclipse.core.filesystem.win32.x86_64@default:false,org.eclipse.core.filesystem@default:default,org.eclipse.core.jobs@default:default,org.eclipse.core.resources@default:default,org.eclipse.core.runtime.compatibility.registry@default:false,org.eclipse.core.runtime@default:true,org.eclipse.emf.common.ui@default:default,org.eclipse.emf.common@default:default,org.eclipse.emf.ecore.change@default:default,org.eclipse.emf.ecore.edit@default:default,org.eclipse.emf.ecore.xmi@default:default,org.eclipse.emf.ecore@default:default,org.eclipse.emf.edit.ui@default:default,org.eclipse.emf.edit@default:default,org.eclipse.equinox.app@default:default,org.eclipse.equinox.common@2:true,org.eclipse.equinox.p2.core@default:default,org.eclipse.equinox.p2.engine@default:default,org.eclipse.equinox.p2.metadata.repository@default:default,org.eclipse.equinox.p2.metadata@default:default,org.eclipse.equinox.p2.repository@default:default,org.eclipse.equinox.preferences@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.equinox.security.win32.x86_64@default:false,org.eclipse.equinox.security@default:default,org.eclipse.help@default:default,org.eclipse.jface.databinding@default:default,org.eclipse.jface.text@default:default,org.eclipse.jface@default:default,org.eclipse.osgi@-1:true,org.eclipse.swt.win32.win32.x86_64@default:false,org.eclipse.swt@default:default,org.eclipse.text@default:default,org.eclipse.ui.editors@default:default,org.eclipse.ui.ide@default:default,org.eclipse.ui.views@default:default,org.eclipse.ui.win32@default:false,org.eclipse.ui.workbench.texteditor@default:default,org.eclipse.ui.workbench@default:default,org.eclipse.ui@default:default,org.h2@default:default"/>
<stringAttribute key="selected_workspace_plugins" value="org.eclipse.emf.cdo.common@default:default,org.eclipse.emf.cdo.edit@default:default,org.eclipse.emf.cdo.examples.client.offline@default:default,org.eclipse.emf.cdo.examples.company.edit@default:default,org.eclipse.emf.cdo.examples.company@default:default,org.eclipse.emf.cdo.net4j@default:default,org.eclipse.emf.cdo.server.admin@default:default,org.eclipse.emf.cdo.server.db@default:default,org.eclipse.emf.cdo.server.net4j@default:default,org.eclipse.emf.cdo.server@default:default,org.eclipse.emf.cdo.transfer.repository@default:default,org.eclipse.emf.cdo.transfer.ui@default:default,org.eclipse.emf.cdo.transfer@default:default,org.eclipse.emf.cdo.ui.shared@default:default,org.eclipse.emf.cdo.ui@default:default,org.eclipse.emf.cdo@default:default,org.eclipse.net4j.db.h2@default:default,org.eclipse.net4j.db@default:default,org.eclipse.net4j.jvm@default:default,org.eclipse.net4j.tcp@default:default,org.eclipse.net4j.ui.shared@default:default,org.eclipse.net4j.util.ui@default:default,org.eclipse.net4j.util@default:default,org.eclipse.net4j@default:default"/>
<booleanAttribute key="show_selected_only" value="true"/>
<booleanAttribute key="tracing" value="false"/>
diff --git a/plugins/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/nodes/NodeType.java b/plugins/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/nodes/NodeType.java
index 75e00ae136..b7b1a0cd29 100644
--- a/plugins/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/nodes/NodeType.java
+++ b/plugins/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/nodes/NodeType.java
@@ -12,7 +12,6 @@ package org.eclipse.emf.cdo.examples.client.offline.nodes;
import org.eclipse.emf.cdo.common.CDOCommonRepository.State;
import org.eclipse.emf.cdo.common.branch.CDOBranch;
-import org.eclipse.emf.cdo.common.model.CDOPackageRegistryPopulator;
import org.eclipse.emf.cdo.common.revision.CDORevisionCache;
import org.eclipse.emf.cdo.common.revision.CDORevisionUtil;
import org.eclipse.emf.cdo.examples.client.offline.Application;
@@ -45,6 +44,7 @@ import org.eclipse.net4j.util.container.IPluginContainer;
import org.eclipse.net4j.util.container.SetContainer;
import org.eclipse.net4j.util.event.IEvent;
import org.eclipse.net4j.util.event.IListener;
+import org.eclipse.net4j.util.event.ThrowableEventAdapter;
import org.eclipse.net4j.util.lifecycle.LifecycleUtil;
import org.eclipse.jface.viewers.ComboViewer;
@@ -324,7 +324,8 @@ public abstract class NodeType extends SetContainer<Node> implements IElement
props.put(IRepository.Props.ID_GENERATION_LOCATION, "CLIENT");
IRepository repository = createRepository(node, store, props);
- CDOServerUtil.addRepository(IPluginContainer.INSTANCE, repository);
+ repository.setInitialPackages(CompanyPackage.eINSTANCE);
+ activateRepository(repository);
return repository;
}
@@ -333,6 +334,12 @@ public abstract class NodeType extends SetContainer<Node> implements IElement
return CDOServerUtil.createRepository(REPOSITORY_NAME, store, props);
}
+ protected void activateRepository(IRepository repository)
+ {
+ // Don't do this with failover participants!
+ CDOServerUtil.addRepository(IPluginContainer.INSTANCE, repository);
+ }
+
protected IAcceptor createAcceptor(Node node)
{
String description = "0.0.0.0:" + node.getSetting(PORT_PROPERTY);
@@ -541,8 +548,8 @@ public abstract class NodeType extends SetContainer<Node> implements IElement
final CDOSession session = (CDOSession)IPluginContainer.INSTANCE.getElement("org.eclipse.emf.cdo.sessions",
"cdo", "jvm://example?repositoryName=" + REPOSITORY_NAME);
+ session.getPackageRegistry().putEPackage(CompanyPackage.eINSTANCE);
- CDOPackageRegistryPopulator.populate(session.getPackageRegistry());
node.setObject(CDOSession.class, session);
if (session.getRepositoryInfo().getState() == State.INITIAL)
@@ -735,6 +742,8 @@ public abstract class NodeType extends SetContainer<Node> implements IElement
*/
public static class FailoverRepository extends Repository
{
+ private FailoverAgent agent;
+
public FailoverRepository(NodeManager manager)
{
super(manager);
@@ -755,11 +764,18 @@ public abstract class NodeType extends SetContainer<Node> implements IElement
final String monitorAddress = "localhost:" + monitorNode.getSetting(PORT_PROPERTY);
ISynchronizableRepository repository = CDOServerUtil.createFailoverParticipant(REPOSITORY_NAME, store, props);
- repository.setInitialPackages(CompanyPackage.eINSTANCE);
- FailoverAgent agent = new FailoverAgent()
+ agent = new FailoverAgent()
{
@Override
+ protected IRepositorySynchronizer createRepositorySynchronizer()
+ {
+ IRepositorySynchronizer synchronizer = super.createRepositorySynchronizer();
+ synchronizer.addListener(ThrowableEventAdapter.ToPrintStream.CONSOLE);
+ return synchronizer;
+ }
+
+ @Override
protected CDONet4jSessionConfiguration createSessionConfiguration(String connectorDescription,
String repositoryName)
{
@@ -773,20 +789,23 @@ public abstract class NodeType extends SetContainer<Node> implements IElement
}
};
- IConnector connector = Net4jUtil.getConnector(IPluginContainer.INSTANCE, "tcp", monitorAddress);
-
- agent.setMonitorConnector(connector);
+ agent.setMonitorConnector(Net4jUtil.getConnector(IPluginContainer.INSTANCE, "tcp", monitorAddress));
agent.setConnectorDescription("localhost:" + node.getSetting(PORT_PROPERTY));
agent.setRepository(repository);
agent.setGroup(monitorNode.getName());
agent.setRate(1500L);
agent.setTimeout(3000L);
- agent.activate();
return repository;
}
@Override
+ protected void activateRepository(IRepository repository)
+ {
+ agent.activate();
+ }
+
+ @Override
public String toString()
{
return "Failover Repositories";
diff --git a/plugins/org.eclipse.emf.cdo.examples.installer/examples/org.eclipse.emf.cdo.examples.client.offline/CDOOfflineExample.launch b/plugins/org.eclipse.emf.cdo.examples.installer/examples/org.eclipse.emf.cdo.examples.client.offline/CDOOfflineExample.launch
index 84d42142c2..bff2da1349 100644
--- a/plugins/org.eclipse.emf.cdo.examples.installer/examples/org.eclipse.emf.cdo.examples.client.offline/CDOOfflineExample.launch
+++ b/plugins/org.eclipse.emf.cdo.examples.installer/examples/org.eclipse.emf.cdo.examples.client.offline/CDOOfflineExample.launch
@@ -10,8 +10,17 @@
<booleanAttribute key="clearConfig" value="false"/>
<booleanAttribute key="clearws" value="false"/>
<booleanAttribute key="clearwslog" value="false"/>
+<listAttribute key="com.chronon.sb.browser.launcher.launchattrs.excludePatterns"/>
+<listAttribute key="com.chronon.sb.browser.launcher.launchattrs.includePatterns">
+<listEntry value="org.eclipse.emf.cdo.**"/>
+<listEntry value="org.eclipse.internal.net4j.**"/>
+<listEntry value="org.eclipse.spi.net4j.**"/>
+<listEntry value="org.eclipse.emf.spi.cdo.**"/>
+<listEntry value="org.eclipse.emf.internal.cdo.**"/>
+<listEntry value="org.eclipse.net4j.**"/>
+</listAttribute>
<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/CDOOfflineExample"/>
-<booleanAttribute key="default" value="false"/>
+<booleanAttribute key="default" value="true"/>
<booleanAttribute key="includeOptional" value="false"/>
<stringAttribute key="location" value="${workspace_loc}/../CDOOfflineExample.rt"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog"/>
@@ -19,9 +28,9 @@
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms1024m -Xmx1024m&#13;&#10;-Dnode.manager.root=${resource_loc:/org.eclipse.emf.cdo.examples.client.offline}/nodes"/>
<booleanAttribute key="pde.generated.config" value="false"/>
<stringAttribute key="pde.version" value="3.3"/>
-<stringAttribute key="product" value="org.eclipse.b3.cli.product"/>
-<stringAttribute key="selected_target_plugins" value="com.ibm.icu@default:default,org.eclipse.compare.core@default:default,org.eclipse.core.commands@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.core.databinding.observable@default:default,org.eclipse.core.databinding.property@default:default,org.eclipse.core.databinding@default:default,org.eclipse.core.expressions@default:default,org.eclipse.core.jobs@default:default,org.eclipse.core.runtime.compatibility.registry@default:false,org.eclipse.core.runtime@default:true,org.eclipse.core.variables@default:default,org.eclipse.emf.common.ui@default:default,org.eclipse.emf.common@default:default,org.eclipse.emf.ecore.change@default:default,org.eclipse.emf.ecore.edit@default:default,org.eclipse.emf.ecore.xmi@default:default,org.eclipse.emf.ecore@default:default,org.eclipse.emf.edit.ui@default:default,org.eclipse.emf.edit@default:default,org.eclipse.equinox.app@default:default,org.eclipse.equinox.common@2:true,org.eclipse.equinox.preferences@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.help@default:default,org.eclipse.jface.databinding@default:default,org.eclipse.jface.text@default:default,org.eclipse.jface@default:default,org.eclipse.osgi@-1:true,org.eclipse.swt.win32.win32.x86_64@default:false,org.eclipse.swt@default:default,org.eclipse.text@default:default,org.eclipse.ui.views@default:default,org.eclipse.ui.workbench.texteditor@default:default,org.eclipse.ui.workbench@default:default,org.eclipse.ui@default:default,org.h2@default:default,org.eclipse.emf.cdo.common@default:default,org.eclipse.emf.cdo.edit@default:default,org.eclipse.emf.cdo.examples.client.offline@default:default,org.eclipse.emf.cdo.examples.company.edit@default:default,org.eclipse.emf.cdo.examples.company@default:default,org.eclipse.emf.cdo.net4j@default:default,org.eclipse.emf.cdo.server.admin@default:default,org.eclipse.emf.cdo.server.db@default:default,org.eclipse.emf.cdo.server.net4j@default:default,org.eclipse.emf.cdo.server@default:default,org.eclipse.emf.cdo.transfer.repository@default:default,org.eclipse.emf.cdo.transfer.ui@default:default,org.eclipse.emf.cdo.transfer@default:default,org.eclipse.emf.cdo.ui.shared@default:default,org.eclipse.emf.cdo.ui@default:default,org.eclipse.emf.cdo@default:default,org.eclipse.net4j.db.h2@default:default,org.eclipse.net4j.db@default:default,org.eclipse.net4j.jvm@default:default,org.eclipse.net4j.tcp@default:default,org.eclipse.net4j.ui.shared@default:default,org.eclipse.net4j.util.ui@default:default,org.eclipse.net4j.util@default:default,org.eclipse.net4j@default:default"/>
-<stringAttribute key="selected_workspace_plugins" value="com.ibm.icu@default:default,org.eclipse.compare.core@default:default,org.eclipse.core.commands@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.core.databinding.observable@default:default,org.eclipse.core.databinding.property@default:default,org.eclipse.core.databinding@default:default,org.eclipse.core.expressions@default:default,org.eclipse.core.jobs@default:default,org.eclipse.core.runtime.compatibility.registry@default:false,org.eclipse.core.runtime@default:true,org.eclipse.core.variables@default:default,org.eclipse.emf.common.ui@default:default,org.eclipse.emf.common@default:default,org.eclipse.emf.ecore.change@default:default,org.eclipse.emf.ecore.edit@default:default,org.eclipse.emf.ecore.xmi@default:default,org.eclipse.emf.ecore@default:default,org.eclipse.emf.edit.ui@default:default,org.eclipse.emf.edit@default:default,org.eclipse.equinox.app@default:default,org.eclipse.equinox.common@2:true,org.eclipse.equinox.preferences@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.help@default:default,org.eclipse.jface.databinding@default:default,org.eclipse.jface.text@default:default,org.eclipse.jface@default:default,org.eclipse.osgi@-1:true,org.eclipse.swt.win32.win32.x86_64@default:false,org.eclipse.swt@default:default,org.eclipse.text@default:default,org.eclipse.ui.views@default:default,org.eclipse.ui.workbench.texteditor@default:default,org.eclipse.ui.workbench@default:default,org.eclipse.ui@default:default,org.h2@default:default,org.eclipse.emf.cdo.common@default:default,org.eclipse.emf.cdo.edit@default:default,org.eclipse.emf.cdo.examples.client.offline@default:default,org.eclipse.emf.cdo.examples.company.edit@default:default,org.eclipse.emf.cdo.examples.company@default:default,org.eclipse.emf.cdo.net4j@default:default,org.eclipse.emf.cdo.server.admin@default:default,org.eclipse.emf.cdo.server.db@default:default,org.eclipse.emf.cdo.server.net4j@default:default,org.eclipse.emf.cdo.server@default:default,org.eclipse.emf.cdo.transfer.repository@default:default,org.eclipse.emf.cdo.transfer.ui@default:default,org.eclipse.emf.cdo.transfer@default:default,org.eclipse.emf.cdo.ui.shared@default:default,org.eclipse.emf.cdo.ui@default:default,org.eclipse.emf.cdo@default:default,org.eclipse.net4j.db.h2@default:default,org.eclipse.net4j.db@default:default,org.eclipse.net4j.jvm@default:default,org.eclipse.net4j.tcp@default:default,org.eclipse.net4j.ui.shared@default:default,org.eclipse.net4j.util.ui@default:default,org.eclipse.net4j.util@default:default,org.eclipse.net4j@default:default"/>
+<stringAttribute key="product" value="org.eclipse.platform.ide"/>
+<stringAttribute key="selected_target_plugins" value="com.ibm.icu@default:default,org.eclipse.compare.core@default:default,org.eclipse.core.commands@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.core.databinding.observable@default:default,org.eclipse.core.databinding.property@default:default,org.eclipse.core.databinding@default:default,org.eclipse.core.expressions@default:default,org.eclipse.core.filebuffers@default:default,org.eclipse.core.filesystem.win32.x86_64@default:false,org.eclipse.core.filesystem@default:default,org.eclipse.core.jobs@default:default,org.eclipse.core.resources@default:default,org.eclipse.core.runtime.compatibility.registry@default:false,org.eclipse.core.runtime@default:true,org.eclipse.emf.common.ui@default:default,org.eclipse.emf.common@default:default,org.eclipse.emf.ecore.change@default:default,org.eclipse.emf.ecore.edit@default:default,org.eclipse.emf.ecore.xmi@default:default,org.eclipse.emf.ecore@default:default,org.eclipse.emf.edit.ui@default:default,org.eclipse.emf.edit@default:default,org.eclipse.equinox.app@default:default,org.eclipse.equinox.common@2:true,org.eclipse.equinox.p2.core@default:default,org.eclipse.equinox.p2.engine@default:default,org.eclipse.equinox.p2.metadata.repository@default:default,org.eclipse.equinox.p2.metadata@default:default,org.eclipse.equinox.p2.repository@default:default,org.eclipse.equinox.preferences@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.equinox.security.win32.x86_64@default:false,org.eclipse.equinox.security@default:default,org.eclipse.help@default:default,org.eclipse.jface.databinding@default:default,org.eclipse.jface.text@default:default,org.eclipse.jface@default:default,org.eclipse.osgi@-1:true,org.eclipse.swt.win32.win32.x86_64@default:false,org.eclipse.swt@default:default,org.eclipse.text@default:default,org.eclipse.ui.editors@default:default,org.eclipse.ui.ide@default:default,org.eclipse.ui.views@default:default,org.eclipse.ui.win32@default:false,org.eclipse.ui.workbench.texteditor@default:default,org.eclipse.ui.workbench@default:default,org.eclipse.ui@default:default,org.h2@default:default,org.eclipse.emf.cdo.common@default:default,org.eclipse.emf.cdo.edit@default:default,org.eclipse.emf.cdo.examples.client.offline@default:default,org.eclipse.emf.cdo.examples.company.edit@default:default,org.eclipse.emf.cdo.examples.company@default:default,org.eclipse.emf.cdo.net4j@default:default,org.eclipse.emf.cdo.server.admin@default:default,org.eclipse.emf.cdo.server.db@default:default,org.eclipse.emf.cdo.server.net4j@default:default,org.eclipse.emf.cdo.server@default:default,org.eclipse.emf.cdo.transfer.repository@default:default,org.eclipse.emf.cdo.transfer.ui@default:default,org.eclipse.emf.cdo.transfer@default:default,org.eclipse.emf.cdo.ui.shared@default:default,org.eclipse.emf.cdo.ui@default:default,org.eclipse.emf.cdo@default:default,org.eclipse.net4j.db.h2@default:default,org.eclipse.net4j.db@default:default,org.eclipse.net4j.jvm@default:default,org.eclipse.net4j.tcp@default:default,org.eclipse.net4j.ui.shared@default:default,org.eclipse.net4j.util.ui@default:default,org.eclipse.net4j.util@default:default,org.eclipse.net4j@default:default"/>
+<stringAttribute key="selected_workspace_plugins" value="com.ibm.icu@default:default,org.eclipse.compare.core@default:default,org.eclipse.core.commands@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.core.databinding.observable@default:default,org.eclipse.core.databinding.property@default:default,org.eclipse.core.databinding@default:default,org.eclipse.core.expressions@default:default,org.eclipse.core.filebuffers@default:default,org.eclipse.core.filesystem.win32.x86_64@default:false,org.eclipse.core.filesystem@default:default,org.eclipse.core.jobs@default:default,org.eclipse.core.resources@default:default,org.eclipse.core.runtime.compatibility.registry@default:false,org.eclipse.core.runtime@default:true,org.eclipse.emf.common.ui@default:default,org.eclipse.emf.common@default:default,org.eclipse.emf.ecore.change@default:default,org.eclipse.emf.ecore.edit@default:default,org.eclipse.emf.ecore.xmi@default:default,org.eclipse.emf.ecore@default:default,org.eclipse.emf.edit.ui@default:default,org.eclipse.emf.edit@default:default,org.eclipse.equinox.app@default:default,org.eclipse.equinox.common@2:true,org.eclipse.equinox.p2.core@default:default,org.eclipse.equinox.p2.engine@default:default,org.eclipse.equinox.p2.metadata.repository@default:default,org.eclipse.equinox.p2.metadata@default:default,org.eclipse.equinox.p2.repository@default:default,org.eclipse.equinox.preferences@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.equinox.security.win32.x86_64@default:false,org.eclipse.equinox.security@default:default,org.eclipse.help@default:default,org.eclipse.jface.databinding@default:default,org.eclipse.jface.text@default:default,org.eclipse.jface@default:default,org.eclipse.osgi@-1:true,org.eclipse.swt.win32.win32.x86_64@default:false,org.eclipse.swt@default:default,org.eclipse.text@default:default,org.eclipse.ui.editors@default:default,org.eclipse.ui.ide@default:default,org.eclipse.ui.views@default:default,org.eclipse.ui.win32@default:false,org.eclipse.ui.workbench.texteditor@default:default,org.eclipse.ui.workbench@default:default,org.eclipse.ui@default:default,org.h2@default:default,org.eclipse.emf.cdo.common@default:default,org.eclipse.emf.cdo.edit@default:default,org.eclipse.emf.cdo.examples.client.offline@default:default,org.eclipse.emf.cdo.examples.company.edit@default:default,org.eclipse.emf.cdo.examples.company@default:default,org.eclipse.emf.cdo.net4j@default:default,org.eclipse.emf.cdo.server.admin@default:default,org.eclipse.emf.cdo.server.db@default:default,org.eclipse.emf.cdo.server.net4j@default:default,org.eclipse.emf.cdo.server@default:default,org.eclipse.emf.cdo.transfer.repository@default:default,org.eclipse.emf.cdo.transfer.ui@default:default,org.eclipse.emf.cdo.transfer@default:default,org.eclipse.emf.cdo.ui.shared@default:default,org.eclipse.emf.cdo.ui@default:default,org.eclipse.emf.cdo@default:default,org.eclipse.net4j.db.h2@default:default,org.eclipse.net4j.db@default:default,org.eclipse.net4j.jvm@default:default,org.eclipse.net4j.tcp@default:default,org.eclipse.net4j.ui.shared@default:default,org.eclipse.net4j.util.ui@default:default,org.eclipse.net4j.util@default:default,org.eclipse.net4j@default:default"/>
<booleanAttribute key="show_selected_only" value="true"/>
<booleanAttribute key="tracing" value="false"/>
<mapAttribute key="tracingOptions">
diff --git a/plugins/org.eclipse.emf.cdo.examples.installer/examples/org.eclipse.emf.cdo.examples.client.offline/nodes/client3-failover/node.properties b/plugins/org.eclipse.emf.cdo.examples.installer/examples/org.eclipse.emf.cdo.examples.client.offline/nodes/client3-failover/node.properties
index 47e41c3de0..5f93e6eb0b 100644
--- a/plugins/org.eclipse.emf.cdo.examples.installer/examples/org.eclipse.emf.cdo.examples.client.offline/nodes/client3-failover/node.properties
+++ b/plugins/org.eclipse.emf.cdo.examples.installer/examples/org.eclipse.emf.cdo.examples.client.offline/nodes/client3-failover/node.properties
@@ -1,6 +1,7 @@
#Node Settings
-#Wed Nov 07 10:20:03 CET 2012
+#Sat Nov 17 12:49:21 CET 2012
Name=client3-failover
+BrowserPort=7780
+Branch=MAIN
Type=Client
Server=failover-group1
-BrowserPort=7780
diff --git a/plugins/org.eclipse.emf.cdo.examples.installer/examples/org.eclipse.emf.cdo.examples.client.offline/nodes/client4-failover/node.properties b/plugins/org.eclipse.emf.cdo.examples.installer/examples/org.eclipse.emf.cdo.examples.client.offline/nodes/client4-failover/node.properties
index 061fa087ba..4d5e5f8c1a 100644
--- a/plugins/org.eclipse.emf.cdo.examples.installer/examples/org.eclipse.emf.cdo.examples.client.offline/nodes/client4-failover/node.properties
+++ b/plugins/org.eclipse.emf.cdo.examples.installer/examples/org.eclipse.emf.cdo.examples.client.offline/nodes/client4-failover/node.properties
@@ -1,6 +1,7 @@
#Node Settings
-#Wed Nov 07 10:20:10 CET 2012
+#Sat Nov 17 12:49:27 CET 2012
Name=client4-failover
+BrowserPort=7781
Type=Client
+Branch=MAIN
Server=failover-group1
-BrowserPort=7781
diff --git a/plugins/org.eclipse.emf.cdo.examples.installer/examples/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/nodes/NodeType.java b/plugins/org.eclipse.emf.cdo.examples.installer/examples/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/nodes/NodeType.java
index 75e00ae136..b7b1a0cd29 100644
--- a/plugins/org.eclipse.emf.cdo.examples.installer/examples/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/nodes/NodeType.java
+++ b/plugins/org.eclipse.emf.cdo.examples.installer/examples/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/nodes/NodeType.java
@@ -12,7 +12,6 @@ package org.eclipse.emf.cdo.examples.client.offline.nodes;
import org.eclipse.emf.cdo.common.CDOCommonRepository.State;
import org.eclipse.emf.cdo.common.branch.CDOBranch;
-import org.eclipse.emf.cdo.common.model.CDOPackageRegistryPopulator;
import org.eclipse.emf.cdo.common.revision.CDORevisionCache;
import org.eclipse.emf.cdo.common.revision.CDORevisionUtil;
import org.eclipse.emf.cdo.examples.client.offline.Application;
@@ -45,6 +44,7 @@ import org.eclipse.net4j.util.container.IPluginContainer;
import org.eclipse.net4j.util.container.SetContainer;
import org.eclipse.net4j.util.event.IEvent;
import org.eclipse.net4j.util.event.IListener;
+import org.eclipse.net4j.util.event.ThrowableEventAdapter;
import org.eclipse.net4j.util.lifecycle.LifecycleUtil;
import org.eclipse.jface.viewers.ComboViewer;
@@ -324,7 +324,8 @@ public abstract class NodeType extends SetContainer<Node> implements IElement
props.put(IRepository.Props.ID_GENERATION_LOCATION, "CLIENT");
IRepository repository = createRepository(node, store, props);
- CDOServerUtil.addRepository(IPluginContainer.INSTANCE, repository);
+ repository.setInitialPackages(CompanyPackage.eINSTANCE);
+ activateRepository(repository);
return repository;
}
@@ -333,6 +334,12 @@ public abstract class NodeType extends SetContainer<Node> implements IElement
return CDOServerUtil.createRepository(REPOSITORY_NAME, store, props);
}
+ protected void activateRepository(IRepository repository)
+ {
+ // Don't do this with failover participants!
+ CDOServerUtil.addRepository(IPluginContainer.INSTANCE, repository);
+ }
+
protected IAcceptor createAcceptor(Node node)
{
String description = "0.0.0.0:" + node.getSetting(PORT_PROPERTY);
@@ -541,8 +548,8 @@ public abstract class NodeType extends SetContainer<Node> implements IElement
final CDOSession session = (CDOSession)IPluginContainer.INSTANCE.getElement("org.eclipse.emf.cdo.sessions",
"cdo", "jvm://example?repositoryName=" + REPOSITORY_NAME);
+ session.getPackageRegistry().putEPackage(CompanyPackage.eINSTANCE);
- CDOPackageRegistryPopulator.populate(session.getPackageRegistry());
node.setObject(CDOSession.class, session);
if (session.getRepositoryInfo().getState() == State.INITIAL)
@@ -735,6 +742,8 @@ public abstract class NodeType extends SetContainer<Node> implements IElement
*/
public static class FailoverRepository extends Repository
{
+ private FailoverAgent agent;
+
public FailoverRepository(NodeManager manager)
{
super(manager);
@@ -755,11 +764,18 @@ public abstract class NodeType extends SetContainer<Node> implements IElement
final String monitorAddress = "localhost:" + monitorNode.getSetting(PORT_PROPERTY);
ISynchronizableRepository repository = CDOServerUtil.createFailoverParticipant(REPOSITORY_NAME, store, props);
- repository.setInitialPackages(CompanyPackage.eINSTANCE);
- FailoverAgent agent = new FailoverAgent()
+ agent = new FailoverAgent()
{
@Override
+ protected IRepositorySynchronizer createRepositorySynchronizer()
+ {
+ IRepositorySynchronizer synchronizer = super.createRepositorySynchronizer();
+ synchronizer.addListener(ThrowableEventAdapter.ToPrintStream.CONSOLE);
+ return synchronizer;
+ }
+
+ @Override
protected CDONet4jSessionConfiguration createSessionConfiguration(String connectorDescription,
String repositoryName)
{
@@ -773,20 +789,23 @@ public abstract class NodeType extends SetContainer<Node> implements IElement
}
};
- IConnector connector = Net4jUtil.getConnector(IPluginContainer.INSTANCE, "tcp", monitorAddress);
-
- agent.setMonitorConnector(connector);
+ agent.setMonitorConnector(Net4jUtil.getConnector(IPluginContainer.INSTANCE, "tcp", monitorAddress));
agent.setConnectorDescription("localhost:" + node.getSetting(PORT_PROPERTY));
agent.setRepository(repository);
agent.setGroup(monitorNode.getName());
agent.setRate(1500L);
agent.setTimeout(3000L);
- agent.activate();
return repository;
}
@Override
+ protected void activateRepository(IRepository repository)
+ {
+ agent.activate();
+ }
+
+ @Override
public String toString()
{
return "Failover Repositories";
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 38dbd6f23d..cbb13e4e25 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
@@ -440,7 +440,7 @@ public abstract class FailoverExample
}
@Override
- protected IManagedContainer getContainer()
+ public IManagedContainer getContainer()
{
return container;
}
diff --git a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/ReplicateRepositoryRawRequest.java b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/ReplicateRepositoryRawRequest.java
index dd80a267c2..666880a341 100644
--- a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/ReplicateRepositoryRawRequest.java
+++ b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/ReplicateRepositoryRawRequest.java
@@ -35,8 +35,11 @@ public class ReplicateRepositoryRawRequest extends CDOClientRequestWithMonitorin
@Override
protected void requesting(CDODataOutput out, OMMonitor monitor) throws IOException
{
- out.writeInt(context.getLastReplicatedBranchID());
- out.writeLong(context.getLastReplicatedCommitTime());
+ int lastReplicatedBranchID = context.getLastReplicatedBranchID();
+ long lastReplicatedCommitTime = context.getLastReplicatedCommitTime();
+
+ out.writeInt(lastReplicatedBranchID);
+ out.writeLong(lastReplicatedCommitTime);
}
@Override
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBBrowserPage.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBBrowserPage.java
index af35dc73fe..88969155f4 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBBrowserPage.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBBrowserPage.java
@@ -35,7 +35,7 @@ public class DBBrowserPage extends AbstractPage
{
public DBBrowserPage()
{
- super("tables", "Database Tables");
+ super("tables", "DB Tables");
}
public boolean canDisplay(InternalRepository repository)
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreAccessor.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreAccessor.java
index 2e84b7ad9b..9befeee0ed 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreAccessor.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreAccessor.java
@@ -1122,8 +1122,8 @@ public class DBStoreAccessor extends StoreAccessor implements IDBStoreAccessor,
IIDHandler idHandler = store.getIDHandler();
idHandler.rawExport(connection, out, fromCommitTime, toCommitTime);
- IMetaDataManager metaDataManager = store.getMetaDataManager();
- metaDataManager.rawExport(connection, out, fromCommitTime, toCommitTime);
+ // IMetaDataManager metaDataManager = store.getMetaDataManager();
+ // metaDataManager.rawExport(connection, out, fromCommitTime, toCommitTime);
IMappingStrategy mappingStrategy = store.getMappingStrategy();
mappingStrategy.rawExport(this, out, fromBranchID, toBranchID, fromCommitTime, toCommitTime);
@@ -1156,7 +1156,7 @@ public class DBStoreAccessor extends StoreAccessor implements IDBStoreAccessor,
idHandler.rawImport(connection, in, fromCommitTime, toCommitTime, monitor.fork());
- rawImportPackageUnits(in, fromCommitTime, toCommitTime, packageUnits, monitor.fork());
+ // rawImportPackageUnits(in, fromCommitTime, toCommitTime, packageUnits, monitor.fork());
mappingStrategy.rawImport(this, in, fromCommitTime, toCommitTime, monitor.fork(size));
diff --git a/plugins/org.eclipse.emf.cdo.server.lissome/plugin.xml b/plugins/org.eclipse.emf.cdo.server.lissome/plugin.xml
index e8b2bafc64..93c24ce5b2 100644
--- a/plugins/org.eclipse.emf.cdo.server.lissome/plugin.xml
+++ b/plugins/org.eclipse.emf.cdo.server.lissome/plugin.xml
@@ -18,7 +18,7 @@
<factory
class="org.eclipse.emf.cdo.server.internal.lissome.LissomeBrowserPage$Factory"
productGroup="org.eclipse.emf.cdo.server.browserPages"
- type="db">
+ type="lissome">
</factory>
</extension>
diff --git a/plugins/org.eclipse.emf.cdo.server.lissome/src/org/eclipse/emf/cdo/server/internal/lissome/LissomeBrowserPage.java b/plugins/org.eclipse.emf.cdo.server.lissome/src/org/eclipse/emf/cdo/server/internal/lissome/LissomeBrowserPage.java
index 5ddadf39dc..d5ada70bae 100644
--- a/plugins/org.eclipse.emf.cdo.server.lissome/src/org/eclipse/emf/cdo/server/internal/lissome/LissomeBrowserPage.java
+++ b/plugins/org.eclipse.emf.cdo.server.lissome/src/org/eclipse/emf/cdo/server/internal/lissome/LissomeBrowserPage.java
@@ -27,7 +27,7 @@ public class LissomeBrowserPage extends AbstractPage
{
public LissomeBrowserPage()
{
- super("tables", "Database Tables");
+ super("ltables", "LissomeDB Tables");
}
public boolean canDisplay(InternalRepository repository)
diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/net4j/FailoverAgent.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/net4j/FailoverAgent.java
index 5497a2139c..c372698fda 100644
--- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/net4j/FailoverAgent.java
+++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/net4j/FailoverAgent.java
@@ -12,6 +12,8 @@ package org.eclipse.emf.cdo.server.net4j;
import org.eclipse.emf.cdo.common.CDOCommonRepository;
import org.eclipse.emf.cdo.server.CDOServerUtil;
+import org.eclipse.emf.cdo.server.IRepository;
+import org.eclipse.emf.cdo.server.IRepositorySynchronizer;
import org.eclipse.emf.cdo.server.ISynchronizableRepository;
import org.eclipse.emf.cdo.session.CDOSessionConfiguration;
import org.eclipse.emf.cdo.session.CDOSessionConfigurationFactory;
@@ -56,6 +58,8 @@ public abstract class FailoverAgent extends Lifecycle implements CDOSessionConfi
private InternalFailoverParticipant repository;
+ private long repositoryActivationTimeout = 10000L;
+
private Protocol protocol;
private String masterConnectorDescription;
@@ -68,6 +72,14 @@ public abstract class FailoverAgent extends Lifecycle implements CDOSessionConfi
{
}
+ /**
+ * @since 4.1
+ */
+ public IManagedContainer getContainer()
+ {
+ return IPluginContainer.INSTANCE;
+ }
+
public IConnector getMonitorConnector()
{
return monitorConnector;
@@ -156,6 +168,23 @@ public abstract class FailoverAgent extends Lifecycle implements CDOSessionConfi
this.repository = (InternalFailoverParticipant)repository;
}
+ /**
+ * @since 4.1
+ */
+ public long getRepositoryActivationTimeout()
+ {
+ return repositoryActivationTimeout;
+ }
+
+ /**
+ * @since 4.1
+ */
+ public void setRepositoryActivationTimeout(long repositoryActivationTimeout)
+ {
+ checkInactive();
+ this.repositoryActivationTimeout = repositoryActivationTimeout;
+ }
+
public Protocol getProtocol()
{
return protocol;
@@ -180,20 +209,25 @@ public abstract class FailoverAgent extends Lifecycle implements CDOSessionConfi
protected void doActivate() throws Exception
{
super.doActivate();
+ IManagedContainer container = getContainer();
if (timer == null)
{
- timer = (Timer)getContainer().getElement(TimerLifecycle.PRODUCT_GROUP, DaemonFactory.TYPE, null);
+ timer = (Timer)container.getElement(TimerLifecycle.PRODUCT_GROUP, DaemonFactory.TYPE, null);
}
- synchronizer = (InternalRepositorySynchronizer)CDOServerUtil.createRepositorySynchronizer(this);
+ synchronizer = (InternalRepositorySynchronizer)createRepositorySynchronizer();
repository.setSynchronizer(synchronizer);
- setMaster(); // Will be adjusted with the following SIGNAL_PUBLISH_MASTER
-
- LifecycleUtil.activate(repository);
+ // setMaster(); // Will be adjusted with the following SIGNAL_PUBLISH_MASTER
protocol = new Protocol(this);
protocol.start(rate, timeout);
+
+ // Repository will be activated asynchronously by the agent protocol, so wait
+ if (!LifecycleUtil.waitForActive(repository, repositoryActivationTimeout))
+ {
+ LifecycleUtil.checkActive(repository);
+ }
}
@Override
@@ -220,14 +254,17 @@ public abstract class FailoverAgent extends Lifecycle implements CDOSessionConfi
repository.setType(CDOCommonRepository.Type.BACKUP);
}
- protected abstract CDOSessionConfiguration createSessionConfiguration(String connectorDescription,
- String repositoryName);
-
- protected IManagedContainer getContainer()
+ /**
+ * @since 4.1
+ */
+ protected IRepositorySynchronizer createRepositorySynchronizer()
{
- return IPluginContainer.INSTANCE;
+ return CDOServerUtil.createRepositorySynchronizer(this);
}
+ protected abstract CDOSessionConfiguration createSessionConfiguration(String connectorDescription,
+ String repositoryName);
+
/**
* The agent-side implementation of the {@link FailoverMonitor fail-over monitor} protocol.
*
@@ -279,6 +316,13 @@ public abstract class FailoverAgent extends Lifecycle implements CDOSessionConfi
String repositoryName = in.readString();
agent.setBackup(connectorDescription, repositoryName);
}
+
+ IRepository repository = agent.getRepository();
+ if (!repository.isActive())
+ {
+ IManagedContainer container = agent.getContainer();
+ CDOServerUtil.addRepository(container, repository);
+ }
}
};
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Repository.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Repository.java
index 3cf440b6ea..46eb6ec6aa 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Repository.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Repository.java
@@ -1678,27 +1678,32 @@ public class Repository extends Container<Object> implements InternalRepository
public void initSystemPackages()
{
- IStoreAccessor writer = store.getWriter(null);
- StoreThreadLocal.setAccessor(writer);
+ List<InternalCDOPackageUnit> units = new ArrayList<InternalCDOPackageUnit>();
+ units.add(initPackage(EcorePackage.eINSTANCE));
+ units.add(initPackage(EresourcePackage.eINSTANCE));
+ units.add(initPackage(EtypesPackage.eINSTANCE));
- try
+ if (initialPackages != null)
{
- List<InternalCDOPackageUnit> units = new ArrayList<InternalCDOPackageUnit>();
- units.add(initSystemPackage(EcorePackage.eINSTANCE));
- units.add(initSystemPackage(EresourcePackage.eINSTANCE));
- units.add(initSystemPackage(EtypesPackage.eINSTANCE));
+ // if (type != Type.MASTER)
+ // {
+ // throw new IllegalStateException("Only master repositories can have initial packages");
+ // }
- if (initialPackages != null)
+ for (EPackage initialPackage : initialPackages)
{
- for (EPackage initialPackage : initialPackages)
+ if (!packageRegistry.containsKey(initialPackage.getNsURI()))
{
- if (!packageRegistry.containsKey(initialPackage.getNsURI()))
- {
- units.add(initSystemPackage(initialPackage));
- }
+ units.add(initPackage(initialPackage));
}
}
+ }
+ IStoreAccessor writer = store.getWriter(null);
+ StoreThreadLocal.setAccessor(writer);
+
+ try
+ {
InternalCDOPackageUnit[] systemUnits = units.toArray(new InternalCDOPackageUnit[units.size()]);
writer.writePackageUnits(systemUnits, new Monitor());
writer.commit(new Monitor());
@@ -1709,7 +1714,7 @@ public class Repository extends Container<Object> implements InternalRepository
}
}
- protected InternalCDOPackageUnit initSystemPackage(EPackage ePackage)
+ protected InternalCDOPackageUnit initPackage(EPackage ePackage)
{
EMFUtil.registerPackage(ePackage, packageRegistry);
InternalCDOPackageInfo packageInfo = packageRegistry.getPackageInfo(ePackage);
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/TimeStampAuthority.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/TimeStampAuthority.java
index 3db8a538c9..db3d9d245c 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/TimeStampAuthority.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/TimeStampAuthority.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Caspar De Groot - initial API and implementation
*/
@@ -25,7 +25,7 @@ import java.util.concurrent.locks.ReentrantLock;
/**
* Bugzilla 297940, 290032
- *
+ *
* @author Caspar De Groot
*/
class TimeStampAuthority
@@ -130,7 +130,7 @@ class TimeStampAuthority
while (!finishedTransactions.isEmpty() && (oldestFinished = finishedTransactions.first()) < oldestRunning)
{
finishedTransactions.remove(oldestFinished);
- lastFinishedTimeStamp = oldestFinished;
+ internalSetLastFinished(oldestFinished);
}
// If we actually changed the lastFinishedTimeStamp, we need to notify waiting threads
@@ -203,15 +203,21 @@ class TimeStampAuthority
{
if (lastFinishedTimeStamp < lastCommitTimeStamp)
{
- lastFinishedTimeStamp = lastCommitTimeStamp;
+ internalSetLastFinished(lastCommitTimeStamp);
lastCommitTimeStampLock.notifyAll();
}
}
}
+ private void internalSetLastFinished(long lastCommitTimeStamp)
+ {
+ lastFinishedTimeStamp = lastCommitTimeStamp;
+ repository.getStore().setLastCommitTime(lastFinishedTimeStamp);
+ }
+
/**
* A separate class for better monitor debugging.
- *
+ *
* @author Eike Stepper
*/
private static final class LastCommitTimeStampLock
@@ -220,7 +226,7 @@ class TimeStampAuthority
/**
* A separate class for better monitor debugging.
- *
+ *
* @author Eike Stepper
*/
private static final class StrictOrderingLock extends ReentrantLock
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/FailoverParticipant.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/FailoverParticipant.java
index 7bef59caae..ba2f971bae 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/FailoverParticipant.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/FailoverParticipant.java
@@ -51,6 +51,7 @@ public class FailoverParticipant extends SynchronizableRepository implements Int
{
// Switch off synchronizer
doStopSynchronization();
+ setState(ONLINE);
}
else
{
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/RepositorySynchronizer.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/RepositorySynchronizer.java
index 7398a86daf..5249562309 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/RepositorySynchronizer.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/RepositorySynchronizer.java
@@ -16,7 +16,6 @@ import org.eclipse.emf.cdo.common.CDOCommonSession.Options.LockNotificationMode;
import org.eclipse.emf.cdo.common.CDOCommonSession.Options.PassiveUpdateMode;
import org.eclipse.emf.cdo.common.branch.CDOBranch;
import org.eclipse.emf.cdo.common.branch.CDOBranchCreatedEvent;
-import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
import org.eclipse.emf.cdo.common.commit.CDOCommitInfo;
import org.eclipse.emf.cdo.common.id.CDOID;
import org.eclipse.emf.cdo.common.lock.CDOLockChangeInfo;
@@ -180,6 +179,11 @@ public class RepositorySynchronizer extends PriorityQueueRunner implements Inter
public CDOSession[] getElements()
{
+ if (remoteSession == null)
+ {
+ return new CDOSession[0];
+ }
+
return new CDOSession[] { remoteSession };
}
@@ -226,11 +230,12 @@ public class RepositorySynchronizer extends PriorityQueueRunner implements Inter
protected void handleConnect()
{
+ scheduleReplicate();
+
remoteSession.addListener(remoteSessionListener);
remoteSession.getBranchManager().addListener(remoteSessionListener);
fireEvent(new SingleDeltaContainerEvent<CDOSession>(this, remoteSession, IContainerDelta.Kind.ADDED));
- scheduleReplicate();
}
protected void handleDisconnect()
@@ -240,22 +245,27 @@ public class RepositorySynchronizer extends PriorityQueueRunner implements Inter
TRACER.trace("Disconnected from master."); //$NON-NLS-1$
}
- if (localRepository.getRootResourceID() == null)
+ if (localRepository.hasBeenReplicated())
{
- localRepository.setState(CDOCommonRepository.State.INITIAL);
+ localRepository.setState(CDOCommonRepository.State.OFFLINE);
}
else
{
- localRepository.setState(CDOCommonRepository.State.OFFLINE);
+ localRepository.setState(CDOCommonRepository.State.INITIAL);
}
- CDOSession element = remoteSession;
+ if (remoteSession != null)
+ {
+ CDOSession element = remoteSession;
- remoteSession.getBranchManager().removeListener(remoteSessionListener);
- remoteSession.removeListener(remoteSessionListener);
- remoteSession = null;
+ remoteSession.getBranchManager().removeListener(remoteSessionListener);
+ remoteSession.removeListener(remoteSessionListener);
+ remoteSession.close();
+ remoteSession = null;
+
+ fireEvent(new SingleDeltaContainerEvent<CDOSession>(this, element, IContainerDelta.Kind.REMOVED));
+ }
- fireEvent(new SingleDeltaContainerEvent<CDOSession>(this, element, IContainerDelta.Kind.REMOVED));
reconnect();
}
@@ -387,7 +397,7 @@ public class RepositorySynchronizer extends PriorityQueueRunner implements Inter
{
if (TRACER.isEnabled())
{
- TRACER.format("ReplConnectionication attempt failed. Retrying in {0} seconds...", retryInterval); //$NON-NLS-1$
+ TRACER.format("Connection attempt failed. Retrying in {0} seconds...", retryInterval); //$NON-NLS-1$
}
fireThrowable(ex);
@@ -419,8 +429,9 @@ public class RepositorySynchronizer extends PriorityQueueRunner implements Inter
InternalCDORevisionCache cache = remoteSession.getRevisionManager().getCache();
if (!(cache instanceof NOOPRevisionCache))
{
- throw new IllegalStateException("Master session does not use a NOOPRevisionCache: "
- + cache.getClass().getName());
+ String message = "Master session does not use a NOOPRevisionCache: " + cache.getClass().getName();
+ OM.LOG.error(message);
+ throw new Error(message);
}
}
}
@@ -444,7 +455,7 @@ public class RepositorySynchronizer extends PriorityQueueRunner implements Inter
TRACER.trace("Synchronizing with master..."); //$NON-NLS-1$
}
- boolean firstSyncing = localRepository.getLastReplicatedCommitTime() == CDOBranchPoint.UNSPECIFIED_DATE;
+ boolean firstSyncing = !localRepository.hasBeenReplicated();
if (!firstSyncing)
{
localRepository.setState(CDOCommonRepository.State.SYNCING);
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/SynchronizableRepository.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/SynchronizableRepository.java
index 6ae41c78b1..a7b10ddc13 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/SynchronizableRepository.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/SynchronizableRepository.java
@@ -42,6 +42,8 @@ import org.eclipse.emf.cdo.internal.common.commit.CDOCommitDataImpl;
import org.eclipse.emf.cdo.internal.server.Repository;
import org.eclipse.emf.cdo.internal.server.TransactionCommitContext;
import org.eclipse.emf.cdo.server.IStoreAccessor;
+import org.eclipse.emf.cdo.server.IStoreAccessor.CommitContext;
+import org.eclipse.emf.cdo.server.ITransaction;
import org.eclipse.emf.cdo.server.StoreThreadLocal;
import org.eclipse.emf.cdo.spi.common.branch.InternalCDOBranch;
import org.eclipse.emf.cdo.spi.common.branch.InternalCDOBranchManager;
@@ -177,6 +179,11 @@ public abstract class SynchronizableRepository extends Repository.Default implem
return list.toArray();
}
+ public boolean hasBeenReplicated()
+ {
+ return getLastReplicatedCommitTime() != CDOBranchPoint.UNSPECIFIED_DATE;
+ }
+
public int getLastReplicatedBranchID()
{
return lastReplicatedBranchID;
@@ -203,6 +210,18 @@ public abstract class SynchronizableRepository extends Repository.Default implem
}
}
+ @Override
+ public void setLastCommitTimeStamp(long lastCommitTimeStamp)
+ {
+ super.setLastCommitTimeStamp(lastCommitTimeStamp);
+
+ if (getType() == MASTER)
+ {
+ // This MASTER might become a BACKUP, so don't replicate this commit in the future
+ setLastReplicatedCommitTime(lastCommitTimeStamp);
+ }
+ }
+
public String[] getLockAreaIDs()
{
try
@@ -462,6 +481,19 @@ public abstract class SynchronizableRepository extends Repository.Default implem
}
@Override
+ public void notifyWriteAccessHandlers(ITransaction transaction, CommitContext commitContext, boolean beforeCommit,
+ OMMonitor monitor)
+ {
+ if (beforeCommit && commitContext.getNewPackageUnits().length != 0)
+ {
+ throw new IllegalStateException(
+ "Synchronizable repositories don't support dynamic addition of new packages. Use IRepository.setInitialPackages() instead.");
+ }
+
+ super.notifyWriteAccessHandlers(transaction, commitContext, beforeCommit, monitor);
+ }
+
+ @Override
public abstract InternalCommitContext createCommitContext(InternalTransaction transaction);
protected InternalCommitContext createNormalCommitContext(InternalTransaction transaction)
@@ -508,16 +540,22 @@ public abstract class SynchronizableRepository extends Repository.Default implem
store.removePersistentProperties(Collections.singleton(PROP_GRACEFULLY_SHUT_DOWN));
- if (getType() == MASTER)
+ Type type = getType();
+ if (type == MASTER)
{
setState(ONLINE);
}
else
{
- if (getLastReplicatedCommitTime() != CDOBranchPoint.UNSPECIFIED_DATE)
+ if (hasBeenReplicated())
{
setState(OFFLINE);
}
+ // else if (type == BACKUP)
+ // {
+ // // setLastReplicatedBranchID(???);
+ // setLastReplicatedCommitTime(getLastCommitTimeStamp());
+ // }
startSynchronization();
}
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/CDOServerUtil.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/CDOServerUtil.java
index fb92a4825f..157d1148a9 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/CDOServerUtil.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/CDOServerUtil.java
@@ -160,8 +160,13 @@ public final class CDOServerUtil
{
FailoverParticipant repository = new FailoverParticipant();
initRepository(repository, name, store, props);
- repository.setSynchronizer((InternalRepositorySynchronizer)synchronizer);
- repository.setType(master ? CDOCommonRepository.Type.MASTER : CDOCommonRepository.Type.BACKUP);
+
+ if (synchronizer != null)
+ {
+ repository.setSynchronizer((InternalRepositorySynchronizer)synchronizer);
+ repository.setType(master ? CDOCommonRepository.Type.MASTER : CDOCommonRepository.Type.BACKUP);
+ }
+
return repository;
}
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IRepository.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IRepository.java
index f26b0af5fe..6491faf0b5 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IRepository.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IRepository.java
@@ -21,6 +21,7 @@ import org.eclipse.emf.cdo.common.revision.CDORevisionManager;
import org.eclipse.emf.cdo.common.util.CDOCommonUtil;
import org.eclipse.net4j.util.container.IContainer;
+import org.eclipse.net4j.util.lifecycle.ILifecycle;
import org.eclipse.net4j.util.om.monitor.OMMonitor;
import org.eclipse.emf.ecore.EPackage;
@@ -48,7 +49,7 @@ import java.util.Set;
* @apiviz.composedOf {@link org.eclipse.emf.cdo.common.commit.CDOCommitInfoHandler}
* @apiviz.composedOf {@link IRepository.Handler} - - accessHandlers
*/
-public interface IRepository extends CDOCommonRepository, IQueryHandlerProvider, IContainer<Object>
+public interface IRepository extends CDOCommonRepository, IQueryHandlerProvider, IContainer<Object>, ILifecycle
{
/**
* @since 3.0
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/ISynchronizableRepository.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/ISynchronizableRepository.java
index ffba11b3be..c56a5a3e9d 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/ISynchronizableRepository.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/ISynchronizableRepository.java
@@ -12,7 +12,7 @@ package org.eclipse.emf.cdo.server;
/**
* A repository with the ability to {@link IRepositorySynchronizer synchronize} its content with another repository.
- *
+ *
* @author Eike Stepper
* @since 3.0
* @noextend This interface is not intended to be extended by clients.
@@ -32,6 +32,11 @@ public interface ISynchronizableRepository extends IRepository
public long getLastReplicatedCommitTime();
/**
+ * @since 4.2
+ */
+ public boolean hasBeenReplicated();
+
+ /**
* @since 4.1
*/
public void goOnline();

Back to the top