summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-08-03 11:30:43 (EDT)
committerEike Stepper2007-08-03 11:30:43 (EDT)
commit7e8d93d3404a1cf907d690da53af4ad04d142cc8 (patch)
treede9a86b0875499d7d8afe70061b9cbf2e63fcb45
parenta0d4b5c0879d9fec88b2591596f9303f3df6cf9e (diff)
downloadcdo-7e8d93d3404a1cf907d690da53af4ad04d142cc8.zip
cdo-7e8d93d3404a1cf907d690da53af4ad04d142cc8.tar.gz
cdo-7e8d93d3404a1cf907d690da53af4ad04d142cc8.tar.bz2
*** empty log message ***
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Repository.java23
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Session.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/store/Store.java6
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStore.java3
4 files changed, 33 insertions, 1 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Repository.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Repository.java
index 676b11f..912c7f4 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Repository.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Repository.java
@@ -15,10 +15,14 @@ import org.eclipse.emf.cdo.internal.protocol.CDOIDRangeImpl;
import org.eclipse.emf.cdo.internal.server.store.Store;
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.server.IRepository;
import org.eclipse.net4j.internal.util.lifecycle.Lifecycle;
+import org.eclipse.net4j.util.ImplementationError;
+import java.util.HashMap;
+import java.util.Map;
import java.util.UUID;
/**
@@ -48,6 +52,8 @@ public class Repository extends Lifecycle implements IRepository
private long nextMetaIDValue = INITIAL_META_ID_VALUE;
+ private Map<CDOID, CDOClassRef> types = new HashMap();
+
public Repository(String name, Store store)
{
this.name = name;
@@ -112,4 +118,21 @@ public class Repository extends Lifecycle implements IRepository
++nextOIDValue;
return id;
}
+
+ public CDOClassRef getType(CDOID id)
+ {
+ CDOClassRef type = types.get(id);
+ if (type == null)
+ {
+ type = store.queryObjectType(id);
+ if (type == null)
+ {
+ throw new ImplementationError("type == null");
+ }
+
+ types.put(id, type);
+ }
+
+ return type;
+ }
}
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Session.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Session.java
index d4ca206..f193c66 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Session.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Session.java
@@ -79,7 +79,7 @@ public class Session implements ISession, CDOIDProvider
}
knownObjects.add(id);
- CDOClassRef type = null;
+ CDOClassRef type = sessionManager.getRepository().getType(id);
return CDOIDImpl.create(id.getValue(), type);
}
}
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/store/Store.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/store/Store.java
index 97ca6e4..a527c9d 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/store/Store.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/store/Store.java
@@ -14,6 +14,7 @@ import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
import org.eclipse.emf.cdo.internal.server.Repository;
import org.eclipse.emf.cdo.internal.server.RevisionManager;
import org.eclipse.emf.cdo.protocol.CDOID;
+import org.eclipse.emf.cdo.protocol.model.CDOClassRef;
import org.eclipse.emf.cdo.server.IStore;
import org.eclipse.net4j.util.transaction.TX;
@@ -79,6 +80,11 @@ public abstract class Store implements IStore
return (CDORevisionImpl)TX.execute(createLoadHistoricalRevisionOperation(id, timeStamp));
}
+ public CDOClassRef queryObjectType(CDOID id)
+ {
+ return null;
+ }
+
protected abstract RegisterResourceOperation createRegisterResourceOperation(CDOID id, String path,
Map<CDOID, String> idToPathMap, Map<String, CDOID> pathToIDMap);
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStore.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStore.java
index f042165..1a2a21c 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStore.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStore.java
@@ -13,6 +13,7 @@ package org.eclipse.emf.cdo.server;
import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
import org.eclipse.emf.cdo.internal.server.RevisionManager;
import org.eclipse.emf.cdo.protocol.CDOID;
+import org.eclipse.emf.cdo.protocol.model.CDOClassRef;
import org.eclipse.net4j.util.transaction.ITransaction;
@@ -40,4 +41,6 @@ public interface IStore
public CDORevisionImpl loadRevision(CDOID id);
public CDORevisionImpl loadHistoricalRevision(CDOID id, long timeStamp);
+
+ public CDOClassRef queryObjectType(CDOID id);
}