diff options
author | Simon McDuff | 2009-03-15 19:25:30 +0000 |
---|---|---|
committer | Simon McDuff | 2009-03-15 19:25:30 +0000 |
commit | ee2df05eaa039a5fe7fb48595584d08e67e2f053 (patch) | |
tree | cc5afb0d390d6047a7abddfd879bd9a1fa4296af /plugins/org.eclipse.emf.cdo/src/org | |
parent | 0af638ae56f57d5e387acd9e994d08a65619fcca (diff) | |
download | cdo-ee2df05eaa039a5fe7fb48595584d08e67e2f053.tar.gz cdo-ee2df05eaa039a5fe7fb48595584d08e67e2f053.tar.xz cdo-ee2df05eaa039a5fe7fb48595584d08e67e2f053.zip |
[267050] Add new packages infos in the Notifications process at the client side
https://bugs.eclipse.org/bugs/show_bug.cgi?id=267050
Diffstat (limited to 'plugins/org.eclipse.emf.cdo/src/org')
6 files changed, 47 insertions, 21 deletions
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 34dabae819..c49029c18c 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 @@ -14,6 +14,7 @@ package org.eclipse.emf.cdo.session; import org.eclipse.emf.cdo.CDOInvalidationNotification; 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; @@ -58,4 +59,10 @@ public interface CDOSessionInvalidationEvent extends CDOSessionEvent * 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/internal/cdo/net4j/protocol/CommitNotificationIndication.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CommitNotificationIndication.java index 1d503bb412..a47030a1e3 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CommitNotificationIndication.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CommitNotificationIndication.java @@ -28,6 +28,7 @@ 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; @@ -104,6 +105,6 @@ public class CommitNotificationIndication extends CDOClientIndication detachedObjects.add(in.readCDOID()); } - session.handleCommitNotification(timeStamp, dirtyOIDs, detachedObjects, deltas, null); + session.handleCommitNotification(timeStamp, Arrays.asList(packageUnits), dirtyOIDs, detachedObjects, deltas, null); } } diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/SyncRevisionsRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/SyncRevisionsRequest.java index 065eda635a..314dfb6e9b 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/SyncRevisionsRequest.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/SyncRevisionsRequest.java @@ -16,6 +16,7 @@ import org.eclipse.emf.cdo.common.id.CDOIDAndVersion; import org.eclipse.emf.cdo.common.id.CDOIDUtil; import org.eclipse.emf.cdo.common.io.CDODataInput; import org.eclipse.emf.cdo.common.io.CDODataOutput; +import org.eclipse.emf.cdo.common.model.CDOPackageUnit; 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; @@ -113,7 +114,8 @@ public class SyncRevisionsRequest extends CDOClientRequest<Collection<CDOTimeSta Collection<CDOID> detachedObjects = getMap(mapofContext, revised).getDetachedObjects(); detachedObjects.add(id); } - + + Collection<CDOPackageUnit> emptyNewPackageUnits = Collections.emptyList(); for (CDOTimeStampContext timestampContext : mapofContext.values()) { Set<CDOIDAndVersion> dirtyObjects = timestampContext.getDirtyObjects(); @@ -125,7 +127,7 @@ public class SyncRevisionsRequest extends CDOClientRequest<Collection<CDOTimeSta ((CDOTimeStampContextImpl)timestampContext).setDirtyObjects(dirtyObjects); ((CDOTimeStampContextImpl)timestampContext).setDetachedObjects(detachedObjects); - getSession().handleSyncResponse(timestampContext.getTimeStamp(), dirtyObjects, detachedObjects); + getSession().handleSyncResponse(timestampContext.getTimeStamp(), emptyNewPackageUnits, dirtyObjects, detachedObjects); } return Collections.unmodifiableCollection(mapofContext.values()); 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 9a8838b44b..5ee1eb8b70 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 @@ -385,24 +385,27 @@ public abstract class CDOSessionImpl extends Container<CDOView> implements Inter /** * @since 2.0 */ - public void handleSyncResponse(long timestamp, Set<CDOIDAndVersion> dirtyOIDs, Collection<CDOID> detachedObjects) + public void handleSyncResponse(long timestamp, Collection<CDOPackageUnit> newPackageUnits, + Set<CDOIDAndVersion> dirtyOIDs, Collection<CDOID> detachedObjects) { - handleCommitNotification(timestamp, dirtyOIDs, detachedObjects, null, null, true, false); + handleCommitNotification(timestamp, newPackageUnits, dirtyOIDs, detachedObjects, null, null, true, false); } /** * @since 2.0 */ - public void handleCommitNotification(final long timeStamp, Set<CDOIDAndVersion> dirtyOIDs, - final Collection<CDOID> detachedObjects, final Collection<CDORevisionDelta> deltas, InternalCDOView excludedView) + public void handleCommitNotification(final long timeStamp, final Collection<CDOPackageUnit> newPackageUnits, + Set<CDOIDAndVersion> dirtyOIDs, final Collection<CDOID> detachedObjects, + final Collection<CDORevisionDelta> deltas, InternalCDOView excludedView) { - handleCommitNotification(timeStamp, dirtyOIDs, detachedObjects, deltas, excludedView, options() + handleCommitNotification(timeStamp, newPackageUnits, dirtyOIDs, detachedObjects, deltas, excludedView, options() .isPassiveUpdateEnabled(), true); } - private void handleCommitNotification(final long timeStamp, Set<CDOIDAndVersion> dirtyOIDs, - final Collection<CDOID> detachedObjects, final Collection<CDORevisionDelta> deltas, InternalCDOView excludedView, - final boolean passiveUpdate, boolean async) + private void handleCommitNotification(final long timeStamp, final Collection<CDOPackageUnit> newPackageUnits, + Set<CDOIDAndVersion> dirtyOIDs, final Collection<CDOID> detachedObjects, + final Collection<CDORevisionDelta> deltas, InternalCDOView excludedView, final boolean passiveUpdate, + boolean async) { if (passiveUpdate) { @@ -459,7 +462,7 @@ public abstract class CDOSessionImpl extends Container<CDOView> implements Inter } } - fireInvalidationEvent(timeStamp, dirtyOIDs, detachedObjects, excludedView); + fireInvalidationEvent(timeStamp, newPackageUnits, dirtyOIDs, detachedObjects, excludedView); } private void updateRevisionForRemoteChanges(final long timeStamp, Set<CDOIDAndVersion> dirtyOIDs, @@ -514,12 +517,13 @@ public abstract class CDOSessionImpl extends Container<CDOView> implements Inter } /** + * @param packageUnits * @since 2.0 */ - public void fireInvalidationEvent(long timeStamp, Set<CDOIDAndVersion> dirtyOIDs, Collection<CDOID> detachedObjects, - InternalCDOView excludedView) + public void fireInvalidationEvent(long timeStamp, Collection<CDOPackageUnit> packageUnits, + Set<CDOIDAndVersion> dirtyOIDs, Collection<CDOID> detachedObjects, InternalCDOView excludedView) { - fireEvent(new InvalidationEvent(excludedView, timeStamp, dirtyOIDs, detachedObjects)); + fireEvent(new InvalidationEvent(excludedView, timeStamp, packageUnits, dirtyOIDs, detachedObjects)); } @Override @@ -1090,12 +1094,15 @@ public abstract class CDOSessionImpl extends Container<CDOView> implements Inter private Collection<CDOID> detachedObjects; - public InvalidationEvent(InternalCDOView view, long timeStamp, Set<CDOIDAndVersion> dirtyOIDs, - Collection<CDOID> detachedObjects) + private Collection<CDOPackageUnit> newPackageUnits; + + public InvalidationEvent(InternalCDOView view, long timeStamp, Collection<CDOPackageUnit> packageUnits, + Set<CDOIDAndVersion> dirtyOIDs, Collection<CDOID> detachedObjects) { super(CDOSessionImpl.this); this.view = view; this.timeStamp = timeStamp; + newPackageUnits = packageUnits; this.dirtyOIDs = dirtyOIDs; this.detachedObjects = detachedObjects; } @@ -1125,6 +1132,11 @@ public abstract class CDOSessionImpl extends Container<CDOView> implements Inter return detachedObjects; } + public Collection<CDOPackageUnit> getNewPackageUnits() + { + return newPackageUnits; + } + @Override public String toString() { 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 9c6e9bd542..0dfe45740a 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 @@ -1305,7 +1305,8 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa ((InternalCDORevisionDelta)dirtyObjectDelta).adjustReferences(result.getReferenceAdjuster()); } - session.handleCommitNotification(timeStamp, dirtyIDs, detachedIDs, deltasCopy, getTransaction()); + session.handleCommitNotification(timeStamp, newPackageUnits, dirtyIDs, detachedIDs, deltasCopy, + getTransaction()); } lastCommitTime = timeStamp; 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 50a4de0be3..fcf1618ae7 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 @@ -14,6 +14,7 @@ import org.eclipse.emf.cdo.common.id.CDOID; import org.eclipse.emf.cdo.common.id.CDOIDAndVersion; import org.eclipse.emf.cdo.common.id.CDOIDObjectFactory; import org.eclipse.emf.cdo.common.model.CDOPackageRegistry; +import org.eclipse.emf.cdo.common.model.CDOPackageUnit; import org.eclipse.emf.cdo.common.revision.delta.CDORevisionDelta; import org.eclipse.emf.cdo.session.CDOSession; import org.eclipse.emf.cdo.spi.common.model.InternalCDOPackageRegistry; @@ -38,8 +39,10 @@ public interface InternalCDOSession extends CDOSession, CDOIDObjectFactory, public void viewDetached(InternalCDOView view); - public void handleCommitNotification(long timeStamp, Set<CDOIDAndVersion> dirtyOIDs, - Collection<CDOID> detachedObjects, Collection<CDORevisionDelta> deltas, InternalCDOView excludedView); + public void handleCommitNotification(long timeStamp, Collection<CDOPackageUnit> newPackageUnits, + Set<CDOIDAndVersion> dirtyOIDs, Collection<CDOID> detachedObjects, Collection<CDORevisionDelta> deltas, + InternalCDOView excludedView); - public void handleSyncResponse(long timestamp, Set<CDOIDAndVersion> dirtyOIDs, Collection<CDOID> detachedObjects); + public void handleSyncResponse(long timestamp, Collection<CDOPackageUnit> newPackageUnits, + Set<CDOIDAndVersion> dirtyOIDs, Collection<CDOID> detachedObjects); } |