Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaspar De Groot2010-11-15 03:35:31 +0000
committerCaspar De Groot2010-11-15 03:35:31 +0000
commitfdc39bcef6faa0c8591b7f652fc5e6f311e68878 (patch)
treeba769925a5d0f9f8d3d670243d63a17db473f523 /plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/LockObjectsRequest.java
parentd838c1011858929372a8f75610681d23ca0d5d1a (diff)
downloadcdo-fdc39bcef6faa0c8591b7f652fc5e6f311e68878.tar.gz
cdo-fdc39bcef6faa0c8591b7f652fc5e6f311e68878.tar.xz
cdo-fdc39bcef6faa0c8591b7f652fc5e6f311e68878.zip
[328681] LockObjectsRequest can cause corruption of client-side graph
https://bugs.eclipse.org/bugs/show_bug.cgi?id=328681
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/LockObjectsRequest.java')
-rw-r--r--plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/LockObjectsRequest.java39
1 files changed, 30 insertions, 9 deletions
diff --git a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/LockObjectsRequest.java b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/LockObjectsRequest.java
index e22b164419..b7f12fb9a3 100644
--- a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/LockObjectsRequest.java
+++ b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/LockObjectsRequest.java
@@ -11,21 +11,22 @@
package org.eclipse.emf.cdo.internal.net4j.protocol;
import org.eclipse.emf.cdo.common.branch.CDOBranch;
-import org.eclipse.emf.cdo.common.id.CDOID;
+import org.eclipse.emf.cdo.common.protocol.CDODataInput;
import org.eclipse.emf.cdo.common.protocol.CDODataOutput;
import org.eclipse.emf.cdo.common.protocol.CDOProtocolConstants;
import org.eclipse.emf.cdo.common.revision.CDORevision;
import org.eclipse.emf.cdo.spi.common.revision.InternalCDORevision;
import org.eclipse.net4j.util.concurrent.IRWLockManager;
+import org.eclipse.net4j.util.concurrent.IRWLockManager.LockType;
import java.io.IOException;
-import java.util.Map;
+import java.util.List;
/**
* @author Eike Stepper
*/
-public class LockObjectsRequest extends RefreshSessionRequest
+public class LockObjectsRequest extends CDOClientRequest<Boolean>
{
private int viewID;
@@ -33,23 +34,43 @@ public class LockObjectsRequest extends RefreshSessionRequest
private long timeout;
- public LockObjectsRequest(CDOClientProtocol protocol, long lastUpdateTime,
- Map<CDOBranch, Map<CDOID, InternalCDORevision>> viewedRevisions, int viewID, IRWLockManager.LockType lockType,
- long timeout)
+ private List<InternalCDORevision> viewedRevisions;
+
+ /**
+ * The branch being viewed
+ */
+ private CDOBranch viewedBranch;
+
+ public LockObjectsRequest(CDOClientProtocol protocol, List<InternalCDORevision> viewedRevisions, int viewID,
+ CDOBranch viewedBranch, LockType lockType, long timeout)
{
- super(protocol, CDOProtocolConstants.SIGNAL_LOCK_OBJECTS, lastUpdateTime, viewedRevisions, CDORevision.UNCHUNKED,
- false);
+ super(protocol, CDOProtocolConstants.SIGNAL_LOCK_OBJECTS);
+
this.viewID = viewID;
this.lockType = lockType;
this.timeout = timeout;
+ this.viewedRevisions = viewedRevisions;
+ this.viewedBranch = viewedBranch;
}
@Override
protected void requesting(CDODataOutput out) throws IOException
{
- super.requesting(out);
out.writeInt(viewID);
out.writeCDOLockType(lockType);
out.writeLong(timeout);
+ out.writeCDOBranch(viewedBranch);
+
+ out.writeInt(viewedRevisions.size());
+ for (CDORevision revision : viewedRevisions)
+ {
+ out.writeCDORevisionKey(revision);
+ }
+ }
+
+ @Override
+ protected Boolean confirming(CDODataInput in) throws IOException
+ {
+ return in.readBoolean();
}
}

Back to the top