summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-08-03 11:40:40 (EDT)
committerEike Stepper2007-08-03 11:40:40 (EDT)
commitd5425b6b911709f42f4c1b630400032d1385ae4c (patch)
tree7a5fac5e5b6703bbadb14c0d675af596580e3b62
parent7e8d93d3404a1cf907d690da53af4ad04d142cc8 (diff)
downloadcdo-d5425b6b911709f42f4c1b630400032d1385ae4c.zip
cdo-d5425b6b911709f42f4c1b630400032d1385ae4c.tar.gz
cdo-d5425b6b911709f42f4c1b630400032d1385ae4c.tar.bz2
*** empty log message ***
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Repository.java13
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/RevisionManager.java9
-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.java3
4 files changed, 19 insertions, 8 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 912c7f4..98bbc2f 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
@@ -21,9 +21,9 @@ 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;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
/**
* @author Eike Stepper
@@ -52,7 +52,7 @@ public class Repository extends Lifecycle implements IRepository
private long nextMetaIDValue = INITIAL_META_ID_VALUE;
- private Map<CDOID, CDOClassRef> types = new HashMap();
+ private ConcurrentMap<CDOID, CDOClassRef> types = new ConcurrentHashMap();
public Repository(String name, Store store)
{
@@ -119,7 +119,7 @@ public class Repository extends Lifecycle implements IRepository
return id;
}
- public CDOClassRef getType(CDOID id)
+ public CDOClassRef getObjectType(CDOID id)
{
CDOClassRef type = types.get(id);
if (type == null)
@@ -135,4 +135,9 @@ public class Repository extends Lifecycle implements IRepository
return type;
}
+
+ public void setObjectType(CDOID id, CDOClassRef type)
+ {
+ types.putIfAbsent(id, type);
+ }
}
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/RevisionManager.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/RevisionManager.java
index 31455a8..8186944 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/RevisionManager.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/RevisionManager.java
@@ -39,6 +39,7 @@ public class RevisionManager extends CDORevisionResolverImpl implements IRevisio
@Override
public void addRevision(CDORevisionImpl revision)
{
+ repository.setObjectType(revision.getID(), revision.getCDOClass().createClassRef());
repository.getStore().addRevision(this, revision);
if (revision.isResource())
{
@@ -55,12 +56,16 @@ public class RevisionManager extends CDORevisionResolverImpl implements IRevisio
@Override
protected CDORevisionImpl loadRevision(CDOID id)
{
- return repository.getStore().loadRevision(id);
+ CDORevisionImpl revision = repository.getStore().loadRevision(id);
+ repository.setObjectType(revision.getID(), revision.getCDOClass().createClassRef());
+ return revision;
}
@Override
protected CDORevisionImpl loadRevision(CDOID id, long timeStamp)
{
- return repository.getStore().loadHistoricalRevision(id, timeStamp);
+ CDORevisionImpl revision = repository.getStore().loadHistoricalRevision(id, timeStamp);
+ repository.setObjectType(revision.getID(), revision.getCDOClass().createClassRef());
+ return revision;
}
}
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 f193c66..22baaad 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 = sessionManager.getRepository().getType(id);
+ CDOClassRef type = sessionManager.getRepository().getObjectType(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 a527c9d..aa83b9f 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
@@ -82,7 +82,8 @@ public abstract class Store implements IStore
public CDOClassRef queryObjectType(CDOID id)
{
- return null;
+ // TODO Implement method Store.queryObjectType()
+ throw new UnsupportedOperationException("Not yet implemented");
}
protected abstract RegisterResourceOperation createRegisterResourceOperation(CDOID id, String path,