summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-08-03 13:16:24 (EDT)
committerEike Stepper2007-08-03 13:16:24 (EDT)
commite02589552a1eb18f485fe4e51f79fb12af02f9f6 (patch)
tree7fe4fb5f12f5ffd5e1c74d2b8be023457dc626a3
parent23435c3bed8555fb94f45b13a97d867eb736550c (diff)
downloadcdo-e02589552a1eb18f485fe4e51f79fb12af02f9f6.zip
cdo-e02589552a1eb18f485fe4e51f79fb12af02f9f6.tar.gz
cdo-e02589552a1eb18f485fe4e51f79fb12af02f9f6.tar.bz2
*** empty log message ***
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOEditor.java2
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/CDOResourceImpl.java4
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOUtil.java6
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOAdapterImpl.java1
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOCallbackImpl.java4
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionImpl.java19
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStateMachine.java2
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java18
8 files changed, 42 insertions, 14 deletions
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOEditor.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOEditor.java
index 2c54a6b..b3d889e 100644
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOEditor.java
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOEditor.java
@@ -1046,7 +1046,7 @@ public class CDOEditor extends MultiPageEditorPart implements IEditingDomainProv
}
else
{
- URI resourceURI = CDOUtil.createURI(resourcePath);
+ URI resourceURI = CDOUtil.createResourceURI(resourcePath);
viewerInput = resourceSet.getResource(resourceURI, true);
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/CDOResourceImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/CDOResourceImpl.java
index f5ea0fe..20fcaa2 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/CDOResourceImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/CDOResourceImpl.java
@@ -150,7 +150,7 @@ public class CDOResourceImpl extends CDOObjectImpl implements CDOResource
public void setURI(URI newURI)
{
eSet(EresourcePackage.Literals.CDO_RESOURCE__URI, newURI);
- basicSetPath(CDOUtil.extractPath(newURI));
+ basicSetPath(CDOUtil.extractResourcePath(newURI));
}
/**
@@ -274,7 +274,7 @@ public class CDOResourceImpl extends CDOObjectImpl implements CDOResource
*/
public void setPath(String newPath)
{
- setURI(CDOUtil.createURI(newPath));
+ setURI(CDOUtil.createResourceURI(newPath));
}
/**
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOUtil.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOUtil.java
index e369d8d..5a06137 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOUtil.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOUtil.java
@@ -116,7 +116,7 @@ public final class CDOUtil
map.put(CDOProtocolConstants.PROTOCOL_NAME, factory);
}
- public static String extractPath(URI uri)
+ public static String extractResourcePath(URI uri)
{
if (!CDOProtocolConstants.PROTOCOL_NAME.equals(uri.scheme()))
{
@@ -141,7 +141,7 @@ public final class CDOUtil
return uri.path();
}
- public static CDOID extractID(URI uri)
+ public static CDOID extractResourceID(URI uri)
{
if (!CDOProtocolConstants.PROTOCOL_NAME.equals(uri.scheme()))
{
@@ -174,7 +174,7 @@ public final class CDOUtil
}
}
- public static URI createURI(String path)
+ public static URI createResourceURI(String path)
{
return URI.createURI(CDOProtocolConstants.PROTOCOL_NAME + ":" + path);
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOAdapterImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOAdapterImpl.java
index 9667f0b..a0501f3 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOAdapterImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOAdapterImpl.java
@@ -95,6 +95,7 @@ public class CDOAdapterImpl extends CDOLegacyImpl implements Adapter.Internal
CDOState oldState = super.cdoInternalSetState(state);
if (oldState != state)
{
+ // TODO Check if EMF proxy resolution is needed at all
if (state == CDOState.PROXY)
{
if (!instance.eIsProxy())
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOCallbackImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOCallbackImpl.java
index c6f9447..f0566ef 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOCallbackImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOCallbackImpl.java
@@ -37,8 +37,8 @@ public class CDOCallbackImpl extends CDOLegacyImpl implements CDOCallback
}
@Override
- protected Object convertPotentialID(CDOViewImpl view, Object potentialID)
+ protected Object convertPotentialID(CDOViewImpl view, Object id)
{
- return view.getObject((CDOID)potentialID, false);
+ return view.getObject((CDOID)id, false);
}
}
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 bf7a6f5..f66372e 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
@@ -20,6 +20,7 @@ import org.eclipse.emf.cdo.internal.protocol.model.CDOClassImpl;
import org.eclipse.emf.cdo.internal.protocol.model.CDOPackageImpl;
import org.eclipse.emf.cdo.protocol.CDOID;
import org.eclipse.emf.cdo.protocol.CDOIDRange;
+import org.eclipse.emf.cdo.protocol.model.CDOClassRef;
import org.eclipse.emf.cdo.util.CDOUtil;
import org.eclipse.net4j.ConnectorException;
@@ -355,6 +356,24 @@ public class CDOSessionImpl extends Lifecycle implements CDOSession
metaInstanceToIDMap.put(metaInstance, newID);
}
+ public CDOClassImpl getObjectType(CDOID id)
+ {
+ return types.get(id);
+ }
+
+ public CDOClassImpl requestObjectType(CDOID id)
+ {
+ CDOClassRef typeRef = null; // FIXME
+ CDOClassImpl type = packageManager.resolveClass(typeRef);
+ registerObjectType(id, type);
+ return type;
+ }
+
+ public void registerObjectType(CDOID id, CDOClassImpl type)
+ {
+ types.put(id, type);
+ }
+
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 339954f..6b544db 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
@@ -359,7 +359,7 @@ public final class CDOStateMachine extends FiniteStateMachine<CDOState, CDOEvent
private CDOID requestID(CDOResource resource, CDOViewImpl view)
{
- String path = CDOUtil.extractPath(resource.getURI());
+ String path = CDOUtil.extractResourcePath(resource.getURI());
ResourceIDRequest signal = new ResourceIDRequest(view.getSession().getChannel(), path);
try
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 4399f44..e12f2c0 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
@@ -133,13 +133,13 @@ public class CDOViewImpl extends org.eclipse.net4j.internal.util.event.Notifier
public CDOResource createResource(String path)
{
- URI createURI = CDOUtil.createURI(path);
+ URI createURI = CDOUtil.createResourceURI(path);
return (CDOResource)getResourceSet().createResource(createURI);
}
public CDOResource getResource(String path)
{
- URI uri = CDOUtil.createURI(path);
+ URI uri = CDOUtil.createResourceURI(path);
return (CDOResource)getResourceSet().getResource(uri, true);
}
@@ -324,14 +324,22 @@ public class CDOViewImpl extends org.eclipse.net4j.internal.util.event.Notifier
private CDOClassImpl getObjectType(CDOID id)
{
+ CDOClassImpl type = session.getObjectType(id);
+ if (type != null)
+ {
+ return type;
+ }
+
if (id instanceof CDOIDTyped)
{
CDOIDTyped typed = (CDOIDTyped)id;
- CDOClassRef type = typed.getType();
- return session.getPackageManager().resolveClass(type);
+ CDOClassRef typeRef = typed.getType();
+ type = session.getPackageManager().resolveClass(typeRef);
+ session.registerObjectType(id, type);
+ return type;
}
- return null;
+ return session.requestObjectType(id);
}
public CDOID provideCDOID(Object idOrObject)