summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Winkler2010-02-09 06:35:23 (EST)
committerStefan Winkler2010-02-09 06:35:23 (EST)
commit691f9305d10ab7304fcad82416c5635d6d3c5d52 (patch)
treee9398fd0649e4242225efffd1a8a1e5b9fc92428
parent6c765a3bc651fcba318aeae1ec2a2d3c91e98a89 (diff)
downloadcdo-691f9305d10ab7304fcad82416c5635d6d3c5d52.zip
cdo-691f9305d10ab7304fcad82416c5635d6d3c5d52.tar.gz
cdo-691f9305d10ab7304fcad82416c5635d6d3c5d52.tar.bz2
Emergency Revert to undo previous commit by Eike
-rw-r--r--plugins/org.eclipse.emf.cdo.common.db/src/org/eclipse/emf/cdo/common/internal/db/cache/DBRevisionCache.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/CDOCommitData.java38
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/CDOCommitInfo.java10
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDAndVersionAndBranch.java20
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDUtil.java9
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/io/CDODataInput.java25
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/io/CDODataOutput.java24
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisionKey.java3
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/commit/CDOCommitDataImpl.java61
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/commit/CDOCommitInfoImpl.java31
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/commit/CDOCommitInfoManagerImpl.java6
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/id/CDOIDAndVersionAndBranchImpl.java80
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/io/CDODataInputImpl.java76
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/io/CDODataOutputImpl.java87
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOPackageUnitImpl.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/CDORevisionImpl.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/CDORevisionManagerImpl.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDORevisionDeltaImpl.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/commit/InternalCDOCommitInfoManager.java6
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/DelegatingCDORevisionManager.java6
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/InternalCDORevision.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/InternalCDORevisionManager.java9
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/RevisionInfo.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/StubCDORevision.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CDOClientProtocol.java7
-rw-r--r--plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CDOClientRequest.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CommitNotificationIndication.java133
-rw-r--r--plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CommitTransactionRequest.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/LoadCommitInfosRequest.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreAccessor.java19
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/HorizontalAuditClassMapping.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStoreAccessor.java7
-rw-r--r--plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDORevisionProxyHibernate.java3
-rw-r--r--plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/AbstractSyncRevisionsIndication.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CDOServerIndication.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CDOServerRequest.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CommitTransactionIndication.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LoadChunkIndication.java3
-rw-r--r--plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LoadRevisionsIndication.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Repository.java7
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Session.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/embedded/EmbeddedClientSessionProtocol.java9
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/embedded/EmbeddedServerSessionProtocol.java16
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/mem/MEMStore.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/mem/MEMStoreAccessor.java9
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/ISessionProtocol.java11
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.mango/model/mango.genmodel16
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.mango/model/mango.legacy-genmodel16
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/RevisionHolderTest.java3
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/RevisionManagerTest.java3
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/session/CDOSessionInvalidationEvent.java40
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/view/CDOStaleReferencePolicy.java8
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectMerger.java2
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStateMachine.java2
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionImpl.java279
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOSingleTransactionStrategyImpl.java2
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOTransactionImpl.java70
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java28
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/InternalCDOSession.java15
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/InternalCDOView.java3
60 files changed, 430 insertions, 820 deletions
diff --git a/plugins/org.eclipse.emf.cdo.common.db/src/org/eclipse/emf/cdo/common/internal/db/cache/DBRevisionCache.java b/plugins/org.eclipse.emf.cdo.common.db/src/org/eclipse/emf/cdo/common/internal/db/cache/DBRevisionCache.java
index 2625ff4..a671985 100644
--- a/plugins/org.eclipse.emf.cdo.common.db/src/org/eclipse/emf/cdo/common/internal/db/cache/DBRevisionCache.java
+++ b/plugins/org.eclipse.emf.cdo.common.db/src/org/eclipse/emf/cdo/common/internal/db/cache/DBRevisionCache.java
@@ -774,13 +774,11 @@ public class DBRevisionCache extends Lifecycle implements InternalCDORevisionCac
{
return new CDODataOutputImpl(extendedDataOutputStream)
{
- @Override
public CDOPackageRegistry getPackageRegistry()
{
return packageRegistry;
}
- @Override
public CDOIDProvider getIDProvider()
{
return idProvider;
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/CDOCommitData.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/CDOCommitData.java
deleted file mode 100644
index 08b92c5..0000000
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/CDOCommitData.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/**
- * Copyright (c) 2004 - 2010 Eike Stepper (Berlin, Germany) and others.
- * 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:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.emf.cdo.common.commit;
-
-import org.eclipse.emf.cdo.common.id.CDOIDAndVersion;
-import org.eclipse.emf.cdo.common.model.CDOPackageUnit;
-import org.eclipse.emf.cdo.common.revision.CDORevisionKey;
-import org.eclipse.emf.cdo.common.revision.delta.CDORevisionDelta;
-
-import java.util.Collection;
-
-/**
- * @author Eike Stepper
- * @since 3.0
- */
-public interface CDOCommitData
-{
- public Collection<CDOPackageUnit> getNewPackageUnits();
-
- public Collection<CDOIDAndVersion> getNewObjects();
-
- /**
- * Returns a collection of revision keys denoting which (original) revisions have been changed in the context of a
- * commit operation. Depending on various conditions like change subscriptions particular elements can also be full
- * {@link CDORevisionDelta revision deltas}.
- */
- public Collection<CDORevisionKey> getChangedObjects();
-
- public Collection<CDOIDAndVersion> getDetachedObjects();
-}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/CDOCommitInfo.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/CDOCommitInfo.java
index 33f74af..9186919 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/CDOCommitInfo.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/CDOCommitInfo.java
@@ -16,11 +16,19 @@ import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
* @author Eike Stepper
* @since 3.0
*/
-public interface CDOCommitInfo extends CDOBranchPoint, CDOCommitData
+public interface CDOCommitInfo extends CDOBranchPoint
{
public CDOCommitInfoManager getCommitInfoManager();
public String getUserID();
public String getComment();
+
+ // public Set<CDOID> getNewResources();
+ //
+ // public Set<CDOID> getNewObjects();
+ //
+ // public Set<CDOID> getDetachedObjects();
+ //
+ // public Set<CDOID> getDirtyObjects();
}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDAndVersionAndBranch.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDAndVersionAndBranch.java
new file mode 100644
index 0000000..c96ada2
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDAndVersionAndBranch.java
@@ -0,0 +1,20 @@
+/**
+ * Copyright (c) 2004 - 2010 Eike Stepper (Berlin, Germany) and others.
+ * 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:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.common.id;
+
+/**
+ * @author Eike Stepper
+ * @since 3.0
+ */
+public interface CDOIDAndVersionAndBranch extends CDOIDAndVersion
+{
+ public int getBranchID();
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDUtil.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDUtil.java
index cf2fc26..818aeb1 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDUtil.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDUtil.java
@@ -18,6 +18,7 @@ import org.eclipse.emf.cdo.common.id.CDOID.Type;
import org.eclipse.emf.cdo.common.model.CDOClassifierRef;
import org.eclipse.emf.cdo.internal.common.bundle.OM;
import org.eclipse.emf.cdo.internal.common.id.CDOIDAndBranchImpl;
+import org.eclipse.emf.cdo.internal.common.id.CDOIDAndVersionAndBranchImpl;
import org.eclipse.emf.cdo.internal.common.id.CDOIDAndVersionImpl;
import org.eclipse.emf.cdo.internal.common.id.CDOIDExternalImpl;
import org.eclipse.emf.cdo.internal.common.id.CDOIDMetaImpl;
@@ -361,6 +362,14 @@ public final class CDOIDUtil
}
/**
+ * @since 3.0
+ */
+ public static CDOIDAndVersionAndBranch createIDAndVersionAndBranch(CDOID id, int version, int branchID)
+ {
+ return new CDOIDAndVersionAndBranchImpl(id, version, branchID);
+ }
+
+ /**
* @since 2.0
*/
public static boolean equals(CDOID id1, CDOID id2)
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/io/CDODataInput.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/io/CDODataInput.java
index 9faa98f..0d5dbc4 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/io/CDODataInput.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/io/CDODataInput.java
@@ -14,12 +14,10 @@ package org.eclipse.emf.cdo.common.io;
import org.eclipse.emf.cdo.common.branch.CDOBranch;
import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
import org.eclipse.emf.cdo.common.branch.CDOBranchVersion;
-import org.eclipse.emf.cdo.common.commit.CDOCommitData;
-import org.eclipse.emf.cdo.common.commit.CDOCommitInfo;
-import org.eclipse.emf.cdo.common.commit.CDOCommitInfoManager;
import org.eclipse.emf.cdo.common.id.CDOID;
import org.eclipse.emf.cdo.common.id.CDOIDAndBranch;
import org.eclipse.emf.cdo.common.id.CDOIDAndVersion;
+import org.eclipse.emf.cdo.common.id.CDOIDAndVersionAndBranch;
import org.eclipse.emf.cdo.common.id.CDOIDMetaRange;
import org.eclipse.emf.cdo.common.model.CDOClassifierRef;
import org.eclipse.emf.cdo.common.model.CDOPackageInfo;
@@ -28,7 +26,6 @@ import org.eclipse.emf.cdo.common.model.CDOPackageUnit;
import org.eclipse.emf.cdo.common.model.CDOType;
import org.eclipse.emf.cdo.common.revision.CDOList;
import org.eclipse.emf.cdo.common.revision.CDORevision;
-import org.eclipse.emf.cdo.common.revision.CDORevisionKey;
import org.eclipse.emf.cdo.common.revision.delta.CDOFeatureDelta;
import org.eclipse.emf.cdo.common.revision.delta.CDORevisionDelta;
@@ -82,16 +79,6 @@ public interface CDODataInput extends ExtendedDataInput
*/
public CDOBranchVersion readCDOBranchVersion() throws IOException;
- /**
- * @since 3.0
- */
- public CDOCommitData readCDOCommitData() throws IOException;
-
- /**
- * @since 3.0
- */
- public CDOCommitInfo readCDOCommitInfo(CDOCommitInfoManager commitInfoManager) throws IOException;
-
// /////////////////////////////////////////////////////////////////////////////////////////////////
public CDOID readCDOID() throws IOException;
@@ -103,14 +90,14 @@ public interface CDODataInput extends ExtendedDataInput
*/
public CDOIDAndBranch readCDOIDAndBranch() throws IOException;
- public CDOIDMetaRange readCDOIDMetaRange() throws IOException;
-
- // /////////////////////////////////////////////////////////////////////////////////////////////////
-
/**
* @since 3.0
*/
- public CDORevisionKey readCDORevisionKey() throws IOException;
+ public CDOIDAndVersionAndBranch readCDOIDAndVersionAndBranch() throws IOException;
+
+ public CDOIDMetaRange readCDOIDMetaRange() throws IOException;
+
+ // /////////////////////////////////////////////////////////////////////////////////////////////////
public CDORevision readCDORevision() throws IOException;
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/io/CDODataOutput.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/io/CDODataOutput.java
index af2e365..ee91363 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/io/CDODataOutput.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/io/CDODataOutput.java
@@ -14,11 +14,10 @@ package org.eclipse.emf.cdo.common.io;
import org.eclipse.emf.cdo.common.branch.CDOBranch;
import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
import org.eclipse.emf.cdo.common.branch.CDOBranchVersion;
-import org.eclipse.emf.cdo.common.commit.CDOCommitData;
-import org.eclipse.emf.cdo.common.commit.CDOCommitInfo;
import org.eclipse.emf.cdo.common.id.CDOID;
import org.eclipse.emf.cdo.common.id.CDOIDAndBranch;
import org.eclipse.emf.cdo.common.id.CDOIDAndVersion;
+import org.eclipse.emf.cdo.common.id.CDOIDAndVersionAndBranch;
import org.eclipse.emf.cdo.common.id.CDOIDMetaRange;
import org.eclipse.emf.cdo.common.id.CDOIDProvider;
import org.eclipse.emf.cdo.common.model.CDOClassifierRef;
@@ -28,7 +27,6 @@ import org.eclipse.emf.cdo.common.model.CDOPackageUnit;
import org.eclipse.emf.cdo.common.model.CDOType;
import org.eclipse.emf.cdo.common.revision.CDOList;
import org.eclipse.emf.cdo.common.revision.CDORevision;
-import org.eclipse.emf.cdo.common.revision.CDORevisionKey;
import org.eclipse.emf.cdo.common.revision.delta.CDOFeatureDelta;
import org.eclipse.emf.cdo.common.revision.delta.CDORevisionDelta;
@@ -89,16 +87,6 @@ public interface CDODataOutput extends ExtendedDataOutput
*/
public void writeCDOBranchVersion(CDOBranchVersion branchVersion) throws IOException;
- /**
- * @since 3.0
- */
- public void writeCDOCommitData(CDOCommitData commitData) throws IOException;
-
- /**
- * @since 3.0
- */
- public void writeCDOCommitInfo(CDOCommitInfo commitInfo) throws IOException;
-
// /////////////////////////////////////////////////////////////////////////////////////////////////
public void writeCDOID(CDOID id) throws IOException;
@@ -110,14 +98,14 @@ public interface CDODataOutput extends ExtendedDataOutput
*/
public void writeCDOIDAndBranch(CDOIDAndBranch idAndBranch) throws IOException;
- public void writeCDOIDMetaRange(CDOIDMetaRange metaRange) throws IOException;
-
- // /////////////////////////////////////////////////////////////////////////////////////////////////
-
/**
* @since 3.0
*/
- public void writeCDORevisionKey(CDORevisionKey revisionKey) throws IOException;
+ public void writeCDOIDAndVersionAndBranch(CDOIDAndVersionAndBranch idAndVersionAndBranch) throws IOException;
+
+ public void writeCDOIDMetaRange(CDOIDMetaRange metaRange) throws IOException;
+
+ // /////////////////////////////////////////////////////////////////////////////////////////////////
public void writeCDORevision(CDORevision revision, int referenceChunk) throws IOException;
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisionKey.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisionKey.java
index e217c6a..bad939a 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisionKey.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisionKey.java
@@ -12,13 +12,12 @@ package org.eclipse.emf.cdo.common.revision;
import org.eclipse.emf.cdo.common.branch.CDOBranchVersion;
import org.eclipse.emf.cdo.common.id.CDOID;
-import org.eclipse.emf.cdo.common.id.CDOIDAndVersion;
/**
* @author Eike Stepper
* @since 3.0
*/
-public interface CDORevisionKey extends CDOBranchVersion, CDOIDAndVersion
+public interface CDORevisionKey extends CDOBranchVersion
{
public CDOID getID();
}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/commit/CDOCommitDataImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/commit/CDOCommitDataImpl.java
deleted file mode 100644
index a07484b..0000000
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/commit/CDOCommitDataImpl.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/**
- * Copyright (c) 2004 - 2010 Eike Stepper (Berlin, Germany) and others.
- * 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:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.emf.cdo.internal.common.commit;
-
-import org.eclipse.emf.cdo.common.commit.CDOCommitData;
-import org.eclipse.emf.cdo.common.id.CDOIDAndVersion;
-import org.eclipse.emf.cdo.common.model.CDOPackageUnit;
-import org.eclipse.emf.cdo.common.revision.CDORevisionKey;
-
-import java.util.Collection;
-
-/**
- * @author Eike Stepper
- */
-public class CDOCommitDataImpl implements CDOCommitData
-{
- private Collection<CDOPackageUnit> newPackageUnits;
-
- private Collection<CDOIDAndVersion> newObjects;
-
- private Collection<CDORevisionKey> changedObjects;
-
- private Collection<CDOIDAndVersion> detachedObjects;
-
- public CDOCommitDataImpl(Collection<CDOPackageUnit> newPackageUnits, Collection<CDOIDAndVersion> newObjects,
- Collection<CDORevisionKey> changedObjects, Collection<CDOIDAndVersion> detachedObjects)
- {
- this.newPackageUnits = newPackageUnits;
- this.newObjects = newObjects;
- this.changedObjects = changedObjects;
- this.detachedObjects = detachedObjects;
- }
-
- public Collection<CDOPackageUnit> getNewPackageUnits()
- {
- return newPackageUnits;
- }
-
- public Collection<CDOIDAndVersion> getNewObjects()
- {
- return newObjects;
- }
-
- public Collection<CDORevisionKey> getChangedObjects()
- {
- return changedObjects;
- }
-
- public Collection<CDOIDAndVersion> getDetachedObjects()
- {
- return detachedObjects;
- }
-}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/commit/CDOCommitInfoImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/commit/CDOCommitInfoImpl.java
index 757622d..a42836d 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/commit/CDOCommitInfoImpl.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/commit/CDOCommitInfoImpl.java
@@ -11,18 +11,12 @@
package org.eclipse.emf.cdo.internal.common.commit;
import org.eclipse.emf.cdo.common.branch.CDOBranch;
-import org.eclipse.emf.cdo.common.commit.CDOCommitData;
import org.eclipse.emf.cdo.common.commit.CDOCommitInfo;
-import org.eclipse.emf.cdo.common.id.CDOIDAndVersion;
-import org.eclipse.emf.cdo.common.model.CDOPackageUnit;
-import org.eclipse.emf.cdo.common.revision.CDORevisionKey;
import org.eclipse.emf.cdo.internal.common.branch.CDOBranchPointImpl;
import org.eclipse.emf.cdo.spi.common.commit.InternalCDOCommitInfoManager;
import org.eclipse.net4j.util.CheckUtil;
-import java.util.Collection;
-
/**
* @author Eike Stepper
*/
@@ -34,17 +28,14 @@ public class CDOCommitInfoImpl extends CDOBranchPointImpl implements CDOCommitIn
private String comment;
- private CDOCommitData commitData;
-
public CDOCommitInfoImpl(InternalCDOCommitInfoManager commitInfoManager, CDOBranch branch, long timeStamp,
- String userID, String comment, CDOCommitData commitData)
+ String userID, String comment)
{
super(branch, timeStamp);
CheckUtil.checkArg(commitInfoManager, "commitInfoManager"); //$NON-NLS-1$
this.commitInfoManager = commitInfoManager;
this.userID = userID;
this.comment = comment;
- this.commitData = commitData;
}
public InternalCDOCommitInfoManager getCommitInfoManager()
@@ -61,24 +52,4 @@ public class CDOCommitInfoImpl extends CDOBranchPointImpl implements CDOCommitIn
{
return comment;
}
-
- public synchronized Collection<CDOPackageUnit> getNewPackageUnits()
- {
- return commitData == null ? null : commitData.getNewPackageUnits();
- }
-
- public synchronized Collection<CDOIDAndVersion> getNewObjects()
- {
- return commitData == null ? null : commitData.getNewObjects();
- }
-
- public synchronized Collection<CDORevisionKey> getChangedObjects()
- {
- return commitData == null ? null : commitData.getChangedObjects();
- }
-
- public synchronized Collection<CDOIDAndVersion> getDetachedObjects()
- {
- return commitData == null ? null : commitData.getDetachedObjects();
- }
}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/commit/CDOCommitInfoManagerImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/commit/CDOCommitInfoManagerImpl.java
index a9410db..62afdf8 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/commit/CDOCommitInfoManagerImpl.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/commit/CDOCommitInfoManagerImpl.java
@@ -13,7 +13,6 @@ package org.eclipse.emf.cdo.internal.common.commit;
import org.eclipse.emf.cdo.common.branch.CDOBranch;
import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
-import org.eclipse.emf.cdo.common.commit.CDOCommitData;
import org.eclipse.emf.cdo.common.commit.CDOCommitInfo;
import org.eclipse.emf.cdo.common.commit.CDOCommitInfoHandler;
import org.eclipse.emf.cdo.spi.common.commit.InternalCDOCommitInfoManager;
@@ -42,11 +41,10 @@ public class CDOCommitInfoManagerImpl extends Lifecycle implements InternalCDOCo
this.commitInfoLoader = commitInfoLoader;
}
- public CDOCommitInfo createCommitInfo(CDOBranch branch, long timeStamp, String userID, String comment,
- CDOCommitData commitData)
+ public CDOCommitInfo createCommitInfo(CDOBranch branch, long timeStamp, String userID, String comment)
{
checkActive();
- return new CDOCommitInfoImpl(this, branch, timeStamp, userID, comment, commitData);
+ return new CDOCommitInfoImpl(this, branch, timeStamp, userID, comment);
}
public void getCommitInfos(CDOBranch branch, long startTime, long endTime, CDOCommitInfoHandler handler)
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/id/CDOIDAndVersionAndBranchImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/id/CDOIDAndVersionAndBranchImpl.java
new file mode 100644
index 0000000..a79c982
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/id/CDOIDAndVersionAndBranchImpl.java
@@ -0,0 +1,80 @@
+/**
+ * Copyright (c) 2004 - 2010 Eike Stepper (Berlin, Germany) and others.
+ * 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:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.internal.common.id;
+
+import org.eclipse.emf.cdo.common.id.CDOID;
+import org.eclipse.emf.cdo.common.id.CDOIDAndVersionAndBranch;
+import org.eclipse.emf.cdo.common.io.CDODataInput;
+import org.eclipse.emf.cdo.common.io.CDODataOutput;
+
+import java.io.IOException;
+import java.text.MessageFormat;
+
+/**
+ * @author Eike Stepper
+ */
+public final class CDOIDAndVersionAndBranchImpl extends CDOIDAndVersionImpl implements CDOIDAndVersionAndBranch
+{
+ private int branchID;
+
+ public CDOIDAndVersionAndBranchImpl(CDOID id, int version, int branchID)
+ {
+ super(id, version);
+ this.branchID = branchID;
+ }
+
+ public CDOIDAndVersionAndBranchImpl(CDODataInput in) throws IOException
+ {
+ super(in);
+ branchID = in.readInt();
+ }
+
+ @Override
+ public void write(CDODataOutput out) throws IOException
+ {
+ super.write(out);
+ out.writeInt(branchID);
+ }
+
+ public int getBranchID()
+ {
+ return branchID;
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (obj == this)
+ {
+ return true;
+ }
+
+ if (obj instanceof CDOIDAndVersionAndBranch)
+ {
+ CDOIDAndVersionAndBranch that = (CDOIDAndVersionAndBranch)obj;
+ return getID().equals(that.getID()) && getVersion() == that.getVersion() && branchID == that.getBranchID();
+ }
+
+ return false;
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return getID().hashCode() ^ getVersion() ^ branchID;
+ }
+
+ @Override
+ public String toString()
+ {
+ return MessageFormat.format("{0}v{1}b{2}", getID(), getVersion(), branchID); //$NON-NLS-1$
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/io/CDODataInputImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/io/CDODataInputImpl.java
index d30a18f..6f13991 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/io/CDODataInputImpl.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/io/CDODataInputImpl.java
@@ -15,12 +15,10 @@ import org.eclipse.emf.cdo.common.branch.CDOBranch;
import org.eclipse.emf.cdo.common.branch.CDOBranchManager;
import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
import org.eclipse.emf.cdo.common.branch.CDOBranchVersion;
-import org.eclipse.emf.cdo.common.commit.CDOCommitData;
-import org.eclipse.emf.cdo.common.commit.CDOCommitInfo;
-import org.eclipse.emf.cdo.common.commit.CDOCommitInfoManager;
import org.eclipse.emf.cdo.common.id.CDOID;
import org.eclipse.emf.cdo.common.id.CDOIDAndBranch;
import org.eclipse.emf.cdo.common.id.CDOIDAndVersion;
+import org.eclipse.emf.cdo.common.id.CDOIDAndVersionAndBranch;
import org.eclipse.emf.cdo.common.id.CDOIDMetaRange;
import org.eclipse.emf.cdo.common.id.CDOIDUtil;
import org.eclipse.emf.cdo.common.id.CDOID.Type;
@@ -35,13 +33,12 @@ import org.eclipse.emf.cdo.common.revision.CDOList;
import org.eclipse.emf.cdo.common.revision.CDOListFactory;
import org.eclipse.emf.cdo.common.revision.CDORevision;
import org.eclipse.emf.cdo.common.revision.CDORevisionFactory;
-import org.eclipse.emf.cdo.common.revision.CDORevisionKey;
import org.eclipse.emf.cdo.common.revision.CDORevisionUtil;
import org.eclipse.emf.cdo.common.revision.delta.CDOFeatureDelta;
import org.eclipse.emf.cdo.common.revision.delta.CDORevisionDelta;
import org.eclipse.emf.cdo.internal.common.bundle.OM;
-import org.eclipse.emf.cdo.internal.common.commit.CDOCommitDataImpl;
import org.eclipse.emf.cdo.internal.common.id.CDOIDAndBranchImpl;
+import org.eclipse.emf.cdo.internal.common.id.CDOIDAndVersionAndBranchImpl;
import org.eclipse.emf.cdo.internal.common.id.CDOIDAndVersionImpl;
import org.eclipse.emf.cdo.internal.common.id.CDOIDExternalImpl;
import org.eclipse.emf.cdo.internal.common.id.CDOIDMetaImpl;
@@ -61,7 +58,6 @@ import org.eclipse.emf.cdo.internal.common.revision.delta.CDORevisionDeltaImpl;
import org.eclipse.emf.cdo.internal.common.revision.delta.CDOSetFeatureDeltaImpl;
import org.eclipse.emf.cdo.internal.common.revision.delta.CDOUnsetFeatureDeltaImpl;
import org.eclipse.emf.cdo.spi.common.branch.CDOBranchUtil;
-import org.eclipse.emf.cdo.spi.common.commit.InternalCDOCommitInfoManager;
import org.eclipse.emf.cdo.spi.common.id.AbstractCDOID;
import org.eclipse.emf.cdo.spi.common.id.InternalCDOIDObject;
import org.eclipse.emf.cdo.spi.common.model.InternalCDOPackageInfo;
@@ -82,8 +78,6 @@ import org.eclipse.emf.ecore.util.FeatureMapUtil;
import java.io.IOException;
import java.text.MessageFormat;
-import java.util.ArrayList;
-import java.util.List;
/**
* @author Eike Stepper
@@ -182,59 +176,6 @@ public abstract class CDODataInputImpl extends ExtendedDataInput.Delegating impl
return CDOBranchUtil.createBranchVersion(branch, version);
}
- public CDOCommitData readCDOCommitData() throws IOException
- {
- int size;
-
- size = readInt();
- List<CDOPackageUnit> newPackageUnits = new ArrayList<CDOPackageUnit>(size);
- for (int i = 0; i < size; i++)
- {
- CDOPackageUnit data = readCDOPackageUnit(null);
- newPackageUnits.add(data);
- }
-
- size = readInt();
- List<CDOIDAndVersion> newObjects = new ArrayList<CDOIDAndVersion>(size);
- for (int i = 0; i < size; i++)
- {
- boolean revision = readBoolean();
- CDOIDAndVersion data = revision ? readCDORevision() : readCDOIDAndVersion();
- newObjects.add(data);
- }
-
- size = readInt();
- List<CDORevisionKey> changedObjects = new ArrayList<CDORevisionKey>(size);
- for (int i = 0; i < size; i++)
- {
- boolean delta = readBoolean();
- CDORevisionKey data = delta ? readCDORevisionDelta() : readCDORevisionKey();
- changedObjects.add(data);
- }
-
- size = readInt();
- List<CDOIDAndVersion> detachedObjects = new ArrayList<CDOIDAndVersion>(size);
- for (int i = 0; i < size; i++)
- {
- CDOIDAndVersion data = readCDOIDAndVersion();
- detachedObjects.add(data);
- }
-
- return new CDOCommitDataImpl(newPackageUnits, newObjects, changedObjects, detachedObjects);
- }
-
- public CDOCommitInfo readCDOCommitInfo(CDOCommitInfoManager commitInfoManager) throws IOException
- {
- CDOBranch branch = readCDOBranch();
- long timeStamp = readLong();
- String userID = readString();
- String comment = readString();
- CDOCommitData commitData = readCDOCommitData();
-
- return ((InternalCDOCommitInfoManager)commitInfoManager).createCommitInfo(branch, timeStamp, userID, comment,
- commitData);
- }
-
public CDOID readCDOID() throws IOException
{
byte ordinal = readByte();
@@ -332,6 +273,11 @@ public abstract class CDODataInputImpl extends ExtendedDataInput.Delegating impl
return new CDOIDAndBranchImpl(this);
}
+ public CDOIDAndVersionAndBranch readCDOIDAndVersionAndBranch() throws IOException
+ {
+ return new CDOIDAndVersionAndBranchImpl(this);
+ }
+
public CDOIDMetaRange readCDOIDMetaRange() throws IOException
{
boolean exist = readBoolean();
@@ -343,14 +289,6 @@ public abstract class CDODataInputImpl extends ExtendedDataInput.Delegating impl
return null;
}
- public CDORevisionKey readCDORevisionKey() throws IOException
- {
- CDOID id = readCDOID();
- CDOBranch branch = readCDOBranch();
- int version = readInt();
- return CDORevisionUtil.createRevisionKey(id, branch, version);
- }
-
public CDORevision readCDORevision() throws IOException
{
boolean notNull = readBoolean();
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/io/CDODataOutputImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/io/CDODataOutputImpl.java
index 28ef513..4ad68a7 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/io/CDODataOutputImpl.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/io/CDODataOutputImpl.java
@@ -13,28 +13,26 @@ package org.eclipse.emf.cdo.internal.common.io;
import org.eclipse.emf.cdo.common.branch.CDOBranch;
import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
import org.eclipse.emf.cdo.common.branch.CDOBranchVersion;
-import org.eclipse.emf.cdo.common.commit.CDOCommitData;
-import org.eclipse.emf.cdo.common.commit.CDOCommitInfo;
import org.eclipse.emf.cdo.common.id.CDOID;
import org.eclipse.emf.cdo.common.id.CDOIDAndBranch;
import org.eclipse.emf.cdo.common.id.CDOIDAndVersion;
+import org.eclipse.emf.cdo.common.id.CDOIDAndVersionAndBranch;
import org.eclipse.emf.cdo.common.id.CDOIDMetaRange;
import org.eclipse.emf.cdo.common.id.CDOIDProvider;
import org.eclipse.emf.cdo.common.io.CDODataOutput;
import org.eclipse.emf.cdo.common.model.CDOClassifierRef;
import org.eclipse.emf.cdo.common.model.CDOModelUtil;
import org.eclipse.emf.cdo.common.model.CDOPackageInfo;
-import org.eclipse.emf.cdo.common.model.CDOPackageRegistry;
import org.eclipse.emf.cdo.common.model.CDOPackageUnit;
import org.eclipse.emf.cdo.common.model.CDOType;
import org.eclipse.emf.cdo.common.revision.CDOList;
import org.eclipse.emf.cdo.common.revision.CDORevision;
-import org.eclipse.emf.cdo.common.revision.CDORevisionKey;
import org.eclipse.emf.cdo.common.revision.CDORevisionUtil;
import org.eclipse.emf.cdo.common.revision.delta.CDOFeatureDelta;
import org.eclipse.emf.cdo.common.revision.delta.CDORevisionDelta;
import org.eclipse.emf.cdo.internal.common.bundle.OM;
import org.eclipse.emf.cdo.internal.common.id.CDOIDAndBranchImpl;
+import org.eclipse.emf.cdo.internal.common.id.CDOIDAndVersionAndBranchImpl;
import org.eclipse.emf.cdo.internal.common.id.CDOIDAndVersionImpl;
import org.eclipse.emf.cdo.internal.common.messages.Messages;
import org.eclipse.emf.cdo.internal.common.model.CDOTypeImpl;
@@ -61,7 +59,6 @@ import org.eclipse.emf.ecore.util.FeatureMap.Entry;
import java.io.IOException;
import java.text.MessageFormat;
-import java.util.Collection;
/**
* @author Eike Stepper
@@ -142,64 +139,6 @@ public abstract class CDODataOutputImpl extends ExtendedDataOutput.Delegating im
writeInt(branchVersion.getVersion());
}
- public void writeCDOCommitData(CDOCommitData commitData) throws IOException
- {
- Collection<CDOPackageUnit> newPackageUnits = commitData.getNewPackageUnits();
- writeInt(newPackageUnits.size());
- for (CDOPackageUnit data : newPackageUnits)
- {
- writeCDOPackageUnit(data, false);
- }
-
- Collection<CDOIDAndVersion> newObjects = commitData.getNewObjects();
- writeInt(newObjects.size());
- for (CDOIDAndVersion data : newObjects)
- {
- if (data instanceof CDORevision)
- {
- writeBoolean(true);
- writeCDORevision((CDORevision)data, CDORevision.UNCHUNKED);
- }
- else
- {
- writeBoolean(false);
- writeCDOIDAndVersion(data);
- }
- }
-
- Collection<CDORevisionKey> changedObjects = commitData.getChangedObjects();
- writeInt(changedObjects.size());
- for (CDORevisionKey data : changedObjects)
- {
- if (data instanceof CDORevision)
- {
- writeBoolean(true);
- writeCDORevisionDelta((CDORevisionDelta)data);
- }
- else
- {
- writeBoolean(false);
- writeCDORevisionKey(data);
- }
- }
-
- Collection<CDOIDAndVersion> detachedObjects = commitData.getDetachedObjects();
- writeInt(detachedObjects.size());
- for (CDOIDAndVersion data : detachedObjects)
- {
- writeCDOIDAndVersion(data);
- }
- }
-
- public void writeCDOCommitInfo(CDOCommitInfo commitInfo) throws IOException
- {
- writeCDOBranch(commitInfo.getBranch());
- writeLong(commitInfo.getTimeStamp());
- writeString(commitInfo.getUserID());
- writeString(commitInfo.getComment());
- writeCDOCommitData(commitInfo);
- }
-
public void writeCDOID(CDOID id) throws IOException
{
if (id == null)
@@ -245,6 +184,11 @@ public abstract class CDODataOutputImpl extends ExtendedDataOutput.Delegating im
((CDOIDAndBranchImpl)idAndBranch).write(this);
}
+ public void writeCDOIDAndVersionAndBranch(CDOIDAndVersionAndBranch idAndVersionAndBranch) throws IOException
+ {
+ ((CDOIDAndVersionAndBranchImpl)idAndVersionAndBranch).write(this);
+ }
+
public void writeCDOIDMetaRange(CDOIDMetaRange metaRange) throws IOException
{
if (metaRange == null)
@@ -259,23 +203,6 @@ public abstract class CDODataOutputImpl extends ExtendedDataOutput.Delegating im
}
}
- public CDOPackageRegistry getPackageRegistry()
- {
- return null;
- }
-
- public CDOIDProvider getIDProvider()
- {
- return null;
- }
-
- public void writeCDORevisionKey(CDORevisionKey revisionKey) throws IOException
- {
- writeCDOID(revisionKey.getID());
- writeCDOBranch(revisionKey.getBranch());
- writeInt(revisionKey.getVersion());
- }
-
public void writeCDORevision(CDORevision revision, int referenceChunk) throws IOException
{
if (revision != null)
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOPackageUnitImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOPackageUnitImpl.java
index bfaf3ed..6dd9a9b 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOPackageUnitImpl.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOPackageUnitImpl.java
@@ -23,7 +23,6 @@ import org.eclipse.emf.cdo.spi.common.model.InternalCDOPackageInfo;
import org.eclipse.emf.cdo.spi.common.model.InternalCDOPackageRegistry;
import org.eclipse.emf.cdo.spi.common.model.InternalCDOPackageUnit;
-import org.eclipse.net4j.util.CheckUtil;
import org.eclipse.net4j.util.om.trace.ContextTracer;
import org.eclipse.emf.ecore.EPackage;
@@ -281,7 +280,6 @@ public class CDOPackageUnitImpl implements InternalCDOPackageUnit
boolean withPackages = in.readBoolean();
if (withPackages)
{
- CheckUtil.checkArg(packageRegistry, "packageRegistry");
ePackage = CDOModelUtil.readPackage(in, packageRegistry);
setState(State.LOADED);
}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/CDORevisionImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/CDORevisionImpl.java
index 6d54b50..aaafe3a 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/CDORevisionImpl.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/CDORevisionImpl.java
@@ -15,9 +15,9 @@ package org.eclipse.emf.cdo.internal.common.revision;
import org.eclipse.emf.cdo.common.model.CDOModelUtil;
import org.eclipse.emf.cdo.common.model.CDOType;
+import org.eclipse.emf.cdo.common.revision.CDORevision;
import org.eclipse.emf.cdo.spi.common.revision.BaseCDORevision;
import org.eclipse.emf.cdo.spi.common.revision.InternalCDOList;
-import org.eclipse.emf.cdo.spi.common.revision.InternalCDORevision;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EClassifier;
@@ -60,7 +60,7 @@ public class CDORevisionImpl extends BaseCDORevision
}
}
- public InternalCDORevision copy()
+ public CDORevision copy()
{
return new CDORevisionImpl(this);
}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/CDORevisionManagerImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/CDORevisionManagerImpl.java
index b2e6291..020b66a 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/CDORevisionManagerImpl.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/CDORevisionManagerImpl.java
@@ -222,7 +222,7 @@ public class CDORevisionManagerImpl extends Lifecycle implements InternalCDORevi
}
}
- public InternalCDORevision getRevision(CDOID id, CDOBranchPoint branchPoint, int referenceChunk, int prefetchDepth,
+ public CDORevision getRevision(CDOID id, CDOBranchPoint branchPoint, int referenceChunk, int prefetchDepth,
boolean loadOnDemand)
{
return getRevision(id, branchPoint, referenceChunk, prefetchDepth, loadOnDemand, null);
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDORevisionDeltaImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDORevisionDeltaImpl.java
index f394c99..91c595a 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDORevisionDeltaImpl.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDORevisionDeltaImpl.java
@@ -165,6 +165,8 @@ public class CDORevisionDeltaImpl implements InternalCDORevisionDelta
public void apply(CDORevision revision)
{
+ // ((InternalCDORevision)revision).setBranchPoint(branch.getPoint(revision.getTimeStamp()));
+ // ((InternalCDORevision)revision).setVersion(version);
for (CDOFeatureDelta featureDelta : featureDeltas.values())
{
((CDOFeatureDeltaImpl)featureDelta).apply(revision);
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/commit/InternalCDOCommitInfoManager.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/commit/InternalCDOCommitInfoManager.java
index c07756d..16b4af5 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/commit/InternalCDOCommitInfoManager.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/commit/InternalCDOCommitInfoManager.java
@@ -11,7 +11,6 @@
package org.eclipse.emf.cdo.spi.common.commit;
import org.eclipse.emf.cdo.common.branch.CDOBranch;
-import org.eclipse.emf.cdo.common.commit.CDOCommitData;
import org.eclipse.emf.cdo.common.commit.CDOCommitInfo;
import org.eclipse.emf.cdo.common.commit.CDOCommitInfoHandler;
import org.eclipse.emf.cdo.common.commit.CDOCommitInfoManager;
@@ -27,8 +26,7 @@ public interface InternalCDOCommitInfoManager extends CDOCommitInfoManager, ILif
public void setCommitInfoLoader(CommitInfoLoader commitInfoLoader);
- public CDOCommitInfo createCommitInfo(CDOBranch branch, long timeStamp, String userID, String comment,
- CDOCommitData commitData);
+ public CDOCommitInfo createCommitInfo(CDOBranch branch, long timeStamp, String userID, String comment);
/**
* @author Eike Stepper
@@ -36,7 +34,5 @@ public interface InternalCDOCommitInfoManager extends CDOCommitInfoManager, ILif
public interface CommitInfoLoader
{
public void loadCommitInfos(CDOBranch branch, long startTime, long endTime, CDOCommitInfoHandler handler);
-
- public CDOCommitData loadCommitData(long timeStamp);
}
}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/DelegatingCDORevisionManager.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/DelegatingCDORevisionManager.java
index 2439e01..5e56b79 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/DelegatingCDORevisionManager.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/DelegatingCDORevisionManager.java
@@ -105,19 +105,19 @@ public abstract class DelegatingCDORevisionManager extends Lifecycle implements
return getDelegate().getObjectType(id);
}
- public InternalCDORevision getRevisionByVersion(CDOID id, CDOBranchVersion branchVersion, int referenceChunk,
+ public CDORevision getRevisionByVersion(CDOID id, CDOBranchVersion branchVersion, int referenceChunk,
boolean loadOnDemand)
{
return getDelegate().getRevisionByVersion(id, branchVersion, referenceChunk, loadOnDemand);
}
- public InternalCDORevision getRevision(CDOID id, CDOBranchPoint branchPoint, int referenceChunk, int prefetchDepth,
+ public CDORevision getRevision(CDOID id, CDOBranchPoint branchPoint, int referenceChunk, int prefetchDepth,
boolean loadOnDemand)
{
return getDelegate().getRevision(id, branchPoint, referenceChunk, prefetchDepth, loadOnDemand);
}
- public InternalCDORevision getRevision(CDOID id, CDOBranchPoint branchPoint, int referenceChunk, int prefetchDepth,
+ public CDORevision getRevision(CDOID id, CDOBranchPoint branchPoint, int referenceChunk, int prefetchDepth,
boolean loadOnDemand, SyntheticCDORevision[] synthetics)
{
return getDelegate().getRevision(id, branchPoint, referenceChunk, prefetchDepth, loadOnDemand, synthetics);
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/InternalCDORevision.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/InternalCDORevision.java
index 851487d..5e6e966 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/InternalCDORevision.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/InternalCDORevision.java
@@ -101,6 +101,4 @@ public interface InternalCDORevision extends CDORevision, CDORevisionData, CDORe
* @since 3.0
*/
public void convertEObjects(CDOIDProvider oidProvider);
-
- public InternalCDORevision copy();
}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/InternalCDORevisionManager.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/InternalCDORevisionManager.java
index d2fe23a..91682c1 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/InternalCDORevisionManager.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/InternalCDORevisionManager.java
@@ -51,23 +51,16 @@ public interface InternalCDORevisionManager extends CDORevisionManager, CDORevis
public void setCache(CDORevisionCache cache);
- @Deprecated
public void reviseLatest(CDOID id, CDOBranch branch);
public void reviseVersion(CDOID id, CDOBranchVersion branchVersion, long timeStamp);
- public InternalCDORevision getRevision(CDOID id, CDOBranchPoint branchPoint, int referenceChunk, int prefetchDepth,
+ public CDORevision getRevision(CDOID id, CDOBranchPoint branchPoint, int referenceChunk, int prefetchDepth,
boolean loadOnDemand, SyntheticCDORevision[] synthetics);
public List<CDORevision> getRevisions(List<CDOID> ids, CDOBranchPoint branchPoint, int referenceChunk,
int prefetchDepth, boolean loadOnDemand, SyntheticCDORevision[] synthetics);
- public InternalCDORevision getRevision(CDOID id, CDOBranchPoint branchPoint, int referenceChunk, int prefetchDepth,
- boolean loadOnDemand);
-
- public InternalCDORevision getRevisionByVersion(CDOID id, CDOBranchVersion branchVersion, int referenceChunk,
- boolean loadOnDemand);
-
/**
* @author Eike Stepper
* @since 3.0
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/RevisionInfo.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/RevisionInfo.java
index 7073f0c..ee068b9 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/RevisionInfo.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/RevisionInfo.java
@@ -124,8 +124,8 @@ public abstract class RevisionInfo
public void execute(InternalCDORevisionManager revisionManager, int referenceChunk)
{
SyntheticCDORevision[] synthetics = new SyntheticCDORevision[1];
- result = revisionManager.getRevision(getID(), requestedBranchPoint, referenceChunk, CDORevision.DEPTH_NONE, true,
- synthetics);
+ result = (InternalCDORevision)revisionManager.getRevision(getID(), requestedBranchPoint, referenceChunk,
+ CDORevision.DEPTH_NONE, true, synthetics);
synthetic = synthetics[0];
}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/StubCDORevision.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/StubCDORevision.java
index a33187a..1e1c79c 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/StubCDORevision.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/StubCDORevision.java
@@ -171,7 +171,7 @@ public class StubCDORevision extends AbstractCDORevision
throw new UnsupportedOperationException();
}
- public InternalCDORevision copy()
+ public CDORevision copy()
{
throw new UnsupportedOperationException();
}
diff --git a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CDOClientProtocol.java b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CDOClientProtocol.java
index 1fb4be0..7f6de91 100644
--- a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CDOClientProtocol.java
+++ b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CDOClientProtocol.java
@@ -14,7 +14,6 @@ import org.eclipse.emf.cdo.CDOObject;
import org.eclipse.emf.cdo.common.branch.CDOBranch;
import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
import org.eclipse.emf.cdo.common.branch.CDOBranchVersion;
-import org.eclipse.emf.cdo.common.commit.CDOCommitData;
import org.eclipse.emf.cdo.common.commit.CDOCommitInfoHandler;
import org.eclipse.emf.cdo.common.id.CDOID;
import org.eclipse.emf.cdo.common.id.CDOIDAndVersion;
@@ -123,12 +122,6 @@ public class CDOClientProtocol extends SignalProtocol<CDOSession> implements CDO
send(new LoadCommitInfosRequest(this, branch, startTime, endTime, handler));
}
- public CDOCommitData loadCommitData(long timeStamp)
- {
- // TODO: implement CDOClientProtocol.loadCommitData(timeStamp, dataType)
- throw new UnsupportedOperationException();
- }
-
public Object loadChunk(InternalCDORevision revision, EStructuralFeature feature, int accessIndex, int fetchIndex,
int fromIndex, int toIndex)
{
diff --git a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CDOClientRequest.java b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CDOClientRequest.java
index e875e56..99397b2 100644
--- a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CDOClientRequest.java
+++ b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CDOClientRequest.java
@@ -58,13 +58,11 @@ public abstract class CDOClientRequest<RESULT> extends RequestWithConfirmation<R
{
requesting(new CDODataOutputImpl(out)
{
- @Override
public CDOPackageRegistry getPackageRegistry()
{
return getSession().getPackageRegistry();
}
- @Override
public CDOIDProvider getIDProvider()
{
throw new UnsupportedOperationException();
diff --git a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CommitNotificationIndication.java b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CommitNotificationIndication.java
index ea686e4..555fafa 100644
--- a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CommitNotificationIndication.java
+++ b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CommitNotificationIndication.java
@@ -11,19 +11,35 @@
**************************************************************************/
package org.eclipse.emf.cdo.internal.net4j.protocol;
-import org.eclipse.emf.cdo.common.commit.CDOCommitInfo;
+import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
+import org.eclipse.emf.cdo.common.id.CDOID;
+import org.eclipse.emf.cdo.common.id.CDOIDAndVersion;
import org.eclipse.emf.cdo.common.io.CDODataInput;
+import org.eclipse.emf.cdo.common.model.CDOPackageUnit;
import org.eclipse.emf.cdo.common.protocol.CDOProtocolConstants;
+import org.eclipse.emf.cdo.common.revision.delta.CDORevisionDelta;
+import org.eclipse.emf.cdo.internal.net4j.bundle.OM;
+import org.eclipse.emf.cdo.spi.common.model.InternalCDOPackageRegistry;
+import org.eclipse.emf.cdo.spi.common.model.InternalCDOPackageUnit;
+
+import org.eclipse.net4j.util.om.trace.ContextTracer;
import org.eclipse.emf.spi.cdo.InternalCDOSession;
import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
/**
* @author Eike Stepper
*/
public class CommitNotificationIndication extends CDOClientIndication
{
+ private static final ContextTracer TRACER = new ContextTracer(OM.DEBUG_PROTOCOL, CommitNotificationIndication.class);
+
public CommitNotificationIndication(CDOClientProtocol protocol)
{
super(protocol, CDOProtocolConstants.SIGNAL_COMMIT_NOTIFICATION);
@@ -32,65 +48,64 @@ public class CommitNotificationIndication extends CDOClientIndication
@Override
protected void indicating(CDODataInput in) throws IOException
{
- // CDOBranchPoint branchPoint = in.readCDOBranchPoint();
- // if (TRACER.isEnabled())
- // {
- // TRACER.format("Read branchpoint: {0}", branchPoint); //$NON-NLS-1$
- // }
- //
- // CDOPackageUnit[] packageUnits = in.readCDOPackageUnits(null);
- // InternalCDOPackageRegistry packageRegistry = getSession().getPackageRegistry();
- // for (int i = 0; i < packageUnits.length; i++)
- // {
- // packageRegistry.putPackageUnit((InternalCDOPackageUnit)packageUnits[i]);
- // }
- //
- // int size = in.readInt();
- // if (TRACER.isEnabled())
- // {
- // TRACER.format("Reading {0} dirty IDs", size); //$NON-NLS-1$
- // }
- //
- // InternalCDOSession session = getSession();
- // Set<CDOIDAndVersion> dirtyOIDandVersions = new HashSet<CDOIDAndVersion>();
- // for (int i = 0; i < size; i++)
- // {
- // CDOIDAndVersion dirtyOIDandVersion = in.readCDOIDAndVersion();
- // if (TRACER.isEnabled())
- // {
- // TRACER.format("Read dirty ID: {0}", dirtyOIDandVersion); //$NON-NLS-1$
- // }
- //
- // dirtyOIDandVersions.add(dirtyOIDandVersion);
- // }
- //
- // size = in.readInt();
- // if (TRACER.isEnabled())
- // {
- // TRACER.format("Reading {0} Deltas", size); //$NON-NLS-1$
- // }
- //
- // List<CDORevisionDelta> deltas = new ArrayList<CDORevisionDelta>();
- // for (int i = 0; i < size; i++)
- // {
- // CDORevisionDelta revisionDelta = in.readCDORevisionDelta();
- // deltas.add(revisionDelta);
- // }
- //
- // size = in.readInt();
- // if (TRACER.isEnabled())
- // {
- // TRACER.format("Reading {0} Detach Objects", size); //$NON-NLS-1$
- // }
- //
- // List<CDOID> detachedObjects = new ArrayList<CDOID>();
- // for (int i = 0; i < size; i++)
- // {
- // detachedObjects.add(in.readCDOID());
- // }
+ CDOBranchPoint branchPoint = in.readCDOBranchPoint();
+ if (TRACER.isEnabled())
+ {
+ TRACER.format("Read branchpoint: {0}", branchPoint); //$NON-NLS-1$
+ }
+
+ CDOPackageUnit[] packageUnits = in.readCDOPackageUnits(null);
+ InternalCDOPackageRegistry packageRegistry = getSession().getPackageRegistry();
+ for (int i = 0; i < packageUnits.length; i++)
+ {
+ packageRegistry.putPackageUnit((InternalCDOPackageUnit)packageUnits[i]);
+ }
+
+ int size = in.readInt();
+ if (TRACER.isEnabled())
+ {
+ TRACER.format("Reading {0} dirty IDs", size); //$NON-NLS-1$
+ }
InternalCDOSession session = getSession();
- CDOCommitInfo commitInfo = in.readCDOCommitInfo(session.getCommitInfoManager());
- session.handleCommitNotification(commitInfo);
+ Set<CDOIDAndVersion> dirtyOIDandVersions = new HashSet<CDOIDAndVersion>();
+ for (int i = 0; i < size; i++)
+ {
+ CDOIDAndVersion dirtyOIDandVersion = in.readCDOIDAndVersion();
+ if (TRACER.isEnabled())
+ {
+ TRACER.format("Read dirty ID: {0}", dirtyOIDandVersion); //$NON-NLS-1$
+ }
+
+ dirtyOIDandVersions.add(dirtyOIDandVersion);
+ }
+
+ size = in.readInt();
+ if (TRACER.isEnabled())
+ {
+ TRACER.format("Reading {0} Deltas", size); //$NON-NLS-1$
+ }
+
+ List<CDORevisionDelta> deltas = new ArrayList<CDORevisionDelta>();
+ for (int i = 0; i < size; i++)
+ {
+ CDORevisionDelta revisionDelta = in.readCDORevisionDelta();
+ deltas.add(revisionDelta);
+ }
+
+ size = in.readInt();
+ if (TRACER.isEnabled())
+ {
+ TRACER.format("Reading {0} Detach Objects", size); //$NON-NLS-1$
+ }
+
+ List<CDOID> detachedObjects = new ArrayList<CDOID>();
+ for (int i = 0; i < size; i++)
+ {
+ detachedObjects.add(in.readCDOID());
+ }
+
+ session.handleCommitNotification(branchPoint, Arrays.asList(packageUnits), dirtyOIDandVersions, detachedObjects,
+ deltas, null);
}
}
diff --git a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CommitTransactionRequest.java b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CommitTransactionRequest.java
index 641a538..4ffe3c8 100644
--- a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CommitTransactionRequest.java
+++ b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CommitTransactionRequest.java
@@ -103,13 +103,11 @@ public class CommitTransactionRequest extends RequestWithMonitoring<CommitTransa
{
requesting(new CDODataOutputImpl(out)
{
- @Override
public CDOPackageRegistry getPackageRegistry()
{
return getSession().getPackageRegistry();
}
- @Override
public CDOIDProvider getIDProvider()
{
return CommitTransactionRequest.this.getIDProvider();
diff --git a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/LoadCommitInfosRequest.java b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/LoadCommitInfosRequest.java
index 8f32fae..49b43d2 100644
--- a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/LoadCommitInfosRequest.java
+++ b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/LoadCommitInfosRequest.java
@@ -74,7 +74,7 @@ public class LoadCommitInfosRequest extends CDOClientRequest<Boolean>
try
{
- CDOCommitInfo commitInfo = manager.createCommitInfo(branch, timeStamp, userID, comment, null);
+ CDOCommitInfo commitInfo = manager.createCommitInfo(branch, timeStamp, userID, comment);
handler.handleCommitInfo(commitInfo);
}
catch (Exception ex)
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreAccessor.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreAccessor.java
index 26861f1..6520f56 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreAccessor.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreAccessor.java
@@ -17,7 +17,6 @@ import org.eclipse.emf.cdo.common.CDOQueryInfo;
import org.eclipse.emf.cdo.common.branch.CDOBranch;
import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
import org.eclipse.emf.cdo.common.branch.CDOBranchVersion;
-import org.eclipse.emf.cdo.common.commit.CDOCommitData;
import org.eclipse.emf.cdo.common.commit.CDOCommitInfo;
import org.eclipse.emf.cdo.common.commit.CDOCommitInfoHandler;
import org.eclipse.emf.cdo.common.id.CDOID;
@@ -436,8 +435,8 @@ public class DBStoreAccessor extends LongIDStoreAccessor implements IDBStoreAcce
TRACER.format("Detaching object: {0} in branch {1}", id, branch); //$NON-NLS-1$
}
- InternalCDORevision oldRevision = getStore().getRepository().getRevisionManager().getRevision(id,
- branch.getPoint(revised), 0, CDORevision.DEPTH_NONE, true);
+ InternalCDORevision oldRevision = (InternalCDORevision)getStore().getRepository().getRevisionManager().getRevision(
+ id, branch.getPoint(revised), 0, CDORevision.DEPTH_NONE, true);
EClass eClass = oldRevision.getEClass();
IMappingStrategy mappingStrategy = getStore().getMappingStrategy();
@@ -743,14 +742,14 @@ public class DBStoreAccessor extends LongIDStoreAccessor implements IDBStoreAcce
long timeStamp = resultSet.getLong(1);
String userID = resultSet.getString(2);
String comment = resultSet.getString(3);
- CDOBranch infoBranch = branch;
- if (infoBranch == null)
+ CDOBranch br = branch;
+ if (br == null)
{
int id = resultSet.getInt(4);
- infoBranch = branchManager.getBranch(id);
+ br = branchManager.getBranch(id);
}
- CDOCommitInfo commitInfo = commitInfoManager.createCommitInfo(infoBranch, timeStamp, userID, comment, null);
+ CDOCommitInfo commitInfo = commitInfoManager.createCommitInfo(br, timeStamp, userID, comment);
handler.handleCommitInfo(commitInfo);
}
}
@@ -765,12 +764,6 @@ public class DBStoreAccessor extends LongIDStoreAccessor implements IDBStoreAcce
}
}
- public CDOCommitData loadCommitData(long timeStamp)
- {
- // TODO: implement DBStoreAccessor.loadCommitData(timeStamp, dataType)
- throw new UnsupportedOperationException();
- }
-
/**
* @author Stefan Winkler
*/
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/HorizontalAuditClassMapping.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/HorizontalAuditClassMapping.java
index bc091d1..9150577 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/HorizontalAuditClassMapping.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/HorizontalAuditClassMapping.java
@@ -525,7 +525,7 @@ public class HorizontalAuditClassMapping extends AbstractHorizontalClassMapping
InternalCDORevision originalRevision = (InternalCDORevision)accessor.getStore().getRepository()
.getRevisionManager().getRevisionByVersion(id, delta, 0, true);
- newRevision = originalRevision.copy();
+ newRevision = (InternalCDORevision)originalRevision.copy();
newRevision.setVersion(oldVersion + 1);
newRevision.setBranchPoint(CDOBranchUtil.createBranchPoint(delta.getBranch(), created));
diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStoreAccessor.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStoreAccessor.java
index 5e4888d..3329620 100644
--- a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStoreAccessor.java
+++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStoreAccessor.java
@@ -15,7 +15,6 @@ import org.eclipse.emf.cdo.common.CDOQueryInfo;
import org.eclipse.emf.cdo.common.branch.CDOBranch;
import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
import org.eclipse.emf.cdo.common.branch.CDOBranchVersion;
-import org.eclipse.emf.cdo.common.commit.CDOCommitData;
import org.eclipse.emf.cdo.common.commit.CDOCommitInfoHandler;
import org.eclipse.emf.cdo.common.id.CDOID;
import org.eclipse.emf.cdo.common.id.CDOIDTemp;
@@ -356,12 +355,6 @@ public class HibernateStoreAccessor extends StoreAccessor implements IHibernateS
throw new UnsupportedOperationException();
}
- public CDOCommitData loadCommitData(long timeStamp)
- {
- // TODO: implement HibernateStoreAccessor.loadCommitData(timeStamp, dataType)
- throw new UnsupportedOperationException();
- }
-
/**
* Not supported by the Hibernate Store, auditing is not supported
*/
diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDORevisionProxyHibernate.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDORevisionProxyHibernate.java
index 5f54f09..10d443c 100644
--- a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDORevisionProxyHibernate.java
+++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDORevisionProxyHibernate.java
@@ -10,6 +10,7 @@
*/
package org.eclipse.emf.cdo.server.internal.hibernate.tuplizer;
+import org.eclipse.emf.cdo.common.revision.CDORevision;
import org.eclipse.emf.cdo.spi.common.revision.DelegatingCDORevision;
import org.eclipse.emf.cdo.spi.common.revision.InternalCDORevision;
@@ -30,7 +31,7 @@ public class CDORevisionProxyHibernate extends DelegatingCDORevision implements
this.li = li;
}
- public InternalCDORevision copy()
+ public CDORevision copy()
{
return new CDORevisionProxyHibernate(li);
}
diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/AbstractSyncRevisionsIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/AbstractSyncRevisionsIndication.java
index 30a7f87..7220f70 100644
--- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/AbstractSyncRevisionsIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/AbstractSyncRevisionsIndication.java
@@ -88,8 +88,8 @@ public abstract class AbstractSyncRevisionsIndication extends CDOReadIndication
try
{
CDOBranchPoint branchPoint = getRepository().getBranchManager().getMainBranch().getHead();
- InternalCDORevision revision = getRepository().getRevisionManager().getRevision(id, branchPoint, referenceChunk,
- CDORevision.DEPTH_NONE, true);
+ InternalCDORevision revision = (InternalCDORevision)getRepository().getRevisionManager().getRevision(id,
+ branchPoint, referenceChunk, CDORevision.DEPTH_NONE, true);
if (revision == null)
{
detachedObjects.add(new Pair<CDOID, Long>(id, getTimestamp(id, version)));
diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CDOServerIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CDOServerIndication.java
index 1d8c2b4..dbcb746 100644
--- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CDOServerIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CDOServerIndication.java
@@ -118,13 +118,11 @@ public abstract class CDOServerIndication extends IndicationWithResponse
{
responding(new CDODataOutputImpl(out)
{
- @Override
public CDOPackageRegistry getPackageRegistry()
{
return getRepository().getPackageRegistry();
}
- @Override
public CDOIDProvider getIDProvider()
{
return getSession();
diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CDOServerRequest.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CDOServerRequest.java
index cb65f72..3a2c878 100644
--- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CDOServerRequest.java
+++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CDOServerRequest.java
@@ -48,7 +48,6 @@ public abstract class CDOServerRequest extends Request
{
requesting(new CDODataOutputImpl(out)
{
- @Override
public CDOPackageRegistry getPackageRegistry()
{
return getSession().getManager().getRepository().getPackageRegistry();
@@ -60,7 +59,6 @@ public abstract class CDOServerRequest extends Request
return getProtocol().getPackageURICompressor();
}
- @Override
public CDOIDProvider getIDProvider()
{
return getSession();
diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CommitTransactionIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CommitTransactionIndication.java
index 920c43c..4fb3172 100644
--- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CommitTransactionIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CommitTransactionIndication.java
@@ -294,13 +294,11 @@ public class CommitTransactionIndication extends IndicationWithMonitoring
{
responding(new CDODataOutputImpl(out)
{
- @Override
public CDOPackageRegistry getPackageRegistry()
{
return commitContext.getPackageRegistry();
}
- @Override
public CDOIDProvider getIDProvider()
{
return CommitTransactionIndication.this.getSession();
diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LoadChunkIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LoadChunkIndication.java
index 1f5f811..3bdea9c 100644
--- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LoadChunkIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LoadChunkIndication.java
@@ -95,7 +95,8 @@ public class LoadChunkIndication extends CDOReadIndication
InternalRepository repository = getRepository();
InternalCDORevisionManager revisionManager = repository.getRevisionManager();
- InternalCDORevision revision = revisionManager.getRevisionByVersion(id, branchVersion, 0, true);
+ InternalCDORevision revision = (InternalCDORevision)revisionManager
+ .getRevisionByVersion(id, branchVersion, 0, true);
repository.ensureChunk(revision, feature, fromIndex, toIndex + 1);
CDOType type = CDOModelUtil.getType(feature);
diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LoadRevisionsIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LoadRevisionsIndication.java
index 32caea7..053ee22 100644
--- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LoadRevisionsIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LoadRevisionsIndication.java
@@ -201,8 +201,8 @@ public class LoadRevisionsIndication extends CDOReadIndication
private InternalCDORevision getRevision(CDOID id)
{
- return getRepository().getRevisionManager().getRevision(id, branchPoint, referenceChunk, CDORevision.DEPTH_NONE,
- true);
+ return (InternalCDORevision)getRepository().getRevisionManager().getRevision(id, branchPoint, referenceChunk,
+ CDORevision.DEPTH_NONE, true);
}
private void collectRevisions(InternalCDORevision revision, Set<CDOID> revisions,
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 5c14221..496546c 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
@@ -19,7 +19,6 @@ import org.eclipse.emf.cdo.common.CDOQueryInfo;
import org.eclipse.emf.cdo.common.branch.CDOBranch;
import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
import org.eclipse.emf.cdo.common.branch.CDOBranchVersion;
-import org.eclipse.emf.cdo.common.commit.CDOCommitData;
import org.eclipse.emf.cdo.common.commit.CDOCommitInfoHandler;
import org.eclipse.emf.cdo.common.id.CDOID;
import org.eclipse.emf.cdo.common.id.CDOIDMetaRange;
@@ -250,12 +249,6 @@ public class Repository extends Container<Object> implements InternalRepository
accessor.loadCommitInfos(branch, startTime, endTime, handler);
}
- public CDOCommitData loadCommitData(long timeStamp)
- {
- IStoreAccessor accessor = StoreThreadLocal.getAccessor();
- return accessor.loadCommitData(timeStamp);
- }
-
public List<InternalCDORevision> loadRevisions(List<RevisionInfo> infos, CDOBranchPoint branchPoint,
int referenceChunk, int prefetchDepth)
{
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 96ba3e1..568ff14 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
@@ -283,8 +283,8 @@ public class Session extends Container<IView> implements InternalSession
CDOID id = (CDOID)value;
if (!CDOIDUtil.isNull(id) && !revisions.contains(id))
{
- InternalCDORevision containedRevision = revisionManager.getRevision(id, branchPoint, referenceChunk,
- CDORevision.DEPTH_NONE, true);
+ InternalCDORevision containedRevision = (InternalCDORevision)revisionManager.getRevision(id, branchPoint,
+ referenceChunk, CDORevision.DEPTH_NONE, true);
revisions.add(id);
additionalRevisions.add(containedRevision);
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/embedded/EmbeddedClientSessionProtocol.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/embedded/EmbeddedClientSessionProtocol.java
index f8a5d63..3efb5b3 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/embedded/EmbeddedClientSessionProtocol.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/embedded/EmbeddedClientSessionProtocol.java
@@ -14,7 +14,6 @@ import org.eclipse.emf.cdo.CDOObject;
import org.eclipse.emf.cdo.common.branch.CDOBranch;
import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
import org.eclipse.emf.cdo.common.branch.CDOBranchVersion;
-import org.eclipse.emf.cdo.common.commit.CDOCommitData;
import org.eclipse.emf.cdo.common.commit.CDOCommitInfoHandler;
import org.eclipse.emf.cdo.common.id.CDOID;
import org.eclipse.emf.cdo.common.id.CDOIDAndVersion;
@@ -148,18 +147,14 @@ public class EmbeddedClientSessionProtocol extends Lifecycle implements CDOSessi
throw new UnsupportedOperationException();
}
- public CDOCommitData loadCommitData(long timeStamp)
- {
- throw new UnsupportedOperationException();
- }
-
public InternalCDORevision loadRevisionByVersion(CDOID id, CDOBranchVersion branchVersion, int referenceChunk)
{
try
{
InternalSession session = serverSessionProtocol.getSession();
StoreThreadLocal.setSession(session);
- return repository.getRevisionManager().getRevisionByVersion(id, branchVersion, referenceChunk, true);
+ return (InternalCDORevision)repository.getRevisionManager().getRevisionByVersion(id, branchVersion,
+ referenceChunk, true);
}
finally
{
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/embedded/EmbeddedServerSessionProtocol.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/embedded/EmbeddedServerSessionProtocol.java
index a57cc02..99b1431 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/embedded/EmbeddedServerSessionProtocol.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/embedded/EmbeddedServerSessionProtocol.java
@@ -10,8 +10,12 @@
*/
package org.eclipse.emf.cdo.internal.server.embedded;
-import org.eclipse.emf.cdo.common.commit.CDOCommitInfo;
+import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
+import org.eclipse.emf.cdo.common.id.CDOID;
+import org.eclipse.emf.cdo.common.id.CDOIDAndVersion;
+import org.eclipse.emf.cdo.common.model.CDOPackageUnit;
import org.eclipse.emf.cdo.common.protocol.CDOAuthenticationResult;
+import org.eclipse.emf.cdo.common.revision.delta.CDORevisionDelta;
import org.eclipse.emf.cdo.session.remote.CDORemoteSessionMessage;
import org.eclipse.emf.cdo.spi.common.branch.InternalCDOBranch;
import org.eclipse.emf.cdo.spi.server.ISessionProtocol;
@@ -20,6 +24,10 @@ import org.eclipse.emf.cdo.spi.server.InternalSession;
import org.eclipse.net4j.util.lifecycle.Lifecycle;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+
/**
* @author Eike Stepper
*/
@@ -63,10 +71,12 @@ public class EmbeddedServerSessionProtocol extends Lifecycle implements ISession
clientSession.handleBranchNotification(branch);
}
- public void sendCommitNotification(CDOCommitInfo commitInfo)
+ public void sendCommitNotification(CDOBranchPoint branchPoint, CDOPackageUnit[] packageUnits,
+ List<CDOIDAndVersion> dirtyIDs, List<CDOID> detachedObjects, List<CDORevisionDelta> newDeltas)
{
EmbeddedClientSession clientSession = clientSessionProtocol.getSession();
- clientSession.handleCommitNotification(commitInfo);
+ clientSession.handleCommitNotification(branchPoint, Arrays.asList(packageUnits), new HashSet<CDOIDAndVersion>(
+ dirtyIDs), detachedObjects, newDeltas, null);
}
public void sendRemoteSessionNotification(InternalSession sender, byte opcode)
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/mem/MEMStore.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/mem/MEMStore.java
index 1c80d31..ce2bbc6 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/mem/MEMStore.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/mem/MEMStore.java
@@ -692,7 +692,7 @@ public class MEMStore extends LongIDStore implements IMEMStore, BranchLoader
public void handle(InternalCDOCommitInfoManager manager, CDOCommitInfoHandler handler)
{
- CDOCommitInfo commitInfo = manager.createCommitInfo(branch, timeStamp, userID, comment, null);
+ CDOCommitInfo commitInfo = manager.createCommitInfo(branch, timeStamp, userID, comment);
handler.handleCommitInfo(commitInfo);
}
}
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/mem/MEMStoreAccessor.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/mem/MEMStoreAccessor.java
index e566d90..f33a69f 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/mem/MEMStoreAccessor.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/mem/MEMStoreAccessor.java
@@ -16,7 +16,6 @@ import org.eclipse.emf.cdo.common.CDOQueryInfo;
import org.eclipse.emf.cdo.common.branch.CDOBranch;
import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
import org.eclipse.emf.cdo.common.branch.CDOBranchVersion;
-import org.eclipse.emf.cdo.common.commit.CDOCommitData;
import org.eclipse.emf.cdo.common.commit.CDOCommitInfoHandler;
import org.eclipse.emf.cdo.common.id.CDOID;
import org.eclipse.emf.cdo.common.revision.cache.CDORevisionCacheAdder;
@@ -174,12 +173,6 @@ public class MEMStoreAccessor extends LongIDStoreAccessor
getStore().loadCommitInfos(branch, startTime, endTime, handler);
}
- public CDOCommitData loadCommitData(long timeStamp)
- {
- // TODO: implement MEMStoreAccessor.loadCommitData(timeStamp, dataType)
- throw new UnsupportedOperationException();
- }
-
public InternalCDORevision readRevision(CDOID id, CDOBranchPoint branchPoint, int listChunk,
CDORevisionCacheAdder cache)
{
@@ -277,7 +270,7 @@ public class MEMStoreAccessor extends LongIDStoreAccessor
+ " that was already modified"); //$NON-NLS-1$
}
- InternalCDORevision newRevision = revision.copy();
+ InternalCDORevision newRevision = (InternalCDORevision)revision.copy();
newRevision.adjustForCommit(branch, created);
revisionDelta.apply(newRevision);
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/ISessionProtocol.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/ISessionProtocol.java
index c78010f..d3739c3 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/ISessionProtocol.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/ISessionProtocol.java
@@ -10,12 +10,18 @@
*/
package org.eclipse.emf.cdo.spi.server;
-import org.eclipse.emf.cdo.common.commit.CDOCommitInfo;
+import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
+import org.eclipse.emf.cdo.common.id.CDOID;
+import org.eclipse.emf.cdo.common.id.CDOIDAndVersion;
+import org.eclipse.emf.cdo.common.model.CDOPackageUnit;
import org.eclipse.emf.cdo.common.protocol.CDOAuthenticationResult;
import org.eclipse.emf.cdo.common.protocol.CDOProtocol;
+import org.eclipse.emf.cdo.common.revision.delta.CDORevisionDelta;
import org.eclipse.emf.cdo.session.remote.CDORemoteSessionMessage;
import org.eclipse.emf.cdo.spi.common.branch.InternalCDOBranch;
+import java.util.List;
+
/**
* @author Eike Stepper
* @since 3.0
@@ -26,7 +32,8 @@ public interface ISessionProtocol extends CDOProtocol
public void sendBranchNotification(InternalCDOBranch branch);
- public void sendCommitNotification(CDOCommitInfo commitInfo);
+ public void sendCommitNotification(CDOBranchPoint branchPoint, CDOPackageUnit[] packageUnits,
+ List<CDOIDAndVersion> dirtyIDs, List<CDOID> detachedObjects, List<CDORevisionDelta> newDeltas);
public void sendRemoteSessionNotification(InternalSession sender, byte opcode);
diff --git a/plugins/org.eclipse.emf.cdo.tests.mango/model/mango.genmodel b/plugins/org.eclipse.emf.cdo.tests.mango/model/mango.genmodel
index fd0719a..713e840 100644
--- a/plugins/org.eclipse.emf.cdo.tests.mango/model/mango.genmodel
+++ b/plugins/org.eclipse.emf.cdo.tests.mango/model/mango.genmodel
@@ -15,16 +15,16 @@
<genEnumLiterals ecoreEnumLiteral="mango.ecore#//ParameterPassing/ByValue"/>
<genEnumLiterals ecoreEnumLiteral="mango.ecore#//ParameterPassing/ByReference"/>
</genEnums>
- <genClasses ecoreClass="mango.ecore#//MangoValueList">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute mango.ecore#//MangoValueList/name"/>
- <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference mango.ecore#//MangoValueList/values"/>
+ <genClasses ecoreClass="mango.ecore#//ValueList">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute mango.ecore#//ValueList/name"/>
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference mango.ecore#//ValueList/values"/>
</genClasses>
- <genClasses ecoreClass="mango.ecore#//MangoValue">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute mango.ecore#//MangoValue/name"/>
+ <genClasses ecoreClass="mango.ecore#//Value">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute mango.ecore#//Value/name"/>
</genClasses>
- <genClasses ecoreClass="mango.ecore#//MangoParameter">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute mango.ecore#//MangoParameter/name"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute mango.ecore#//MangoParameter/passing"/>
+ <genClasses ecoreClass="mango.ecore#//Parameter">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute mango.ecore#//Parameter/name"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute mango.ecore#//Parameter/passing"/>
</genClasses>
</genPackages>
</genmodel:GenModel>
diff --git a/plugins/org.eclipse.emf.cdo.tests.mango/model/mango.legacy-genmodel b/plugins/org.eclipse.emf.cdo.tests.mango/model/mango.legacy-genmodel
index fee1a5f..15ed52c 100644
--- a/plugins/org.eclipse.emf.cdo.tests.mango/model/mango.legacy-genmodel
+++ b/plugins/org.eclipse.emf.cdo.tests.mango/model/mango.legacy-genmodel
@@ -14,16 +14,16 @@
<genEnumLiterals ecoreEnumLiteral="mango.ecore#//ParameterPassing/ByValue"/>
<genEnumLiterals ecoreEnumLiteral="mango.ecore#//ParameterPassing/ByReference"/>
</genEnums>
- <genClasses ecoreClass="mango.ecore#//MangoValueList">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute mango.ecore#//MangoValueList/name"/>
- <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference mango.ecore#//MangoValueList/values"/>
+ <genClasses ecoreClass="mango.ecore#//ValueList">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute mango.ecore#//ValueList/name"/>
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference mango.ecore#//ValueList/values"/>
</genClasses>
- <genClasses ecoreClass="mango.ecore#//MangoValue">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute mango.ecore#//MangoValue/name"/>
+ <genClasses ecoreClass="mango.ecore#//Value">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute mango.ecore#//Value/name"/>
</genClasses>
- <genClasses ecoreClass="mango.ecore#//MangoParameter">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute mango.ecore#//MangoParameter/name"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute mango.ecore#//MangoParameter/passing"/>
+ <genClasses ecoreClass="mango.ecore#//Parameter">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute mango.ecore#//Parameter/name"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute mango.ecore#//Parameter/passing"/>
</genClasses>
</genPackages>
</genmodel:GenModel>
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/RevisionHolderTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/RevisionHolderTest.java
index 896cdd0..5a1b9f9 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/RevisionHolderTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/RevisionHolderTest.java
@@ -22,7 +22,6 @@ import org.eclipse.emf.cdo.internal.common.revision.cache.lru.LRURevisionHolder;
import org.eclipse.emf.cdo.internal.common.revision.cache.lru.LRURevisionList;
import org.eclipse.emf.cdo.internal.common.revision.cache.lru.RevisionHolder;
import org.eclipse.emf.cdo.spi.common.branch.CDOBranchUtil;
-import org.eclipse.emf.cdo.spi.common.revision.InternalCDORevision;
import org.eclipse.emf.cdo.spi.common.revision.StubCDORevision;
import org.eclipse.emf.ecore.EClass;
@@ -336,7 +335,7 @@ public class RevisionHolderTest extends AbstractCDOTest
}
@Override
- public InternalCDORevision copy()
+ public CDORevision copy()
{
return new TestRevision(CDOIDUtil.getLong(id), version, branchPoint.getTimeStamp(), revised);
}
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/RevisionManagerTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/RevisionManagerTest.java
index 61493aa..58f029a 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/RevisionManagerTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/RevisionManagerTest.java
@@ -247,7 +247,8 @@ public class RevisionManagerTest extends AbstractCDOTest
{
CDOBranchPoint branchPoint = branch.getPoint(timeStamp);
dumpCache(branchPoint);
- return revisionManager.getRevision(ID, branchPoint, CDORevision.UNCHUNKED, CDORevision.DEPTH_NONE, true);
+ return (InternalCDORevision)revisionManager.getRevision(ID, branchPoint, CDORevision.UNCHUNKED,
+ CDORevision.DEPTH_NONE, true);
}
private void prefetchBaseline(CDOBranch branch, int levelsUp)
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/session/CDOSessionInvalidationEvent.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/session/CDOSessionInvalidationEvent.java
index 20632c3..048911a 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/session/CDOSessionInvalidationEvent.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/session/CDOSessionInvalidationEvent.java
@@ -12,13 +12,20 @@
package org.eclipse.emf.cdo.session;
import org.eclipse.emf.cdo.CDOInvalidationNotification;
-import org.eclipse.emf.cdo.common.commit.CDOCommitInfo;
+import org.eclipse.emf.cdo.common.branch.CDOBranch;
+import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
+import org.eclipse.emf.cdo.common.id.CDOID;
+import org.eclipse.emf.cdo.common.id.CDOIDAndVersion;
+import org.eclipse.emf.cdo.common.model.CDOPackageUnit;
import org.eclipse.emf.cdo.common.revision.CDORevision;
import org.eclipse.emf.cdo.view.CDOAdapterPolicy;
import org.eclipse.emf.cdo.view.CDOView;
import org.eclipse.net4j.util.event.IListener;
+import java.util.Collection;
+import java.util.Set;
+
/**
* An event that is emitted to registered {@link IListener listeners} of a {@link CDOSession} if
* {@link CDOSession.Options#setPassiveUpdateEnabled(boolean) passive update} is enabled for the session.
@@ -29,7 +36,7 @@ import org.eclipse.net4j.util.event.IListener;
* @noimplement This interface is not intended to be implemented by clients.
* @since 2.0
*/
-public interface CDOSessionInvalidationEvent extends CDOSessionEvent, CDOCommitInfo
+public interface CDOSessionInvalidationEvent extends CDOSessionEvent, CDOBranchPoint
{
public static final long LOCAL_ROLLBACK = CDORevision.UNSPECIFIED_DATE;
@@ -43,4 +50,33 @@ public interface CDOSessionInvalidationEvent extends CDOSessionEvent, CDOCommitI
* @since 3.0
*/
public boolean isRemote();
+
+ /**
+ * Returns the branch of the server transaction if this event was sent as a result of a successfully committed
+ * transaction.
+ *
+ * @since 3.0
+ */
+ public CDOBranch getBranch();
+
+ /**
+ * Returns the time stamp of the server transaction if this event was sent as a result of a successfully committed
+ * transaction or <code>LOCAL_ROLLBACK</code> if this event was sent due to a local rollback.
+ */
+ public long getTimeStamp();
+
+ /**
+ * Returns a set of the {@link CDOID CDOIDs} and versions of the modified objects.
+ */
+ public Set<CDOIDAndVersion> getDirtyOIDs();
+
+ /**
+ * Returns a collection of the {@link CDOID CDOIDs} of the removed objects.
+ */
+ public Collection<CDOID> getDetachedObjects();
+
+ /**
+ * Returns a collection of the new {@link CDOPackageUnit package units}.
+ */
+ public Collection<CDOPackageUnit> getNewPackageUnits();
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/view/CDOStaleReferencePolicy.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/view/CDOStaleReferencePolicy.java
index fa6e43b..b8b57e6 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/view/CDOStaleReferencePolicy.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/view/CDOStaleReferencePolicy.java
@@ -47,7 +47,7 @@ public interface CDOStaleReferencePolicy
@Override
public String toString()
{
- return Messages.getString("CDOStaleReferencePolicy.0"); //$NON-NLS-1$
+ return Messages.getString("CDOStaleReferencePolicy.0");
}
};
@@ -66,12 +66,12 @@ public interface CDOStaleReferencePolicy
{
public Object invoke(Object arg0, Method arg1, Object[] arg2) throws Throwable
{
- if (arg1.getName().equals("eIsProxy")) //$NON-NLS-1$
+ if (arg1.getName().equals("eIsProxy"))
{
return false;
}
- if (arg1.getName().equals("eClass")) //$NON-NLS-1$
+ if (arg1.getName().equals("eClass"))
{
return type;
}
@@ -99,7 +99,7 @@ public interface CDOStaleReferencePolicy
@Override
public String toString()
{
- return Messages.getString("CDOStaleReferencePolicy.1"); //$NON-NLS-1$
+ return Messages.getString("CDOStaleReferencePolicy.1");
}
};
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectMerger.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectMerger.java
index ec91574..7b5d38f 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectMerger.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectMerger.java
@@ -32,7 +32,7 @@ public class CDOObjectMerger extends CDORevisionMerger
*/
public void merge(InternalCDOObject object, CDORevisionDelta delta)
{
- InternalCDORevision revision = object.cdoRevision().copy();
+ InternalCDORevision revision = (InternalCDORevision)object.cdoRevision().copy();
object.cdoInternalSetRevision(revision);
// NEW object should stay that state.
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStateMachine.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStateMachine.java
index fbc7b86..7da88ba 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStateMachine.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStateMachine.java
@@ -872,7 +872,7 @@ public final class CDOStateMachine extends FiniteStateMachine<CDOState, CDOEvent
InternalCDOTransaction transaction = view.toTransaction();
// Copy revision
- InternalCDORevision revision = object.cdoRevision().copy();
+ InternalCDORevision revision = (InternalCDORevision)object.cdoRevision().copy();
object.cdoInternalSetRevision(revision);
transaction.registerDirty(object, (CDOFeatureDelta)featureDelta);
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionImpl.java
index 676de8e..413d7a9 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionImpl.java
@@ -19,17 +19,13 @@ import org.eclipse.emf.cdo.CDOObject;
import org.eclipse.emf.cdo.common.branch.CDOBranch;
import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
import org.eclipse.emf.cdo.common.branch.CDOBranchVersion;
-import org.eclipse.emf.cdo.common.commit.CDOCommitData;
-import org.eclipse.emf.cdo.common.commit.CDOCommitInfo;
import org.eclipse.emf.cdo.common.commit.CDOCommitInfoHandler;
-import org.eclipse.emf.cdo.common.commit.CDOCommitInfoManager;
import org.eclipse.emf.cdo.common.id.CDOID;
import org.eclipse.emf.cdo.common.id.CDOIDAndVersion;
import org.eclipse.emf.cdo.common.id.CDOIDUtil;
import org.eclipse.emf.cdo.common.model.CDOPackageUnit;
import org.eclipse.emf.cdo.common.protocol.CDOAuthenticator;
import org.eclipse.emf.cdo.common.revision.CDORevision;
-import org.eclipse.emf.cdo.common.revision.CDORevisionKey;
import org.eclipse.emf.cdo.common.revision.delta.CDORevisionDelta;
import org.eclipse.emf.cdo.common.util.CDOException;
import org.eclipse.emf.cdo.session.CDOCollectionLoadingPolicy;
@@ -40,8 +36,6 @@ import org.eclipse.emf.cdo.session.remote.CDORemoteSession;
import org.eclipse.emf.cdo.session.remote.CDORemoteSessionMessage;
import org.eclipse.emf.cdo.spi.common.CDOCloningContext;
import org.eclipse.emf.cdo.spi.common.branch.InternalCDOBranch;
-import org.eclipse.emf.cdo.spi.common.model.InternalCDOPackageRegistry;
-import org.eclipse.emf.cdo.spi.common.model.InternalCDOPackageUnit;
import org.eclipse.emf.cdo.spi.common.revision.InternalCDORevision;
import org.eclipse.emf.cdo.spi.common.revision.InternalCDORevisionManager;
import org.eclipse.emf.cdo.spi.common.revision.RevisionInfo;
@@ -518,11 +512,7 @@ public abstract class CDOSessionImpl extends Container<CDOView> implements Inter
{
synchronized (lastUpdateTimeLock)
{
- if (this.lastUpdateTime < lastUpdateTime)
- {
- this.lastUpdateTime = lastUpdateTime;
- }
-
+ this.lastUpdateTime = lastUpdateTime;
lastUpdateTimeLock.notifyAll();
}
}
@@ -571,6 +561,15 @@ public abstract class CDOSessionImpl extends Container<CDOView> implements Inter
return policy.resolveProxy(this, revision, feature, accessIndex, serverIndex);
}
+ /**
+ * @since 2.0
+ */
+ public void handleSyncResponse(CDOBranchPoint branchPoint, Collection<CDOPackageUnit> newPackageUnits,
+ Set<CDOIDAndVersion> dirtyOIDs, Collection<CDOID> detachedObjects)
+ {
+ handleCommitNotification(branchPoint, newPackageUnits, dirtyOIDs, detachedObjects, null, null, true, false);
+ }
+
public void handleBranchNotification(InternalCDOBranch branch)
{
getBranchManager().handleBranchCreated(branch);
@@ -579,17 +578,18 @@ public abstract class CDOSessionImpl extends Container<CDOView> implements Inter
/**
* @since 2.0
*/
- public void handleSyncResponse(CDOBranchPoint branchPoint, Collection<CDOPackageUnit> newPackageUnits,
- Set<CDOIDAndVersion> dirtyOIDs, Collection<CDOID> detachedObjects)
+ public void handleCommitNotification(CDOBranchPoint branchPoint, Collection<CDOPackageUnit> newPackageUnits,
+ Set<CDOIDAndVersion> dirtyOIDs, Collection<CDOID> detachedObjects, Collection<CDORevisionDelta> deltas,
+ InternalCDOView excludedView)
{
- handleCommitNotification___OLD(branchPoint, newPackageUnits, dirtyOIDs, detachedObjects, null, null, true, false);
+ handleCommitNotification(branchPoint, newPackageUnits, dirtyOIDs, detachedObjects, deltas, excludedView, options()
+ .isPassiveUpdateEnabled(), true);
}
- @Deprecated
- private void handleCommitNotification___OLD(CDOBranchPoint branchPoint,
- final Collection<CDOPackageUnit> newPackageUnits, Set<CDOIDAndVersion> dirtyOIDs,
- final Collection<CDOID> detachedObjects, final Collection<CDORevisionDelta> deltas, InternalCDOView excludedView,
- final boolean reviseAndInvalidate, final boolean async)
+ private void handleCommitNotification(CDOBranchPoint branchPoint, final Collection<CDOPackageUnit> newPackageUnits,
+ Set<CDOIDAndVersion> dirtyOIDs, final Collection<CDOID> detachedObjects,
+ final Collection<CDORevisionDelta> deltas, InternalCDOView excludedView, final boolean reviseAndInvalidate,
+ final boolean async)
{
final CDOBranch branch = branchPoint.getBranch();
final long timeStamp = branchPoint.getTimeStamp();
@@ -700,12 +700,10 @@ public abstract class CDOSessionImpl extends Container<CDOView> implements Inter
}
setLastUpdateTime(timeStamp);
- throw new UnsupportedOperationException();
- // fireInvalidationEvent(branchPoint, newPackageUnits, dirtyOIDs, detachedObjects, excludedView);
+ fireInvalidationEvent(branchPoint, newPackageUnits, dirtyOIDs, detachedObjects, excludedView);
}
- @Deprecated
- private void reviseRevisions(CDOBranchPoint branchPoint, Set<CDOIDAndVersion> dirtyOIDs,
+ public void reviseRevisions(CDOBranchPoint branchPoint, Set<CDOIDAndVersion> dirtyOIDs,
Collection<CDOID> detachedObjects, InternalCDOView excludedView)
{
InternalCDORevisionManager revisionManager = getRevisionManager();
@@ -728,123 +726,6 @@ public abstract class CDOSessionImpl extends Container<CDOView> implements Inter
}
}
- /**
- * @since 2.0
- */
- public void handleCommitNotification(CDOCommitInfo commitInfo)
- {
- try
- {
- synchronized (invalidationLock)
- {
- registerPackageUnits(commitInfo);
- reviseRevisions(commitInfo);
- invalidate(commitInfo, null);
- }
- }
- catch (RuntimeException ex)
- {
- if (isActive())
- {
- OM.LOG.error(ex);
- }
- else
- {
- OM.LOG.info(Messages.getString("CDOSessionImpl.2")); //$NON-NLS-1$
- }
- }
- }
-
- private void registerPackageUnits(final CDOCommitInfo commitInfo)
- {
- InternalCDOPackageRegistry packageRegistry = getPackageRegistry();
- for (CDOPackageUnit newPackageUnit : commitInfo.getNewPackageUnits())
- {
- packageRegistry.putPackageUnit((InternalCDOPackageUnit)newPackageUnit);
- }
- }
-
- private void reviseRevisions(CDOCommitInfo commitInfo)
- {
- CDOBranch newBranch = commitInfo.getBranch();
- long timeStamp = commitInfo.getTimeStamp();
- InternalCDORevisionManager revisionManager = getRevisionManager();
-
- // Cache new revisions
- for (CDOIDAndVersion key : commitInfo.getNewObjects())
- {
- if (key instanceof InternalCDORevision)
- {
- InternalCDORevision newRevision = (InternalCDORevision)key;
- revisionManager.addRevision(newRevision);
- }
- }
-
- // Apply deltas and cache the resulting new revisions, if possible...
- for (CDORevisionKey key : commitInfo.getChangedObjects())
- {
- InternalCDORevision newRevision = createNewRevision(key, commitInfo);
- if (newRevision != null)
- {
- revisionManager.addRevision(newRevision);
- }
- else
- {
- // ... Otherwise try to revise old revision if it is in the same branch
- if (key.getBranch() == newBranch)
- {
- revisionManager.reviseVersion(key.getID(), key, timeStamp);
- }
- }
- }
-
- // Revise old revisions
- for (CDOIDAndVersion key : commitInfo.getDetachedObjects())
- {
- CDOBranchVersion branchVersion = newBranch.getVersion(key.getVersion());
- revisionManager.reviseVersion(key.getID(), branchVersion, timeStamp);
- }
- }
-
- private InternalCDORevision createNewRevision(CDORevisionKey potentialDelta, CDOCommitInfo commitInfo)
- {
- if (potentialDelta instanceof CDORevisionDelta)
- {
- CDORevisionDelta delta = (CDORevisionDelta)potentialDelta;
- CDOID id = delta.getID();
-
- InternalCDORevisionManager revisionManager = getRevisionManager();
- InternalCDORevision oldRevision = revisionManager.getRevisionByVersion(id, potentialDelta, CDORevision.UNCHUNKED, false);
- if (oldRevision != null)
- {
- InternalCDORevision newRevision = oldRevision.copy();
- newRevision.adjustForCommit(commitInfo.getBranch(), commitInfo.getTimeStamp());
- delta.apply(newRevision);
- return newRevision;
- }
- }
-
- return null;
- }
-
- /**
- * @since 2.0
- */
- public void invalidate(final CDOCommitInfo commitInfo, final InternalCDOTransaction sender)
- {
- for (InternalCDOView view : getViews())
- {
- if (view != sender && view.getBranch() == commitInfo.getBranch())
- {
- QueueRunner runner = getInvalidationRunner();
- runner.addWork(new InvalidationRunnable(view, commitInfo));
- }
- }
-
- setLastUpdateTime(commitInfo.getTimeStamp());
- fireInvalidationEvent(sender, commitInfo);
- }
-
public void cloneRepository(CDOCloningContext context)
{
getSessionProtocol().cloneRepository(context);
@@ -888,11 +769,13 @@ public abstract class CDOSessionImpl extends Container<CDOView> implements Inter
}
/**
+ * @param packageUnits
* @since 2.0
*/
- public void fireInvalidationEvent(InternalCDOView excludedView, CDOCommitInfo commitInfo)
+ public void fireInvalidationEvent(CDOBranchPoint branchPoint, Collection<CDOPackageUnit> packageUnits,
+ Set<CDOIDAndVersion> dirtyOIDs, Collection<CDOID> detachedObjects, InternalCDOView excludedView)
{
- fireEvent(new InvalidationEvent(excludedView, commitInfo));
+ fireEvent(new InvalidationEvent(excludedView, branchPoint, packageUnits, dirtyOIDs, detachedObjects));
}
@Override
@@ -1161,59 +1044,29 @@ public abstract class CDOSessionImpl extends Container<CDOView> implements Inter
/**
* @author Eike Stepper
*/
- private static final class InvalidationRunnable implements Runnable
- {
- private InternalCDOView view;
-
- private CDOCommitInfo commitInfo;
-
- private InvalidationRunnable(InternalCDOView view, CDOCommitInfo commitInfo)
- {
- this.view = view;
- this.commitInfo = commitInfo;
- }
-
- public void run()
- {
- try
- {
- invalidationRunnerActive.set(true);
- view.invalidate(commitInfo);
- }
- catch (RuntimeException ex)
- {
- if (view.isActive())
- {
- OM.LOG.error(ex);
- }
- else
- {
- OM.LOG.info(Messages.getString("CDOSessionImpl.1")); //$NON-NLS-1$
- }
- }
- finally
- {
- invalidationRunnerActive.set(false);
- }
- }
- }
-
- /**
- * @author Eike Stepper
- */
private final class InvalidationEvent extends Event implements CDOSessionInvalidationEvent
{
private static final long serialVersionUID = 1L;
private InternalCDOView view;
- private CDOCommitInfo commitInfo;
+ private CDOBranchPoint branchPoint;
+
+ private Set<CDOIDAndVersion> dirtyOIDs;
- public InvalidationEvent(InternalCDOView view, CDOCommitInfo commitInfo)
+ private Collection<CDOID> detachedObjects;
+
+ private Collection<CDOPackageUnit> newPackageUnits;
+
+ public InvalidationEvent(InternalCDOView view, CDOBranchPoint branchPoint,
+ Collection<CDOPackageUnit> newPackageUnits, Set<CDOIDAndVersion> dirtyOIDs, Collection<CDOID> detachedObjects)
{
super(CDOSessionImpl.this);
this.view = view;
- this.commitInfo = commitInfo;
+ this.branchPoint = branchPoint;
+ this.newPackageUnits = newPackageUnits;
+ this.dirtyOIDs = dirtyOIDs;
+ this.detachedObjects = detachedObjects;
}
@Override
@@ -1234,58 +1087,38 @@ public abstract class CDOSessionImpl extends Container<CDOView> implements Inter
public CDOBranch getBranch()
{
- return commitInfo.getBranch();
- }
-
- public CDOCommitInfoManager getCommitInfoManager()
- {
- return commitInfo.getCommitInfoManager();
+ return branchPoint.getBranch();
}
public long getTimeStamp()
{
- return commitInfo.getTimeStamp();
- }
-
- public Collection<CDOPackageUnit> getNewPackageUnits()
- {
- return commitInfo.getNewPackageUnits();
+ return branchPoint.getTimeStamp();
}
- public String getUserID()
+ public Set<CDOIDAndVersion> getDirtyOIDs()
{
- return commitInfo.getUserID();
+ return dirtyOIDs;
}
- public String getComment()
+ public Collection<CDOID> getDetachedObjects()
{
- return commitInfo.getComment();
+ return detachedObjects;
}
- public Collection<CDOIDAndVersion> getNewObjects()
- {
- return commitInfo.getNewObjects();
- }
-
- public Collection<CDORevisionKey> getChangedObjects()
- {
- return commitInfo.getChangedObjects();
- }
-
- public Collection<CDOIDAndVersion> getDetachedObjects()
+ public Collection<CDOPackageUnit> getNewPackageUnits()
{
- return commitInfo.getDetachedObjects();
+ return newPackageUnits;
}
public int compareTo(CDOBranchPoint o)
{
- return commitInfo.compareTo(o);
+ return branchPoint.compareTo(o);
}
@Override
public String toString()
{
- return "CDOSessionInvalidationEvent[" + commitInfo + "]";
+ return "CDOSessionInvalidationEvent: " + dirtyOIDs;
}
}
@@ -1598,22 +1431,6 @@ public abstract class CDOSessionImpl extends Container<CDOView> implements Inter
}
}
- public CDOCommitData loadCommitData(long timeStamp)
- {
- int attempt = 0;
- for (;;)
- {
- try
- {
- return delegate.loadCommitData(timeStamp);
- }
- catch (Exception ex)
- {
- handleException(++attempt, ex);
- }
- }
- }
-
public Object loadChunk(InternalCDORevision revision, EStructuralFeature feature, int accessIndex, int fetchIndex,
int fromIndex, int toIndex)
{
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOSingleTransactionStrategyImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOSingleTransactionStrategyImpl.java
index feee83a..0b98e3d 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOSingleTransactionStrategyImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOSingleTransactionStrategyImpl.java
@@ -82,7 +82,7 @@ public class CDOSingleTransactionStrategyImpl implements CDOTransactionStrategy
InternalCDOCommitInfoManager commitInfoManager = transaction.getSession().getCommitInfoManager();
return commitInfoManager.createCommitInfo(transaction.getBranch(), result.getTimeStamp(), transaction.getSession()
- .getUserID(), transaction.getCommitComment(), null);
+ .getUserID(), transaction.getCommitComment());
}
public void rollback(InternalCDOTransaction transaction, InternalCDOUserSavepoint savepoint)
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOTransactionImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOTransactionImpl.java
index 2fbeb77..84f6765 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOTransactionImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOTransactionImpl.java
@@ -19,7 +19,6 @@ import org.eclipse.emf.cdo.CDOState;
import org.eclipse.emf.cdo.common.branch.CDOBranch;
import org.eclipse.emf.cdo.common.branch.CDOBranchManager;
import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
-import org.eclipse.emf.cdo.common.commit.CDOCommitData;
import org.eclipse.emf.cdo.common.commit.CDOCommitInfo;
import org.eclipse.emf.cdo.common.id.CDOID;
import org.eclipse.emf.cdo.common.id.CDOIDAndVersion;
@@ -35,7 +34,6 @@ import org.eclipse.emf.cdo.common.model.EMFUtil;
import org.eclipse.emf.cdo.common.revision.CDOListFactory;
import org.eclipse.emf.cdo.common.revision.CDORevision;
import org.eclipse.emf.cdo.common.revision.CDORevisionFactory;
-import org.eclipse.emf.cdo.common.revision.CDORevisionKey;
import org.eclipse.emf.cdo.common.revision.delta.CDOFeatureDelta;
import org.eclipse.emf.cdo.common.revision.delta.CDORevisionDelta;
import org.eclipse.emf.cdo.common.revision.delta.CDORevisionDeltaUtil;
@@ -46,10 +44,8 @@ import org.eclipse.emf.cdo.eresource.CDOResourceNode;
import org.eclipse.emf.cdo.eresource.EresourceFactory;
import org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl;
import org.eclipse.emf.cdo.eresource.impl.CDOResourceNodeImpl;
-import org.eclipse.emf.cdo.internal.common.commit.CDOCommitDataImpl;
import org.eclipse.emf.cdo.internal.common.io.CDODataInputImpl;
import org.eclipse.emf.cdo.internal.common.io.CDODataOutputImpl;
-import org.eclipse.emf.cdo.spi.common.commit.InternalCDOCommitInfoManager;
import org.eclipse.emf.cdo.spi.common.model.InternalCDOPackageUnit;
import org.eclipse.emf.cdo.spi.common.revision.CDOIDMapper;
import org.eclipse.emf.cdo.spi.common.revision.InternalCDORevision;
@@ -1313,13 +1309,11 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa
{
CDODataOutput out = new CDODataOutputImpl(new ExtendedDataOutputStream(stream))
{
- @Override
public CDOIDProvider getIDProvider()
{
return CDOTransactionImpl.this;
}
- @Override
public CDOPackageRegistry getPackageRegistry()
{
return getSession().getPackageRegistry();
@@ -1740,42 +1734,50 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa
{
try
{
- for (CDOPackageUnit newPackageUnit : newPackageUnits)
- {
- ((InternalCDOPackageUnit)newPackageUnit).setState(CDOPackageUnit.State.LOADED);
- }
+ Collection<CDORevisionDelta> deltas = getRevisionDeltas().values();
postCommit(getNewResources(), result);
postCommit(getNewObjects(), result);
postCommit(getDirtyObjects(), result);
-
- List<CDOIDAndVersion> revisions = new ArrayList<CDOIDAndVersion>();
- for (CDOObject newObject : getNewObjects().values())
+ for (Entry<CDOID, CDOObject> entry : getDetachedObjects().entrySet())
{
- revisions.add(newObject.cdoRevision());
+ removeObject(entry.getKey());
}
- for (CDOObject newObject : getNewResources().values())
+ InternalCDOSession session = getSession();
+ for (CDOPackageUnit newPackageUnit : newPackageUnits)
{
- revisions.add(newObject.cdoRevision());
+ ((InternalCDOPackageUnit)newPackageUnit).setState(CDOPackageUnit.State.LOADED);
}
- List<CDORevisionKey> deltas = new ArrayList<CDORevisionKey>();
- for (CDORevisionDelta delta : getRevisionDeltas().values())
+ Map<CDOID, CDOObject> dirtyObjects = getDirtyObjects();
+ Set<CDOIDAndVersion> dirtyIDs = new HashSet<CDOIDAndVersion>();
+ for (CDOObject dirtyObject : dirtyObjects.values())
{
- ((InternalCDORevisionDelta)delta).adjustReferences(result.getReferenceAdjuster());
- deltas.add(delta);
+ CDORevision revision = dirtyObject.cdoRevision();
+ CDOIDAndVersion dirtyID = CDOIDUtil.createIDAndVersion(revision.getID(), revision.getVersion() - 1);
+ dirtyIDs.add(dirtyID);
}
- List<CDOIDAndVersion> detached = new ArrayList<CDOIDAndVersion>();
- for (Entry<CDOID, CDOObject> entry : getDetachedObjects().entrySet())
+ if (!dirtyIDs.isEmpty() || !getDetachedObjects().isEmpty())
{
- detached.add(entry.getValue().cdoRevision());
- removeObject(entry.getKey());
- }
+ Set<CDOID> detachedIDs = new HashSet<CDOID>(getDetachedObjects().keySet());
+ Collection<CDORevisionDelta> deltasCopy = new ArrayList<CDORevisionDelta>(deltas);
- CDOCommitInfo commitInfo = makeCommitInfo(result.getTimeStamp(), revisions, deltas, detached);
- getSession().invalidate(commitInfo, getTransaction());
+ // Adjust references in the deltas. Could be used in
+ // ChangeSubscription from others CDOView
+ for (CDORevisionDelta dirtyObjectDelta : deltasCopy)
+ {
+ ((InternalCDORevisionDelta)dirtyObjectDelta).adjustReferences(result.getReferenceAdjuster());
+ }
+
+ session.handleCommitNotification(getBranch().getPoint(result.getTimeStamp()), newPackageUnits, dirtyIDs,
+ detachedIDs, deltasCopy, getTransaction());
+ }
+ else
+ {
+ session.setLastUpdateTime(result.getTimeStamp());
+ }
CDOTransactionHandler[] handlers = getTransactionHandlers();
if (handlers != null)
@@ -1817,20 +1819,6 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa
}
}
- private CDOCommitInfo makeCommitInfo(long timeStamp, List<CDOIDAndVersion> newRevisions,
- List<CDORevisionKey> deltas, List<CDOIDAndVersion> detachedIDsAndVersions)
- {
- InternalCDOSession session = getSession();
- InternalCDOCommitInfoManager commitInfoManager = session.getCommitInfoManager();
-
- CDOBranch branch = getBranch();
- String userID = session.getUserID();
- String comment = getCommitComment();
- CDOCommitData commitData = new CDOCommitDataImpl(newPackageUnits, newRevisions, deltas, detachedIDsAndVersions);
-
- return commitInfoManager.createCommitInfo(branch, timeStamp, userID, comment, commitData);
- }
-
@SuppressWarnings("rawtypes")
private void preCommit(Map objects)
{
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java
index 815c9d9..90752f8 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java
@@ -17,7 +17,6 @@ import org.eclipse.emf.cdo.CDOObject;
import org.eclipse.emf.cdo.CDOState;
import org.eclipse.emf.cdo.common.branch.CDOBranch;
import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
-import org.eclipse.emf.cdo.common.commit.CDOCommitInfo;
import org.eclipse.emf.cdo.common.id.CDOID;
import org.eclipse.emf.cdo.common.id.CDOIDAndVersion;
import org.eclipse.emf.cdo.common.id.CDOIDMeta;
@@ -1278,33 +1277,6 @@ public class CDOViewImpl extends Lifecycle implements InternalCDOView
}
}
- public void invalidate(CDOCommitInfo commitInfo)
- {
- Set<CDOObject> conflicts = null;
-
- boolean reviseAndInvalidate = session.options().isPassiveUpdateEnabled();
- if (reviseAndInvalidate)
- {
- conflicts = handleInvalidation(timeStamp, finalDirtyOIDs, finalDetachedObjects, true);
- }
-
- boolean skipChangeSubscription = (deltas == null || deltas.size() <= 0)
- && (detachedObjects == null || detachedObjects.size() <= 0);
-
- if (!skipChangeSubscription)
- {
- handleChangeSubscription(deltas, detachedObjects, true);
- }
-
- if (conflicts != null)
- {
- InternalCDOTransaction transaction = (InternalCDOTransaction)this;
- transaction.handleConflicts(conflicts);
- }
-
- fireAdaptersNotifiedEvent(commitInfo.getTimeStamp());
- }
-
/**
* Turns registered objects into proxies and synchronously delivers invalidation events to registered event listeners.
* <p>
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/InternalCDOSession.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/InternalCDOSession.java
index c945cfb..4e904e4 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/InternalCDOSession.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/InternalCDOSession.java
@@ -11,11 +11,11 @@
package org.eclipse.emf.spi.cdo;
import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
-import org.eclipse.emf.cdo.common.commit.CDOCommitInfo;
import org.eclipse.emf.cdo.common.id.CDOID;
import org.eclipse.emf.cdo.common.id.CDOIDAndVersion;
import org.eclipse.emf.cdo.common.model.CDOPackageUnit;
import org.eclipse.emf.cdo.common.revision.CDORevision;
+import org.eclipse.emf.cdo.common.revision.delta.CDORevisionDelta;
import org.eclipse.emf.cdo.session.CDORepositoryInfo;
import org.eclipse.emf.cdo.session.CDOSession;
import org.eclipse.emf.cdo.spi.common.CDOCloningContext;
@@ -125,18 +125,23 @@ public interface InternalCDOSession extends CDOSession, PackageProcessor, Packag
/**
* @since 3.0
*/
- public void handleCommitNotification(CDOCommitInfo commitInfo);
+ public void handleCommitNotification(CDOBranchPoint branchPoint, Collection<CDOPackageUnit> newPackageUnits,
+ Set<CDOIDAndVersion> dirtyOIDandVersions, Collection<CDOID> detachedOIDs, Collection<CDORevisionDelta> deltas,
+ InternalCDOView excludedView);
/**
* @since 3.0
*/
- public void invalidate(CDOCommitInfo commitInfo, InternalCDOTransaction sender);
+ public void handleSyncResponse(CDOBranchPoint branchPoint, Collection<CDOPackageUnit> newPackageUnits,
+ Set<CDOIDAndVersion> dirtyOIDandVersions, Collection<CDOID> detachedOIDs);
/**
+ * In some cases we need to sync without propagating event. Lock is a good example.
+ *
* @since 3.0
*/
- public void handleSyncResponse(CDOBranchPoint branchPoint, Collection<CDOPackageUnit> newPackageUnits,
- Set<CDOIDAndVersion> dirtyOIDandVersions, Collection<CDOID> detachedOIDs);
+ public void reviseRevisions(CDOBranchPoint branchPoint, Set<CDOIDAndVersion> dirtyOIDandVersions,
+ Collection<CDOID> detachedOIDs, InternalCDOView excludedView);
/**
* @since 3.0
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/InternalCDOView.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/InternalCDOView.java
index ea427a1..ef151ce 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/InternalCDOView.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/InternalCDOView.java
@@ -12,7 +12,6 @@ package org.eclipse.emf.spi.cdo;
import org.eclipse.emf.cdo.CDOObject;
import org.eclipse.emf.cdo.CDOState;
-import org.eclipse.emf.cdo.common.commit.CDOCommitInfo;
import org.eclipse.emf.cdo.common.id.CDOID;
import org.eclipse.emf.cdo.common.id.CDOIDAndVersion;
import org.eclipse.emf.cdo.common.id.CDOIDProvider;
@@ -66,8 +65,6 @@ public interface InternalCDOView extends CDOView, CDOIDProvider, ILifecycle
*/
public void handleObjectStateChanged(InternalCDOObject object, CDOState oldState, CDOState newState);
- public void invalidate(CDOCommitInfo commitInfo);
-
/**
* Returns the conflicting objects.
*