summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-07-20 14:18:27 (EDT)
committerEike Stepper2007-07-20 14:18:27 (EDT)
commite761b11da54144b11ea1883de0f0b5a0f8252a04 (patch)
treebafb17c469f3971dac65113f0c1eba561d520ed6
parent570e063aef17b811865ec1348b9ae911c10a4c64 (diff)
downloadcdo-e761b11da54144b11ea1883de0f0b5a0f8252a04.zip
cdo-e761b11da54144b11ea1883de0f0b5a0f8252a04.tar.gz
cdo-e761b11da54144b11ea1883de0f0b5a0f8252a04.tar.bz2
*** empty log message ***
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CommitTransactionIndication.java9
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model1/plugin.xml3
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOView.java4
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/EMFUtil.java13
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionImpl.java59
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStateMachine.java5
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStore.java3
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOTransactionImpl.java17
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java58
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/ModelUtil.java18
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/collection/Pair.java47
11 files changed, 193 insertions, 43 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CommitTransactionIndication.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CommitTransactionIndication.java
index f3b8f46..48a69fc 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CommitTransactionIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CommitTransactionIndication.java
@@ -60,6 +60,15 @@ public class CommitTransactionIndication extends CDOServerIndication
@Override
protected void indicating(ExtendedDataInputStream in) throws IOException
{
+ // try
+ // {
+ // Thread.sleep(100000000000L);
+ // }
+ // catch (InterruptedException ex)
+ // {
+ // throw new IOException(ex.getMessage());
+ // }
+
newPackages = readNewPackages(in);
newResources = readNewResources(in);
newObjects = readNewObjects(in);
diff --git a/plugins/org.eclipse.emf.cdo.tests.model1/plugin.xml b/plugins/org.eclipse.emf.cdo.tests.model1/plugin.xml
index 0451548..b032bee 100644
--- a/plugins/org.eclipse.emf.cdo.tests.model1/plugin.xml
+++ b/plugins/org.eclipse.emf.cdo.tests.model1/plugin.xml
@@ -13,8 +13,7 @@
<extension point="org.eclipse.emf.ecore.generated_package">
<package
uri = "http://www.eclipse.org/emf/CDO/tests/model1/1.0.0"
- class = "org.eclipse.emf.cdo.tests.model1.Model1Package"
- genModel = "model/model1.genmodel"/>
+ class = "org.eclipse.emf.cdo.tests.model1.Model1Package"/>
</extension>
<extension point="org.eclipse.emf.cdo.persistent_package">
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOView.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOView.java
index 3435dd0..5c42f8a 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOView.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOView.java
@@ -56,7 +56,9 @@ public interface CDOView extends INotifier
public CDOObject newInstance(CDOClass cdoClass);
- public CDORevision getRevision(CDOID id);
+ public CDOObject lookupInstance(CDOID id);
+
+ public CDORevision lookupRevision(CDOID id);
public boolean isDirty();
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/EMFUtil.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/EMFUtil.java
index 23e167f..45c5895 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/EMFUtil.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/EMFUtil.java
@@ -13,10 +13,12 @@ package org.eclipse.emf.cdo.util;
import org.eclipse.net4j.util.io.IORuntimeException;
import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.common.util.TreeIterator;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EClassifier;
import org.eclipse.emf.ecore.EDataType;
import org.eclipse.emf.ecore.EEnum;
+import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.EStructuralFeature;
@@ -42,6 +44,17 @@ public final class EMFUtil
{
}
+ public static int countAllContents(EObject eObject)
+ {
+ int count = 0;
+ for (TreeIterator<EObject> it = eObject.eAllContents(); it.hasNext(); it.next())
+ {
+ ++count;
+ }
+
+ return count;
+ }
+
public static List<EClass> getPersistentClasses(EPackage ePackage)
{
List<EClass> result = new ArrayList();
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionImpl.java
index 9c6fea5..c725e05 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionImpl.java
@@ -14,7 +14,10 @@ import org.eclipse.emf.cdo.CDOSession;
import org.eclipse.emf.cdo.CDOSessionInvalidationEvent;
import org.eclipse.emf.cdo.CDOSessionViewsEvent;
import org.eclipse.emf.cdo.CDOView;
+import org.eclipse.emf.cdo.internal.protocol.CDOIDImpl;
+import org.eclipse.emf.cdo.internal.protocol.CDOIDRangeImpl;
import org.eclipse.emf.cdo.protocol.CDOID;
+import org.eclipse.emf.cdo.protocol.CDOIDRange;
import org.eclipse.emf.cdo.util.CDOUtil;
import org.eclipse.net4j.ConnectorException;
@@ -31,7 +34,10 @@ import org.eclipse.net4j.util.event.EventUtil;
import org.eclipse.net4j.util.event.IListener;
import org.eclipse.net4j.util.lifecycle.ILifecycle;
+import org.eclipse.emf.common.util.TreeIterator;
+import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.EPackageRegistryImpl;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
@@ -55,6 +61,10 @@ public class CDOSessionImpl extends Lifecycle implements CDOSession
@SuppressWarnings("unused")
private static final ContextTracer TRACER = new ContextTracer(OM.DEBUG_SESSION, CDOSessionImpl.class);
+ private static final long INITIAL_TEMPORARY_ID = -1L;
+
+ private transient long nextTemporaryID = INITIAL_TEMPORARY_ID;
+
private int sessionID;
private IChannel channel;
@@ -69,9 +79,13 @@ public class CDOSessionImpl extends Lifecycle implements CDOSession
private CDORevisionManagerImpl revisionManager;
+ private Map<CDOID, InternalEObject> idToMetaInstanceMap = new HashMap();
+
+ private Map<InternalEObject, CDOID> metaInstanceToIDMap = new HashMap();
+
private Map<ResourceSet, CDOViewImpl> views = new HashMap();
- private int lastViewID = 0;
+ private transient int lastViewID = 0;
private IListener channelListener = new LifecycleEventAdapter()
{
@@ -224,6 +238,49 @@ public class CDOSessionImpl extends Lifecycle implements CDOSession
}
}
+ public CDOIDRange getTemporaryIDRange(long count)
+ {
+ long id1 = nextTemporaryID;
+ nextTemporaryID -= count + count;
+ long id2 = nextTemporaryID + 2;
+ return CDOIDRangeImpl.create(id1, id2);
+ }
+
+ public InternalEObject lookupMetaInstance(CDOID id)
+ {
+ return idToMetaInstanceMap.get(id);
+ }
+
+ public CDOID lookupMetaInstanceID(InternalEObject metaInstance)
+ {
+ return metaInstanceToIDMap.get(metaInstance);
+ }
+
+ public CDOIDRange registerEPackage(EPackage ePackage)
+ {
+ long lowerBound = nextTemporaryID;
+ registerMetaInstance((InternalEObject)ePackage);
+ for (TreeIterator<EObject> it = ePackage.eAllContents(); it.hasNext();)
+ {
+ InternalEObject metaInstance = (InternalEObject)it.next();
+ registerMetaInstance(metaInstance);
+ }
+
+ return CDOIDRangeImpl.create(lowerBound, nextTemporaryID + 2);
+ }
+
+ private void registerMetaInstance(InternalEObject metaInstance)
+ {
+ CDOID id = CDOIDImpl.create(nextTemporaryID);
+ idToMetaInstanceMap.put(id, metaInstance);
+ metaInstanceToIDMap.put(metaInstance, id);
+ --nextTemporaryID;
+ --nextTemporaryID;
+
+ CDOObjectAdapter adapter = CDOObjectAdapter.getOrCreate(metaInstance);
+ adapter.cdoInternalSetID(id);
+ }
+
public void notifyInvalidation(long timeStamp, Set<CDOID> dirtyOIDs, CDOViewImpl excludedView)
{
dirtyOIDs = Collections.unmodifiableSet(dirtyOIDs);
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStateMachine.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStateMachine.java
index 583ff8f..ebb226e 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStateMachine.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStateMachine.java
@@ -3,7 +3,6 @@ package org.eclipse.emf.internal.cdo;
import org.eclipse.emf.cdo.CDOState;
import org.eclipse.emf.cdo.eresource.CDOResource;
import org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl;
-import org.eclipse.emf.cdo.internal.protocol.CDOIDImpl;
import org.eclipse.emf.cdo.internal.protocol.model.CDOClassImpl;
import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
import org.eclipse.emf.cdo.protocol.CDOID;
@@ -310,7 +309,7 @@ public final class CDOStateMachine
CDOTransactionImpl transaction = getTransaction(view);
// Prepare object
- CDOID id = CDOIDImpl.create(transaction.getNextTemporaryID());
+ CDOID id = transaction.getNextTemporaryID();
object.cdoInternalSetID(id);
object.cdoInternalSetResource(resource);
object.cdoInternalSetView(view);
@@ -453,7 +452,7 @@ public final class CDOStateMachine
{
CDOID id = object.cdoID();
CDOViewImpl view = (CDOViewImpl)object.cdoView();
- CDORevisionImpl revision = view.getRevision(id);
+ CDORevisionImpl revision = view.lookupRevision(id);
object.cdoInternalSetRevision(revision);
object.cdoInternalSetState(CDOState.CLEAN);
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStore.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStore.java
index bd1d579..4ef8c76 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStore.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStore.java
@@ -11,7 +11,6 @@
package org.eclipse.emf.internal.cdo;
import org.eclipse.emf.cdo.internal.protocol.model.CDOFeatureImpl;
-import org.eclipse.emf.cdo.internal.protocol.model.CDOPackageManagerImpl;
import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
import org.eclipse.emf.cdo.protocol.CDOID;
import org.eclipse.emf.cdo.protocol.util.ImplementationError;
@@ -388,7 +387,7 @@ public final class CDOStore implements EStore
throw new IllegalStateException("view == null");
}
- CDOPackageManagerImpl packageManager = view.getSession().getPackageManager();
+ CDOSessionPackageManager packageManager = view.getSession().getPackageManager();
return ModelUtil.getCDOFeature(eFeature, packageManager);
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOTransactionImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOTransactionImpl.java
index a8fb2b2..c1a56bf 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOTransactionImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOTransactionImpl.java
@@ -11,6 +11,7 @@
package org.eclipse.emf.internal.cdo;
import org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl;
+import org.eclipse.emf.cdo.internal.protocol.CDOIDImpl;
import org.eclipse.emf.cdo.internal.protocol.model.CDOPackageImpl;
import org.eclipse.emf.cdo.internal.protocol.model.CDOPackageManagerImpl;
import org.eclipse.emf.cdo.protocol.CDOID;
@@ -35,9 +36,9 @@ public class CDOTransactionImpl
{
private static final ContextTracer TRACER = new ContextTracer(OM.DEBUG_TRANSCTION, CDOTransactionImpl.class);
- private static final long INITIAL_TEMPORARY_ID = -1L;
+ private static final long INITIAL_TEMPORARY_ID = -2L;
- private long nextTemporaryID = INITIAL_TEMPORARY_ID;
+ private transient long nextTemporaryID = INITIAL_TEMPORARY_ID;
private CDOViewImpl view;
@@ -86,14 +87,12 @@ public class CDOTransactionImpl
return dirtyObjects;
}
- public long getNextTemporaryID()
+ public CDOID getNextTemporaryID()
{
- return nextTemporaryID--;
- }
-
- public void resetTemporaryCDOID()
- {
- nextTemporaryID = INITIAL_TEMPORARY_ID;
+ long id = nextTemporaryID;
+ --nextTemporaryID;
+ --nextTemporaryID;
+ return CDOIDImpl.create(id);
}
public CommitTransactionResult commit()
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java
index 2669693..b4fb174 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java
@@ -92,20 +92,13 @@ public class CDOViewImpl extends org.eclipse.net4j.internal.util.event.Notifier
{
public CDOID convertToID(Object object)
{
- try
+ CDOID id = (CDOID)CDOViewImpl.this.convertToID(object);
+ if (TRACER.isEnabled())
{
- CDOID id = (CDOID)CDOViewImpl.this.convertToID(object);
- if (TRACER.isEnabled())
- {
- TRACER.format("Converted dangling reference: {0} --> {1}", object, id);
- }
-
- return id;
- }
- catch (ClassCastException ex)
- {
- throw new IllegalStateException("Dangling reference: " + object, ex);
+ TRACER.format("Converted dangling reference: {0} --> {1}", object, id);
}
+
+ return id;
}
};
}
@@ -233,7 +226,7 @@ public class CDOViewImpl extends org.eclipse.net4j.internal.util.event.Notifier
return newInstance(eClass);
}
- public CDORevisionImpl getRevision(CDOID id)
+ public CDORevisionImpl lookupRevision(CDOID id)
{
CDORevisionResolver revisionManager = session.getRevisionManager();
if (isReadWrite())
@@ -244,7 +237,7 @@ public class CDOViewImpl extends org.eclipse.net4j.internal.util.event.Notifier
return (CDORevisionImpl)revisionManager.getRevision(id, timeStamp);
}
- public CDOObject lookupObject(CDOID id)
+ public InternalCDOObject lookupInstance(CDOID id)
{
if (id.equals(lastLookupID))
{
@@ -255,7 +248,20 @@ public class CDOViewImpl extends org.eclipse.net4j.internal.util.event.Notifier
lastLookupObject = objects.get(id);
if (lastLookupObject == null)
{
- lastLookupObject = createObject(id);
+ if (id.isMeta())
+ {
+ InternalEObject metaObject = session.lookupMetaInstance(id);
+ CDOObjectAdapter adapter = CDOObjectAdapter.getOrCreate(metaObject);
+ adapter.cdoInternalSetID(id);
+ adapter.cdoInternalSetState(CDOState.CLEAN);
+ adapter.cdoInternalSetView(this);
+ lastLookupObject = adapter;
+ }
+ else
+ {
+ lastLookupObject = createObject(id);
+ }
+
registerObject(lastLookupObject);
}
@@ -317,7 +323,23 @@ public class CDOViewImpl extends org.eclipse.net4j.internal.util.event.Notifier
{
if (potentialObject instanceof InternalEObject)
{
- CDOObjectAdapter adapter = CDOObjectAdapter.get((InternalEObject)potentialObject);
+ InternalEObject eObject = (InternalEObject)potentialObject;
+ CDOObjectAdapter adapter = CDOObjectAdapter.get(eObject);
+ if (adapter == null)
+ {
+ eObject = (InternalEObject)EcoreUtil.resolve(eObject, resourceSet);
+ CDOID id = session.lookupMetaInstanceID(eObject);
+ if (id != null)
+ {
+ if (id.getValue() == -777)
+ {
+ System.out.println(id);
+ }
+
+ adapter = (CDOObjectAdapter)lookupInstance(id);
+ }
+ }
+
if (adapter != null)
{
potentialObject = adapter;
@@ -352,7 +374,7 @@ public class CDOViewImpl extends org.eclipse.net4j.internal.util.event.Notifier
}
CDOID id = (CDOID)potentialID;
- CDOObject result = lookupObject(id);
+ CDOObject result = lookupInstance(id);
if (result == null)
{
throw new ImplementationError("ID not registered: " + id);
@@ -592,7 +614,7 @@ public class CDOViewImpl extends org.eclipse.net4j.internal.util.event.Notifier
TRACER.format("Creating object from view: ID={0}", id);
}
- CDORevisionImpl revision = getRevision(id);
+ CDORevisionImpl revision = lookupRevision(id);
CDOClassImpl cdoClass = revision.getCDOClass();
CDOID resourceID = revision.getResourceID();
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/ModelUtil.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/ModelUtil.java
index 89b3bdf..dd4595b 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/ModelUtil.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/ModelUtil.java
@@ -21,6 +21,7 @@ import org.eclipse.emf.cdo.internal.protocol.model.CDOTypeImpl;
import org.eclipse.emf.cdo.internal.protocol.model.core.CDOCorePackageImpl;
import org.eclipse.emf.cdo.internal.protocol.model.resource.CDOResourceClassImpl;
import org.eclipse.emf.cdo.internal.protocol.model.resource.CDOResourcePackageImpl;
+import org.eclipse.emf.cdo.protocol.CDOIDRange;
import org.eclipse.emf.cdo.protocol.util.ImplementationError;
import org.eclipse.emf.cdo.util.EMFUtil;
@@ -33,6 +34,8 @@ import org.eclipse.emf.ecore.EcorePackage;
import org.eclipse.emf.ecore.impl.EPackageImpl;
import org.eclipse.emf.internal.cdo.CDOFactoryImpl;
import org.eclipse.emf.internal.cdo.CDOPackageRegistryImpl;
+import org.eclipse.emf.internal.cdo.CDOSessionImpl;
+import org.eclipse.emf.internal.cdo.CDOSessionPackageManager;
/**
* @author Eike Stepper
@@ -87,7 +90,7 @@ public final class ModelUtil
return CDOTypeImpl.STRING;
}
- public static CDOPackageImpl getCDOPackage(EPackage ePackage, CDOPackageManagerImpl packageManager)
+ public static CDOPackageImpl getCDOPackage(EPackage ePackage, CDOSessionPackageManager packageManager)
{
String packageURI = ePackage.getNsURI();
CDOPackageImpl cdoPackage = packageManager.lookupPackage(packageURI);
@@ -100,26 +103,27 @@ public final class ModelUtil
return cdoPackage;
}
- public static CDOClassImpl getCDOClass(EClass eClass, CDOPackageManagerImpl packageManager)
+ public static CDOClassImpl getCDOClass(EClass eClass, CDOSessionPackageManager packageManager)
{
CDOPackageImpl cdoPackage = getCDOPackage(eClass.getEPackage(), packageManager);
return cdoPackage.lookupClass(eClass.getClassifierID());
}
- public static CDOFeatureImpl getCDOFeature(EStructuralFeature eFeature, CDOPackageManagerImpl packageManager)
+ public static CDOFeatureImpl getCDOFeature(EStructuralFeature eFeature, CDOSessionPackageManager packageManager)
{
CDOClassImpl cdoClass = getCDOClass(eFeature.getEContainingClass(), packageManager);
return cdoClass.lookupFeature(eFeature.getFeatureID());
}
- private static CDOPackageImpl createCDOPackage(EPackage ePackage, CDOPackageManagerImpl packageManager)
+ private static CDOPackageImpl createCDOPackage(EPackage ePackage, CDOSessionPackageManager packageManager)
{
String packageURI = ePackage.getNsURI();
String name = ePackage.getName();
boolean dynamic = EMFUtil.isDynamicEPackage(ePackage);
String ecore = dynamic ? EMFUtil.ePackageToString(ePackage) : null;
+ CDOIDRange idRange = packageManager.getSession().registerEPackage(ePackage);
- CDOPackageImpl cdoPackage = new CDOPackageImpl(packageManager, packageURI, name, ecore, dynamic);
+ CDOPackageImpl cdoPackage = new CDOPackageImpl(packageManager, packageURI, name, ecore, dynamic, idRange);
cdoPackage.setClientInfo(ePackage);
for (EClass eClass : EMFUtil.getPersistentClasses(ePackage))
{
@@ -270,7 +274,7 @@ public final class ModelUtil
return null;
}
- public static void addModelInfos(CDOPackageManagerImpl packageManager)
+ public static void addModelInfos(CDOSessionPackageManager packageManager)
{
// Ecore
CDOCorePackageImpl corePackage = packageManager.getCDOCorePackage();
@@ -286,7 +290,7 @@ public final class ModelUtil
resourceClass.getCDOPathFeature().setClientInfo(EresourcePackage.eINSTANCE.getCDOResource_Path());
}
- public static void removeModelInfos(CDOPackageManagerImpl packageManager)
+ public static void removeModelInfos(CDOSessionPackageManager packageManager)
{
// Ecore
CDOCorePackageImpl corePackage = packageManager.getCDOCorePackage();
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/collection/Pair.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/collection/Pair.java
new file mode 100644
index 0000000..2de9e9b
--- /dev/null
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/collection/Pair.java
@@ -0,0 +1,47 @@
+/***************************************************************************
+ * Copyright (c) 2004 - 2007 Eike Stepper, Germany.
+ * All rights reserved. This program and the accompanying materials
+ * 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:
+ * Eike Stepper - initial API and implementation
+ **************************************************************************/
+package org.eclipse.net4j.util.collection;
+
+/**
+ * @author Eike Stepper
+ */
+public class Pair<T1, T2>
+{
+ private T1 element1;
+
+ private T2 element2;
+
+ public Pair(T1 element1, T2 element2)
+ {
+ this.element1 = element1;
+ this.element2 = element2;
+ }
+
+ public final T1 getElement1()
+ {
+ return element1;
+ }
+
+ public void setElement1(T1 element1)
+ {
+ this.element1 = element1;
+ }
+
+ public final T2 getElement2()
+ {
+ return element2;
+ }
+
+ public void setElement2(T2 element2)
+ {
+ this.element2 = element2;
+ }
+}