Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2012-11-18 09:39:25 +0000
committerEike Stepper2012-11-18 09:39:25 +0000
commit123962851cf24bd54bb6c5d5b83a69697b997479 (patch)
treeb9ab50553fa1c9e3894f482fc40d7c45f7ae5b63 /plugins/org.eclipse.emf.cdo.examples.client.offline
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
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.examples.client.offline')
-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
2 files changed, 40 insertions, 12 deletions
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";

Back to the top