summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2008-05-03 05:28:36 (EDT)
committerEike Stepper2008-05-03 05:28:36 (EDT)
commit093223e0daf32cf0a265ec14d3b9dd88af45b9f3 (patch)
treec247e284eec463f6eb4396663915d0047ef47fa9
parent51e2386e4b69a3a66a5b0436efc2c7f22e78d441 (diff)
downloadcdo-093223e0daf32cf0a265ec14d3b9dd88af45b9f3.zip
cdo-093223e0daf32cf0a265ec14d3b9dd88af45b9f3.tar.gz
cdo-093223e0daf32cf0a265ec14d3b9dd88af45b9f3.tar.bz2
[227995] Implement a self-populating EPackageRegistry
https://bugs.eclipse.org/bugs/show_bug.cgi?id=227995
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/PackageRegistryTest.java3
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/CDOPackageTypeRegistryImpl.java5
-rw-r--r--plugins/org.eclipse.net4j.tcp/src/org/eclipse/net4j/internal/tcp/bundle/OM.java3
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/bundle/OM.java3
4 files changed, 10 insertions, 4 deletions
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/PackageRegistryTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/PackageRegistryTest.java
index 87b59c5..bd3e340 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/PackageRegistryTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/PackageRegistryTest.java
@@ -31,6 +31,7 @@ import org.eclipse.emf.cdo.tests.model3.Model3Package;
import org.eclipse.emf.cdo.tests.model3.subpackage.Class2;
import org.eclipse.emf.cdo.tests.model3.subpackage.SubpackageFactory;
import org.eclipse.emf.cdo.tests.model3.subpackage.SubpackagePackage;
+import org.eclipse.emf.cdo.util.CDOPackageTypeRegistry;
import org.eclipse.emf.cdo.util.CDOUtil;
import org.eclipse.emf.common.util.URI;
@@ -234,6 +235,8 @@ public class PackageRegistryTest extends AbstractCDOTest
public void testSelfPopulating() throws Exception
{
+ CDOPackageTypeRegistry.INSTANCE.register(Model1Package.eINSTANCE);
+
{
// Create resource in session 1
CDOSession session = CDOUtil.openSession(getConnector(), REPOSITORY_NAME, true, true);
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/CDOPackageTypeRegistryImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/CDOPackageTypeRegistryImpl.java
index 4a2fa64..cce0af5 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/CDOPackageTypeRegistryImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/CDOPackageTypeRegistryImpl.java
@@ -10,12 +10,12 @@
**************************************************************************/
package org.eclipse.emf.internal.cdo.util;
+import org.eclipse.emf.cdo.CDOObject;
import org.eclipse.emf.cdo.eresource.EresourcePackage;
import org.eclipse.emf.cdo.util.CDOPackageType;
import org.eclipse.emf.cdo.util.CDOPackageTypeRegistry;
import org.eclipse.emf.cdo.util.CDOUtil;
-import org.eclipse.emf.internal.cdo.CDOObjectImpl;
import org.eclipse.emf.internal.cdo.bundle.OM;
import org.eclipse.net4j.internal.util.registry.HashMapRegistry;
@@ -90,8 +90,9 @@ public final class CDOPackageTypeRegistryImpl extends HashMapRegistry<String, CD
// Legacy system might not be available
}
+ // TODO This might not work if the model interface don't extend CDOObject
Class<?> instanceClass = eClass.getInstanceClass();
- if (CDOObjectImpl.class.isAssignableFrom(instanceClass))
+ if (CDOObject.class.isAssignableFrom(instanceClass))
{
return CDOPackageType.NATIVE;
}
diff --git a/plugins/org.eclipse.net4j.tcp/src/org/eclipse/net4j/internal/tcp/bundle/OM.java b/plugins/org.eclipse.net4j.tcp/src/org/eclipse/net4j/internal/tcp/bundle/OM.java
index e691670..7600c05 100644
--- a/plugins/org.eclipse.net4j.tcp/src/org/eclipse/net4j/internal/tcp/bundle/OM.java
+++ b/plugins/org.eclipse.net4j.tcp/src/org/eclipse/net4j/internal/tcp/bundle/OM.java
@@ -29,7 +29,8 @@ public abstract class OM
public static final OMTracer DEBUG = BUNDLE.tracer("debug"); //$NON-NLS-1$
- public static final int PROTOCOL_REGISTRATION_TIMEOUT = BUNDLE.getDebugOption("protocol.registration.timeout", 10000); //$NON-NLS-1$
+ public static final int PROTOCOL_REGISTRATION_TIMEOUT = BUNDLE.getDebugSupport().getDebugOption(
+ "protocol.registration.timeout", 10000); //$NON-NLS-1$
public static final OMLogger LOG = BUNDLE.logger();
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/bundle/OM.java b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/bundle/OM.java
index 002deb0..01fbec2 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/bundle/OM.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/bundle/OM.java
@@ -43,7 +43,8 @@ public abstract class OM
public static final OMTracer DEBUG_SIGNAL = DEBUG.tracer("signal"); //$NON-NLS-1$
- public static final boolean SET_SIGNAL_THREAD_NAME = BUNDLE.getDebugOption("set.signal.thread.name", false); //$NON-NLS-1$
+ public static final boolean SET_SIGNAL_THREAD_NAME = BUNDLE.getDebugSupport().getDebugOption(
+ "set.signal.thread.name", false); //$NON-NLS-1$
public static final OMLogger LOG = BUNDLE.logger();