summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-07-23 16:06:58 (EDT)
committerEike Stepper2007-07-23 16:06:58 (EDT)
commiteb193d4a5b41d5de155c00a985436214ab5619dd (patch)
tree74bb081d6249d26a8ab4b84f13c28549fe1eb376
parent75e529ff2b1a780b2484807ac7e4ddaf1de75352 (diff)
downloadcdo-eb193d4a5b41d5de155c00a985436214ab5619dd.zip
cdo-eb193d4a5b41d5de155c00a985436214ab5619dd.tar.gz
cdo-eb193d4a5b41d5de155c00a985436214ab5619dd.tar.bz2
*** empty log message ***
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOUtil.java3
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOAdapterImpl.java17
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionImpl.java2
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java5
4 files changed, 24 insertions, 3 deletions
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 97f9107..01c4509 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
@@ -74,13 +74,12 @@ public final class CDOUtil
return null;
}
- public static CDOResourceFactory addResourceFactory(ResourceSet resourceSet)
+ public static void prepareResourceSet(ResourceSet resourceSet)
{
CDOResourceFactory factory = CDOResourceFactory.INSTANCE;
Registry registry = resourceSet.getResourceFactoryRegistry();
Map<String, Object> map = registry.getProtocolToFactoryMap();
map.put(CDOProtocolConstants.PROTOCOL_NAME, factory);
- return factory;
}
public static String extractPath(URI uri)
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 48d23a6..f98960d 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
@@ -18,6 +18,7 @@ import org.eclipse.emf.cdo.internal.protocol.model.CDOClassImpl;
import org.eclipse.emf.cdo.internal.protocol.model.CDOFeatureImpl;
import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
import org.eclipse.emf.cdo.protocol.CDOID;
+import org.eclipse.emf.cdo.protocol.CDOProtocolConstants;
import org.eclipse.emf.cdo.protocol.model.CDOType;
import org.eclipse.emf.cdo.protocol.revision.CDORevision;
import org.eclipse.emf.cdo.protocol.util.ImplementationError;
@@ -174,6 +175,22 @@ public class CDOAdapterImpl extends AdapterImpl implements InternalCDOObject
}
this.state = state;
+ InternalEObject target = getTarget();
+ if (state == CDOState.PROXY)
+ {
+ if (!target.eIsProxy())
+ {
+ URI uri = URI.createURI(CDOProtocolConstants.PROTOCOL_NAME + ":" + id);
+ target.eSetProxyURI(uri);
+ }
+ }
+ else
+ {
+ if (target.eIsProxy())
+ {
+ target.eSetProxyURI(null);
+ }
+ }
}
}
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 6b78a38..340e573 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
@@ -374,7 +374,7 @@ public class CDOSessionImpl extends Lifecycle implements CDOSession
}
resourceSet.setPackageRegistry(new EPackageRegistryImpl(packageRegistry));
- CDOUtil.addResourceFactory(resourceSet);
+ CDOUtil.prepareResourceSet(resourceSet);
}
private CDOViewImpl attach(ResourceSet resourceSet, CDOViewImpl view)
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 485d02a..104da6f 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
@@ -324,6 +324,11 @@ public class CDOViewImpl extends org.eclipse.net4j.internal.util.event.Notifier
throw new ImplementationError("ID not registered: " + id);
}
+ if (result instanceof CDOAdapterImpl)
+ {
+ return ((CDOAdapterImpl)result).getTarget();
+ }
+
return result;
}