Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/ProxyResolverResource.java')
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/ProxyResolverResource.java166
1 files changed, 166 insertions, 0 deletions
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/ProxyResolverResource.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/ProxyResolverResource.java
new file mode 100644
index 0000000000..42bc254d8e
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/ProxyResolverResource.java
@@ -0,0 +1,166 @@
+package org.eclipse.emf.internal.cdo.util;
+
+import org.eclipse.emf.cdo.internal.protocol.CDOIDImpl;
+import org.eclipse.emf.cdo.protocol.CDOID;
+
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.common.util.TreeIterator;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.resource.Resource.Diagnostic;
+import org.eclipse.emf.internal.cdo.CDOAdapterImpl;
+import org.eclipse.emf.internal.cdo.CDOViewImpl;
+import org.eclipse.emf.internal.cdo.InternalCDOObject;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.Map;
+
+/**
+ * @author Eike Stepper
+ */
+final class ProxyResolverResource implements Resource
+{
+ private CDOViewImpl view;
+
+ public ProxyResolverResource(CDOViewImpl view)
+ {
+ this.view = view;
+ }
+
+ /*
+ * @ADDED Called by {@link ResourceSetImpl#getResource(URI, boolean)}
+ */
+ public boolean isLoaded()
+ {
+ return true;
+ }
+
+ /*
+ * @ADDED Called by {@link ResourceSetImpl#getEObject(URI, boolean)}
+ */
+ public EObject getEObject(String uriFragment)
+ {
+ CDOID id = CDOIDImpl.create(Long.parseLong(uriFragment));
+ InternalCDOObject object = view.lookupInstance(id);
+ if (object instanceof CDOAdapterImpl)
+ {
+ CDOAdapterImpl adapter = (CDOAdapterImpl)object;
+ adapter.cdoInternalResolveRevision();
+ return adapter.getTarget();
+ }
+
+ // throw new ImplementationError("Can't resolve " + uriFragment);
+ return object;
+ }
+
+ public TreeIterator<EObject> getAllContents()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public EList<EObject> getContents()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public EList<Diagnostic> getErrors()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public ResourceSet getResourceSet()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public URI getURI()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public String getURIFragment(EObject object)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public EList<Diagnostic> getWarnings()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public boolean isModified()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public boolean isTrackingModification()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public void load(Map<?, ?> options) throws IOException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public void load(InputStream inputStream, Map<?, ?> options) throws IOException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public void save(Map<?, ?> options) throws IOException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public void save(OutputStream outputStream, Map<?, ?> options) throws IOException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public void setModified(boolean isModified)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public void setTrackingModification(boolean isTrackingModification)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public void setURI(URI uri)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public void unload()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public EList<Adapter> eAdapters()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public boolean eDeliver()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public void eNotify(Notification notification)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public void eSetDeliver(boolean deliver)
+ {
+ throw new UnsupportedOperationException();
+ }
+} \ No newline at end of file

Back to the top