summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-07-24 14:56:28 (EDT)
committerEike Stepper2007-07-24 14:56:28 (EDT)
commit2a30e2fe5bf3b0c46175a5953bca1fa69781edcf (patch)
treee08c213be52ea9ea9f3db661b5e9c8d5bdf66f2c
parent2f9202af2534071b5d46bfef933268b0d828a683 (diff)
downloadcdo-2a30e2fe5bf3b0c46175a5953bca1fa69781edcf.zip
cdo-2a30e2fe5bf3b0c46175a5953bca1fa69781edcf.tar.gz
cdo-2a30e2fe5bf3b0c46175a5953bca1fa69781edcf.tar.bz2
*** empty log message ***
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOAdapterImpl.java44
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectImpl.java2
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionImpl.java264
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOTransactionImpl.java2
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java2
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/FSMUtil.java3
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/ModelUtil.java3
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/ProxyResolverResource.java166
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/ProxyResolverURIResourceMap.java117
9 files changed, 316 insertions, 287 deletions
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 bb5a7aa..8c0bbd8 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
@@ -81,35 +81,15 @@ public class CDOAdapterImpl extends AdapterImpl implements InternalCDOObject
}
@Override
- public InternalEObject getTarget()
- {
- return (InternalEObject)super.getTarget();
- }
-
- @Override
public boolean isAdapterForType(Object type)
{
return type == CDOAdapterImpl.class;
}
@Override
- public void notifyChanged(Notification msg)
+ public InternalEObject getTarget()
{
- if (msg.getEventType() == Notification.RESOLVE)
- {
- return;
- }
-
- if (msg.getNotifier() instanceof InternalEObject)
- {
- InternalEObject notifier = (InternalEObject)msg.getNotifier();
- if (!notifier.eIsProxy())
- {
- System.out.println(msg);
- // TODO Implement method CDOAdapterImpl.notifyChanged()
- throw new UnsupportedOperationException("Not yet implemented");
- }
- }
+ return (InternalEObject)super.getTarget();
}
@Override
@@ -138,6 +118,26 @@ public class CDOAdapterImpl extends AdapterImpl implements InternalCDOObject
}
}
+ @Override
+ public void notifyChanged(Notification msg)
+ {
+ if (msg.getEventType() == Notification.RESOLVE)
+ {
+ return;
+ }
+
+ if (msg.getNotifier() instanceof InternalEObject)
+ {
+ InternalEObject notifier = (InternalEObject)msg.getNotifier();
+ if (!notifier.eIsProxy())
+ {
+ System.out.println(msg);
+ // TODO Implement method CDOAdapterImpl.notifyChanged()
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+ }
+ }
+
public CDOID cdoID()
{
return id;
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectImpl.java
index f0d20e5..ed0501d 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectImpl.java
@@ -19,9 +19,9 @@ 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.revision.CDORevision;
-import org.eclipse.emf.cdo.protocol.util.ImplementationError;
import org.eclipse.net4j.internal.util.om.trace.ContextTracer;
+import org.eclipse.net4j.util.ImplementationError;
import org.eclipse.emf.common.util.BasicEMap;
import org.eclipse.emf.common.util.ECollections;
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 c662d9f..394ed87 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
@@ -18,7 +18,6 @@ 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.protocol.util.ImplementationError;
import org.eclipse.emf.cdo.util.CDOUtil;
import org.eclipse.net4j.ConnectorException;
@@ -29,16 +28,13 @@ import org.eclipse.net4j.internal.util.event.Event;
import org.eclipse.net4j.internal.util.lifecycle.Lifecycle;
import org.eclipse.net4j.internal.util.lifecycle.LifecycleEventAdapter;
import org.eclipse.net4j.internal.util.om.trace.ContextTracer;
+import org.eclipse.net4j.util.ImplementationError;
import org.eclipse.net4j.util.container.IContainerDelta;
import org.eclipse.net4j.util.container.IContainerDelta.Kind;
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.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.EPackage;
@@ -51,10 +47,8 @@ import org.eclipse.emf.internal.cdo.bundle.OM;
import org.eclipse.emf.internal.cdo.protocol.CDOClientProtocol;
import org.eclipse.emf.internal.cdo.protocol.OpenSessionRequest;
import org.eclipse.emf.internal.cdo.protocol.OpenSessionResult;
+import org.eclipse.emf.internal.cdo.util.ProxyResolverURIResourceMap;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
import java.text.MessageFormat;
import java.util.Collection;
import java.util.Collections;
@@ -403,7 +397,8 @@ public class CDOSessionImpl extends Lifecycle implements CDOSession
}
else
{
- throw new ImplementationError("Not a " + ResourceSetImpl.class.getName());
+ throw new ImplementationError("Not a " + ResourceSetImpl.class.getName() + ": "
+ + resourceSet.getClass().getName());
}
synchronized (views)
@@ -481,255 +476,4 @@ public class CDOSessionImpl extends Lifecycle implements CDOSession
return "CDOSessionInvalidationEvent" + dirtyOIDs;
}
}
-
- /**
- * @author Eike Stepper
- */
- private static final class ProxyResolverURIResourceMap implements Map<URI, Resource>
- {
- private Map<URI, Resource> delegate;
-
- private Resource proxyResolverResource;
-
- public ProxyResolverURIResourceMap(CDOViewImpl view, Map<URI, Resource> delegate)
- {
- if (delegate == null)
- {
- delegate = new HashMap(); // TODO Cleanup of this lookup cache?
- }
-
- this.delegate = delegate;
- proxyResolverResource = new ProxyResolverResource(view);
- }
-
- public Resource get(Object key)
- {
- if (key instanceof URI)
- {
- URI uri = (URI)key;
- String scheme = uri.scheme();
- if ("cdo".equals(scheme))
- {
- String opaquePart = uri.opaquePart();
- if ("proxy".equals(opaquePart))
- {
- return proxyResolverResource;
- }
- }
- }
-
- return delegate.get(key);
- }
-
- public void clear()
- {
- delegate.clear();
- }
-
- public boolean containsKey(Object key)
- {
- return delegate.containsKey(key);
- }
-
- public boolean containsValue(Object value)
- {
- return delegate.containsValue(value);
- }
-
- public Set<Entry<URI, Resource>> entrySet()
- {
- return delegate.entrySet();
- }
-
- @Override
- public boolean equals(Object o)
- {
- return delegate.equals(o);
- }
-
- @Override
- public int hashCode()
- {
- return delegate.hashCode();
- }
-
- public boolean isEmpty()
- {
- return delegate.isEmpty();
- }
-
- public Set<URI> keySet()
- {
- return delegate.keySet();
- }
-
- public Resource put(URI key, Resource value)
- {
- return delegate.put(key, value);
- }
-
- public void putAll(Map<? extends URI, ? extends Resource> t)
- {
- delegate.putAll(t);
- }
-
- public Resource remove(Object key)
- {
- return delegate.remove(key);
- }
-
- public int size()
- {
- return delegate.size();
- }
-
- public Collection<Resource> values()
- {
- return delegate.values();
- }
- }
-
- /**
- * @author Eike Stepper
- */
- private static 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();
- }
- }
}
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 93fbfef..3f8ff32 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
@@ -18,11 +18,11 @@ 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;
-import org.eclipse.emf.cdo.protocol.util.ImplementationError;
import org.eclipse.emf.cdo.protocol.util.TransportException;
import org.eclipse.net4j.IChannel;
import org.eclipse.net4j.internal.util.om.trace.ContextTracer;
+import org.eclipse.net4j.util.ImplementationError;
import org.eclipse.emf.internal.cdo.bundle.OM;
import org.eclipse.emf.internal.cdo.protocol.CommitTransactionRequest;
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 3e6ae0d..60056de 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
@@ -23,12 +23,12 @@ import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
import org.eclipse.emf.cdo.protocol.CDOID;
import org.eclipse.emf.cdo.protocol.model.CDOClass;
import org.eclipse.emf.cdo.protocol.revision.CDORevisionResolver;
-import org.eclipse.emf.cdo.protocol.util.ImplementationError;
import org.eclipse.emf.cdo.protocol.util.TransportException;
import org.eclipse.emf.cdo.util.CDOUtil;
import org.eclipse.emf.cdo.util.ReadOnlyException;
import org.eclipse.net4j.internal.util.om.trace.ContextTracer;
+import org.eclipse.net4j.util.ImplementationError;
import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.Notification;
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/FSMUtil.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/FSMUtil.java
index 7df7f47..42e9c59 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/FSMUtil.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/FSMUtil.java
@@ -13,7 +13,8 @@ package org.eclipse.emf.internal.cdo.util;
import org.eclipse.emf.cdo.CDOObject;
import org.eclipse.emf.cdo.CDOState;
import org.eclipse.emf.cdo.protocol.CDOID;
-import org.eclipse.emf.cdo.protocol.util.ImplementationError;
+
+import org.eclipse.net4j.util.ImplementationError;
import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.util.EList;
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 406ccd6..448324a 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
@@ -22,9 +22,10 @@ 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;
+import org.eclipse.net4j.util.ImplementationError;
+
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EClassifier;
import org.eclipse.emf.ecore.EPackage;
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 0000000..42bc254
--- /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
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/ProxyResolverURIResourceMap.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/ProxyResolverURIResourceMap.java
new file mode 100644
index 0000000..f51179d
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/ProxyResolverURIResourceMap.java
@@ -0,0 +1,117 @@
+package org.eclipse.emf.internal.cdo.util;
+
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.internal.cdo.CDOViewImpl;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * @author Eike Stepper
+ */
+public final class ProxyResolverURIResourceMap implements Map<URI, Resource>
+{
+ private Map<URI, Resource> delegate;
+
+ private Resource proxyResolverResource;
+
+ public ProxyResolverURIResourceMap(CDOViewImpl view, Map<URI, Resource> delegate)
+ {
+ if (delegate == null)
+ {
+ delegate = new HashMap(); // TODO Cleanup of this lookup cache?
+ }
+
+ this.delegate = delegate;
+ proxyResolverResource = new ProxyResolverResource(view);
+ }
+
+ public Resource get(Object key)
+ {
+ if (key instanceof URI)
+ {
+ URI uri = (URI)key;
+ String scheme = uri.scheme();
+ if ("cdo".equals(scheme))
+ {
+ String opaquePart = uri.opaquePart();
+ if ("proxy".equals(opaquePart))
+ {
+ return proxyResolverResource;
+ }
+ }
+ }
+
+ return delegate.get(key);
+ }
+
+ public void clear()
+ {
+ delegate.clear();
+ }
+
+ public boolean containsKey(Object key)
+ {
+ return delegate.containsKey(key);
+ }
+
+ public boolean containsValue(Object value)
+ {
+ return delegate.containsValue(value);
+ }
+
+ public Set<Entry<URI, Resource>> entrySet()
+ {
+ return delegate.entrySet();
+ }
+
+ @Override
+ public boolean equals(Object o)
+ {
+ return delegate.equals(o);
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return delegate.hashCode();
+ }
+
+ public boolean isEmpty()
+ {
+ return delegate.isEmpty();
+ }
+
+ public Set<URI> keySet()
+ {
+ return delegate.keySet();
+ }
+
+ public Resource put(URI key, Resource value)
+ {
+ return delegate.put(key, value);
+ }
+
+ public void putAll(Map<? extends URI, ? extends Resource> t)
+ {
+ delegate.putAll(t);
+ }
+
+ public Resource remove(Object key)
+ {
+ return delegate.remove(key);
+ }
+
+ public int size()
+ {
+ return delegate.size();
+ }
+
+ public Collection<Resource> values()
+ {
+ return delegate.values();
+ }
+} \ No newline at end of file