Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2009-01-10 08:09:47 -0500
committerEike Stepper2009-01-10 08:09:47 -0500
commit8bb0f3b167d465a9cd75daf10c2e202516104ff7 (patch)
tree812f4a28a77c9ed4c4d7709d48b7a01102dc0591
parent0fc3329e8eab3e81cb9db55426c32a68e2af74bb (diff)
downloadcdo-8bb0f3b167d465a9cd75daf10c2e202516104ff7.tar.gz
cdo-8bb0f3b167d465a9cd75daf10c2e202516104ff7.tar.xz
cdo-8bb0f3b167d465a9cd75daf10c2e202516104ff7.zip
*** empty log message ***
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/revision/CDOPostCommitReferenceAdjuster.java59
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/CDOSessionProtocol.java52
2 files changed, 49 insertions, 62 deletions
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/revision/CDOPostCommitReferenceAdjuster.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/revision/CDOPostCommitReferenceAdjuster.java
deleted file mode 100644
index 0aa00f96fb..0000000000
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/revision/CDOPostCommitReferenceAdjuster.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/***************************************************************************
- * Copyright (c) 2004 - 2008 Eike Stepper, Germany.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Simon McDuff - initial API and implementation
- **************************************************************************/
-package org.eclipse.emf.internal.cdo.revision;
-
-import org.eclipse.emf.cdo.common.id.CDOID;
-import org.eclipse.emf.cdo.common.id.CDOIDProvider;
-import org.eclipse.emf.cdo.common.revision.CDOReferenceAdjuster;
-import org.eclipse.emf.cdo.internal.common.revision.CDOIDMapper;
-
-import org.eclipse.emf.ecore.InternalEObject;
-
-/**
- * @author Simon McDuff
- */
-public class CDOPostCommitReferenceAdjuster implements CDOReferenceAdjuster
-{
- private CDOIDProvider idProvider;
-
- private CDOIDMapper idMapper;
-
- public CDOPostCommitReferenceAdjuster(CDOIDProvider idProvider, CDOIDMapper idMapper)
- {
- this.idProvider = idProvider;
- this.idMapper = idMapper;
- }
-
- public CDOIDProvider getIDProvider()
- {
- return idProvider;
- }
-
- public CDOIDMapper getIDMapper()
- {
- return idMapper;
- }
-
- public Object adjustReference(Object id)
- {
- if (id == null)
- {
- return null;
- }
-
- if (idProvider != null && (id instanceof CDOID || id instanceof InternalEObject))
- {
- id = idProvider.provideCDOID(id);
- }
-
- return idMapper.adjustReference(id);
- }
-}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/CDOSessionProtocol.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/CDOSessionProtocol.java
index 49c4b18b76..a5db3072f9 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/CDOSessionProtocol.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/CDOSessionProtocol.java
@@ -14,6 +14,7 @@ import org.eclipse.emf.cdo.CDOObject;
import org.eclipse.emf.cdo.common.id.CDOID;
import org.eclipse.emf.cdo.common.id.CDOIDLibraryDescriptor;
import org.eclipse.emf.cdo.common.id.CDOIDMetaRange;
+import org.eclipse.emf.cdo.common.id.CDOIDProvider;
import org.eclipse.emf.cdo.common.id.CDOIDTemp;
import org.eclipse.emf.cdo.common.model.CDOFeature;
import org.eclipse.emf.cdo.common.model.CDOPackage;
@@ -27,7 +28,6 @@ import org.eclipse.emf.cdo.transaction.CDOTimeStampContext;
import org.eclipse.emf.cdo.view.CDOView;
import org.eclipse.emf.internal.cdo.query.CDOAbstractQueryIteratorImpl;
-import org.eclipse.emf.internal.cdo.revision.CDOPostCommitReferenceAdjuster;
import org.eclipse.net4j.util.concurrent.RWLockManager.LockType;
import org.eclipse.net4j.util.io.ExtendedDataInput;
@@ -35,6 +35,7 @@ import org.eclipse.net4j.util.io.ExtendedDataOutput;
import org.eclipse.net4j.util.io.StringCompressor;
import org.eclipse.net4j.util.om.monitor.OMMonitor;
+import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.spi.cdo.InternalCDOTransaction.InternalCDOCommitContext;
import org.eclipse.emf.spi.cdo.InternalCDOXATransaction.InternalCDOXACommitContext;
@@ -314,8 +315,7 @@ public interface CDOSessionProtocol
{
if (referenceAdjuster == null)
{
- referenceAdjuster = new CDOPostCommitReferenceAdjuster(commitContext.getTransaction(), new CDOIDMapper(
- idMappings));
+ referenceAdjuster = createReferenceAdjuster();
}
return referenceAdjuster;
@@ -350,5 +350,51 @@ public interface CDOSessionProtocol
{
idMappings.put(oldID, newID);
}
+
+ protected PostCommitReferenceAdjuster createReferenceAdjuster()
+ {
+ return new PostCommitReferenceAdjuster(commitContext.getTransaction(), new CDOIDMapper(idMappings));
+ }
+
+ /**
+ * @author Simon McDuff
+ */
+ protected static class PostCommitReferenceAdjuster implements CDOReferenceAdjuster
+ {
+ private CDOIDProvider idProvider;
+
+ private CDOIDMapper idMapper;
+
+ public PostCommitReferenceAdjuster(CDOIDProvider idProvider, CDOIDMapper idMapper)
+ {
+ this.idProvider = idProvider;
+ this.idMapper = idMapper;
+ }
+
+ public CDOIDProvider getIdProvider()
+ {
+ return idProvider;
+ }
+
+ public CDOIDMapper getIdMapper()
+ {
+ return idMapper;
+ }
+
+ public Object adjustReference(Object id)
+ {
+ if (id == null)
+ {
+ return null;
+ }
+
+ if (idProvider != null && (id instanceof CDOID || id instanceof InternalEObject))
+ {
+ id = idProvider.provideCDOID(id);
+ }
+
+ return idMapper.adjustReference(id);
+ }
+ }
}
}

Back to the top