Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon McDuff2008-07-10 15:10:44 -0400
committerSimon McDuff2008-07-10 15:10:44 -0400
commita6eca3ba9bbe689416e14f6dcc306f26ee140c33 (patch)
treeb5c114921346cbeed3229972f4290d4c77886f6c
parent15bd26eebbbda254f9f63f95e95b584a2d257155 (diff)
downloadcdo-a6eca3ba9bbe689416e14f6dcc306f26ee140c33.tar.gz
cdo-a6eca3ba9bbe689416e14f6dcc306f26ee140c33.tar.xz
cdo-a6eca3ba9bbe689416e14f6dcc306f26ee140c33.zip
[238414] Merge simon_pre_0_9 to HEAD
https://bugs.eclipse.org/bugs/show_bug.cgi?id=238414
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/CDOProtocolConstants.java10
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/CDOProtocolSession.java6
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/QueryManager.java15
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/ChangeSubscriptionIndication.java17
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/ISession.java6
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ChangeSubscriptionTest.java13
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/InvalidationTest.java27
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/QueryTest.java15
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOSession.java25
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOAutoAttacher.java42
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectImpl.java6
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionImpl.java31
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java28
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/ChangeSubscriptionRequest.java15
14 files changed, 122 insertions, 134 deletions
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/CDOProtocolConstants.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/CDOProtocolConstants.java
index a1b2f4bb99..868e63de2f 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/CDOProtocolConstants.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/CDOProtocolConstants.java
@@ -47,27 +47,27 @@ public interface CDOProtocolConstants
public static final short SIGNAL_COMMIT_TRANSACTION = 13;
public static final short SIGNAL_INVALIDATION = 14;
-
+
/**
* @since 2.0
*/
public static final short SIGNAL_QUERY = 15;
-
+
/**
* @since 2.0
*/
public static final short SIGNAL_QUERY_CANCEL = 16;
-
+
/**
* @since 2.0
*/
public static final short SIGNAL_SYNC = 17;
-
+
/**
* @since 2.0
*/
public static final short SIGNAL_PASSIVE_UPDATE = 18;
-
+
/**
* @since 2.0
*/
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/CDOProtocolSession.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/CDOProtocolSession.java
index 610357cf66..e2cf2cd09a 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/CDOProtocolSession.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/CDOProtocolSession.java
@@ -23,4 +23,10 @@ public interface CDOProtocolSession
public CDOProtocolView getView(int viewID);
public boolean isLegacySupportEnabled();
+
+ /**
+ * @since 2.0
+ */
+ public boolean isPassiveUpdateEnabled();
+
}
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/QueryManager.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/QueryManager.java
index 1dea8cfbb9..076c9dfd5b 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/QueryManager.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/QueryManager.java
@@ -117,16 +117,16 @@ public class QueryManager
ResultWriterQueue<Object> resultQueue = queryResult.getResultWriterQueue();
CloseableIterator<Object> itrResult = null;
-
+
try
{
itrResult = reader.createQueryIterator(queryResult.getQueryParameter());
-
+
int maxResult = queryResult.getQueryParameter().getMaxResult();
-
+
if (maxResult < 0) maxResult = Integer.MAX_VALUE;
-
- for (int i =0; i < maxResult && itrResult.hasNext(); i++)
+
+ for (int i = 0; i < maxResult && itrResult.hasNext(); i++)
{
resultQueue.add(itrResult.next());
}
@@ -142,9 +142,8 @@ public class QueryManager
finally
{
resultQueue.release();
-
- if (itrResult != null)
- itrResult.close();
+
+ if (itrResult != null) itrResult.close();
unregisterQueryNative(this);
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/ChangeSubscriptionIndication.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/ChangeSubscriptionIndication.java
index 66f8b8bd81..583a67e9c1 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/ChangeSubscriptionIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/ChangeSubscriptionIndication.java
@@ -47,27 +47,28 @@ public class ChangeSubscriptionIndication extends CDOReadIndication
int viewID = in.readInt();
boolean clear = in.readBoolean();
-
+
int size = in.readInt();
- boolean registered = true;
+ boolean subscribeMode = true;
if (size <= 0)
{
- registered = false;
+ subscribeMode = false;
size = -size;
}
-
+
IView view = getSession().getView(viewID);
-
+
if (clear)
{
- if (PROTOCOL.isEnabled()) PROTOCOL.trace("Clear subscription");
+ if (PROTOCOL.isEnabled()) PROTOCOL.trace("Clear subscription");
+
view.clearChangeSubscription();
}
-
+
for (int i = 0; i < size; i++)
{
CDOID id = CDOIDUtil.read(in, factory);
- if (registered)
+ if (subscribeMode)
view.subscribe(id);
else
view.unsubscribe(id);
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/ISession.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/ISession.java
index 0c130d07ab..bbb3676b11 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/ISession.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/ISession.java
@@ -27,9 +27,5 @@ public interface ISession extends CDOProtocolSession, IContainer<IView>
public IView openView(int viewID, CDOProtocolView.Type type);
public IView closeView(int viewID);
-
- /**
- * @since 2.0
- */
- public boolean isPassiveUpdateEnabled();
+
}
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ChangeSubscriptionTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ChangeSubscriptionTest.java
index 09399015de..08d46182bc 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ChangeSubscriptionTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ChangeSubscriptionTest.java
@@ -540,13 +540,12 @@ public class ChangeSubscriptionTest extends AbstractCDOTest
for (Notification notification : adapter.getNotifications())
{
CDONotification cdoNotification = (CDONotification)notification;
-
+
if (adapter.getNotifications().size() - 1 == count)
- assertEquals(false,cdoNotification.hasNext());
+ assertEquals(false, cdoNotification.hasNext());
else
- assertEquals(true,cdoNotification.hasNext());
-
-
+ assertEquals(true, cdoNotification.hasNext());
+
if (notification.getFeature() == Model1Package.eINSTANCE.getCategory_Name())
{
assertEquals(Notification.SET, notification.getEventType());
@@ -566,9 +565,9 @@ public class ChangeSubscriptionTest extends AbstractCDOTest
}
else
assertEquals(false, false);
-
+
count++;
-
+
}
}
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/InvalidationTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/InvalidationTest.java
index caa3cb2bc9..e308e7e739 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/InvalidationTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/InvalidationTest.java
@@ -455,9 +455,9 @@ public class InvalidationTest extends AbstractCDOTest
msg("Committing");
transaction.commit();
-
+
URI uriCategory1 = EcoreUtil.getURI(category1A);
-
+
// ************************************************************* //
msg("Opening sessionB");
@@ -499,6 +499,7 @@ public class InvalidationTest extends AbstractCDOTest
assertEquals(false, timeOuter.timedOut());
}
+
public void testPassiveUpdateOnAndOff() throws Exception
{
msg("Creating category1");
@@ -546,18 +547,18 @@ public class InvalidationTest extends AbstractCDOTest
msg("Attaching viewB");
final CDOView viewB = sessionB.openTransaction();
-
+
final Category category1B = (Category)viewB.getResourceSet().getEObject(uriCategory1, true);
-
+
// ************************************************************* //
msg("Opening sessionB");
final CDOSession sessionC = openModel1Session();
-
+
assertEquals(true, sessionC.isPassiveUpdateEnabled());
-
+
msg("Attaching viewB");
final CDOView viewC = sessionC.openTransaction();
-
+
final Category category1C = (Category)viewC.getResourceSet().getEObject(uriCategory1, true);
msg("Changing name");
@@ -571,7 +572,7 @@ public class InvalidationTest extends AbstractCDOTest
return "CHANGED NAME".equals(category1B.getName());
}
};
-
+
ITimeOuter timeOuterC = new PollingTimeOuter(10, 100)
{
@Override
@@ -598,9 +599,9 @@ public class InvalidationTest extends AbstractCDOTest
msg("Checking after sync");
assertEquals(false, timeOuterB.timedOut());
assertEquals(false, timeOuterC.timedOut());
-
+
category1A.setName("CHANGED NAME-VERSION2");
-
+
ITimeOuter timeOuterB_2 = new PollingTimeOuter(10, 100)
{
@Override
@@ -609,7 +610,7 @@ public class InvalidationTest extends AbstractCDOTest
return "CHANGED NAME-VERSION2".equals(category1B.getName());
}
};
-
+
ITimeOuter timeOuterC_2 = new PollingTimeOuter(10, 100)
{
@Override
@@ -628,6 +629,6 @@ public class InvalidationTest extends AbstractCDOTest
assertEquals(false, timeOuterB_2.timedOut());
assertEquals(false, timeOuterC_2.timedOut());
-
- }
+
+ }
}
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/QueryTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/QueryTest.java
index 8678c8b088..e7ce18bf94 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/QueryTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/QueryTest.java
@@ -36,7 +36,7 @@ import java.util.Set;
public class QueryTest extends AbstractCDOTest
{
static String LANGUAGE_TEST = "TEST";
-
+
public void testBasicQuery() throws Exception
{
@@ -70,7 +70,7 @@ public class QueryTest extends AbstractCDOTest
transaction.close();
session.close();
}
-
+
public void testBasicQuery_EClassParameter() throws Exception
{
@@ -94,19 +94,20 @@ public class QueryTest extends AbstractCDOTest
transaction.commit();
System.out.println(category1.eClass().getEPackage().getNsURI());
-
+
CDOQuery cdoQuery = transaction.createQuery(LANGUAGE_TEST, "TEST");
-
+
cdoQuery.setParameter("context", Model1Package.eINSTANCE.getCategory());
-
+
List<Category> queryResult = cdoQuery.getResultList(Category.class);
-
+
assertEquals(1, queryResult.size());
assertEquals(category1, queryResult.get(0));
-
+
transaction.close();
session.close();
}
+
public void testQueryCancel_successful() throws Exception
{
CDOTransaction transaction = initialize(100);
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOSession.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOSession.java
index 3892d87906..0d0b8dff3a 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOSession.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOSession.java
@@ -67,35 +67,30 @@ public interface CDOSession extends CDOProtocolSession, IContainer<CDOView>
public CDOAudit openAudit(long timeStamp);
/**
- * Specifies whether object will be invalidate from others users changes.
+ * Specifies whether object will be invalidate from others users changes.
* <p>
* By default this value is enabled.
* <p>
- * If you disabled this property, you can still have the latest version of objects by calling refresh
+ * If you disabled this property, you can still have the latest version of objects by calling refresh.
* <p>
- * You would disabled it, in the case where you need performance and/or want to control when objects will be
- * refreshed.
+ * You would disabled it in the case where you need performance and/or want to control when objects will be refresh.
* <p>
- * When we activate it, it will perform a refresh to be in sync with the server.
+ * When we enable it, it will automatically perform a refresh to be in sync with the server.
+ *
* @since 2.0
*/
public void setPassiveUpdateEnabled(boolean enable);
-
- /**
- * @since 2.0
- */
- public boolean isPassiveUpdateEnabled();
-
+
/**
- * Refresh objects cache.
+ * Refresh objects cache.
* <p>
- * Take CDOID and version of all objects in the cache, sent it to the server.
- * It will return only dirty objects.
+ * Take CDOID and version of all objects in the cache, sent it to the server. It will return only dirty objects.
* <p>
* In the case where <code>isPassiveUpdateEnabled<code> is true, it will return immediately without doing anything.
+ *
* @since 2.0
*/
public Set<CDOIDAndVersion> refresh();
-
+
public void close();
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOAutoAttacher.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOAutoAttacher.java
index 502b1cab27..9409fb7ba0 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOAutoAttacher.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOAutoAttacher.java
@@ -111,6 +111,21 @@ public class CDOAutoAttacher implements CDOTransactionHandler
res.getContents().add((InternalCDOObject)object);
}
+ private void check(Resource resource, EReference reference, EObject element)
+ {
+ if (element != null && element.eResource() == null)
+ {
+ if (reference.isContainment())
+ {
+ handle(resource, element);
+ }
+ else
+ {
+ persist(resource, element);
+ }
+ }
+ }
+
/**
* @param eObject
*/
@@ -124,35 +139,12 @@ public class CDOAutoAttacher implements CDOTransactionHandler
List<EObject> list = (List<EObject>)eObject.eGet(reference);
for (EObject element : list)
{
- if (element.eResource() == null)
- {
- if (reference.isContainment())
- {
- handle(resource, element);
- }
- else
- {
- persist(resource, element);
- }
- }
+ check(resource, reference, element);
}
}
else
{
- EObject element = (EObject)eObject.eGet(reference);
-
- if (element != null && element.eResource() == null)
- {
- // objectsAdded.add(element);
- if (reference.isContainment())
- {
- handle(resource, element);
- }
- else
- {
- persist(resource, element);
- }
- }
+ check(resource, reference, (EObject)eObject.eGet(reference));
}
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectImpl.java
index 816da9a4d3..a7794f2b08 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectImpl.java
@@ -220,7 +220,7 @@ public class CDOObjectImpl extends EStoreEObjectImpl implements InternalCDOObjec
populateRevisionFeature(view, revision, eFeature, eSettings, i);
}
}
-
+
if (eBasicAdapters() != null)
{
for (Adapter adapter : eBasicAdapters())
@@ -228,7 +228,7 @@ public class CDOObjectImpl extends EStoreEObjectImpl implements InternalCDOObjec
cdoView().subscribe(this, adapter);
}
}
-
+
}
@SuppressWarnings("unchecked")
@@ -384,7 +384,7 @@ public class CDOObjectImpl extends EStoreEObjectImpl implements InternalCDOObjec
{
if (eAdapters == null)
{
- eAdapters = new EAdapterList<Adapter>(this)
+ eAdapters = new EAdapterList<Adapter>(this)
{
private static final long serialVersionUID = 1L;
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionImpl.java
index fb2de207eb..b26e576dad 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionImpl.java
@@ -172,7 +172,7 @@ public class CDOSessionImpl extends Container<CDOView> implements CDOSession, CD
{
return cdoidObjectFactory.createCDOIDObject(in);
}
-
+
/**
* @since 2.0
*/
@@ -540,26 +540,25 @@ public class CDOSessionImpl extends Container<CDOView> implements CDOSession, CD
}
}
-
public void registerObjectType(CDOID id, CDOClass type)
{
types.put(id, type);
}
-
+
/**
* @since 2.0
*/
- public void handleCommitNotification(long timeStamp, Set<CDOIDAndVersion> dirtyOIDs, Collection<CDORevisionDelta> deltas,
- CDOViewImpl excludedView)
+ public void handleCommitNotification(long timeStamp, Set<CDOIDAndVersion> dirtyOIDs,
+ Collection<CDORevisionDelta> deltas, CDOViewImpl excludedView)
{
if (isPassiveUpdateEnabled())
{
notifyInvalidation(timeStamp, dirtyOIDs, excludedView);
}
- notifyChangeSubcription(deltas, excludedView);
+ handleChangeSubcription(deltas, excludedView);
}
-
+
/**
* @since 2.0
*/
@@ -587,7 +586,7 @@ public class CDOSessionImpl extends Container<CDOView> implements CDOSession, CD
{
try
{
- view.notifyInvalidation(timeStamp, dirtyOIDs);
+ view.handleInvalidation(timeStamp, dirtyOIDs);
}
catch (RuntimeException ex)
{
@@ -598,8 +597,8 @@ public class CDOSessionImpl extends Container<CDOView> implements CDOSession, CD
fireInvalidationEvent(timeStamp, dirtyOIDs, excludedView);
}
-
- private void notifyChangeSubcription(Collection<CDORevisionDelta> deltas, CDOViewImpl excludedView)
+
+ private void handleChangeSubcription(Collection<CDORevisionDelta> deltas, CDOViewImpl excludedView)
{
if (deltas == null || deltas.size() <= 0) return;
@@ -609,7 +608,7 @@ public class CDOSessionImpl extends Container<CDOView> implements CDOSession, CD
{
try
{
- view.notifyChangeSubcription(deltas);
+ view.handleChangeSubcription(deltas);
}
catch (RuntimeException ex)
{
@@ -731,7 +730,8 @@ public class CDOSessionImpl extends Container<CDOView> implements CDOSession, CD
channel = connector.openChannel(CDOProtocolConstants.PROTOCOL_NAME, this);
}
- OpenSessionRequest request = new OpenSessionRequest(channel, repositoryName, legacySupportEnabled, passiveUpdateEnabled);
+ OpenSessionRequest request = new OpenSessionRequest(channel, repositoryName, legacySupportEnabled,
+ passiveUpdateEnabled);
OpenSessionResult result = request.send();
sessionID = result.getSessionID();
@@ -861,7 +861,6 @@ public class CDOSessionImpl extends Container<CDOView> implements CDOSession, CD
throw new ImplementationError("Invalid view type: " + type);
}
-
/**
* @since 2.0
*/
@@ -907,7 +906,7 @@ public class CDOSessionImpl extends Container<CDOView> implements CDOSession, CD
passiveUpdateEnabled = aPassiveUpdateEnabled;
// Need to refresh if we change state
- Map<CDOID, CDORevision> allRevisions = getAllRevisions();
+ Map<CDOID, CDORevision> allRevisions = getAllRevisions();
try
{
if (!allRevisions.isEmpty())
@@ -930,12 +929,12 @@ public class CDOSessionImpl extends Container<CDOView> implements CDOSession, CD
{
if (isPassiveUpdateEnabled())
{
- // Update is passive, doesn`t need to refresh.
+ // If passive update is turned on we don`t need to refresh.
// We do not throw an exception since the client could turn that feature on or off without affecting their code.
return new HashSet<CDOIDAndVersion>();
}
- Map<CDOID, CDORevision> allRevisions = getAllRevisions();
+ Map<CDOID, CDORevision> allRevisions = getAllRevisions();
try
{
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java
index e796270431..b2c410de25 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java
@@ -110,7 +110,7 @@ public class CDOViewImpl extends org.eclipse.net4j.util.event.Notifier implement
private CDOID lastLookupID;
private InternalCDOObject lastLookupObject;
-
+
/**
* @since 2.0
*/
@@ -121,7 +121,6 @@ public class CDOViewImpl extends org.eclipse.net4j.util.event.Notifier implement
*/
protected CDOChangeSubscriptionPolicy changeSubscriptionPolicy = CDOChangeSubscriptionPolicy.NONE;
-
public CDOViewImpl(int id, CDOSessionImpl session)
{
viewID = id;
@@ -131,7 +130,6 @@ public class CDOViewImpl extends org.eclipse.net4j.util.event.Notifier implement
objects = createObjectsMap();
}
-
/**
* @since 2.0
*/
@@ -207,7 +205,7 @@ public class CDOViewImpl extends org.eclipse.net4j.util.event.Notifier implement
{
this.invalidationNotificationsEnabled = invalidationNotificationsEnabled;
}
-
+
/**
* @since 2.0
*/
@@ -229,7 +227,6 @@ public class CDOViewImpl extends org.eclipse.net4j.util.event.Notifier implement
}
}
-
public int getLoadRevisionCollectionChunkSize()
{
return loadRevisionCollectionChunkSize;
@@ -265,7 +262,7 @@ public class CDOViewImpl extends org.eclipse.net4j.util.event.Notifier implement
CDOID id = getResourceID(path);
return id != null && !id.isNull();
}
-
+
/**
* @since 2.0
*/
@@ -289,7 +286,7 @@ public class CDOViewImpl extends org.eclipse.net4j.util.event.Notifier implement
throw new TransactionException(ex);
}
}
-
+
/**
* @since 2.0
*/
@@ -297,7 +294,7 @@ public class CDOViewImpl extends org.eclipse.net4j.util.event.Notifier implement
{
return Collections.unmodifiableMap(objects);
}
-
+
public CDOResource getResource(String path)
{
URI uri = CDOUtil.createResourceURI(path);
@@ -390,7 +387,7 @@ public class CDOViewImpl extends org.eclipse.net4j.util.event.Notifier implement
public InternalCDOObject getObject(CDOID id, boolean loadOnDemand)
{
if (id == null || id.isNull()) return null;
-
+
synchronized (objects)
{
if (id.equals(lastLookupID))
@@ -670,8 +667,9 @@ public class CDOViewImpl extends org.eclipse.net4j.util.event.Notifier implement
* @param dirtyOIDs
* A set of the object IDs to be invalidated. <b>Implementation note:</b> This implementation expects the
* dirtyOIDs set to be unmodifiable. It does not wrap the set (again).
+ * @since 2.0
*/
- public void notifyInvalidation(long timeStamp, Set<CDOIDAndVersion> dirtyOIDs)
+ public void handleInvalidation(long timeStamp, Set<CDOIDAndVersion> dirtyOIDs)
{
List<InternalCDOObject> dirtyObjects = invalidationNotificationsEnabled ? new ArrayList<InternalCDOObject>() : null;
for (CDOIDAndVersion dirtyOID : dirtyOIDs)
@@ -701,11 +699,11 @@ public class CDOViewImpl extends org.eclipse.net4j.util.event.Notifier implement
}
}
}
-
+
/**
* @since 2.0
*/
- public void notifyChangeSubcription(Collection<CDORevisionDelta> deltas)
+ public void handleChangeSubcription(Collection<CDORevisionDelta> deltas)
{
if (deltas != null && getChangeSubscriptionPolicy() != CDOChangeSubscriptionPolicy.NONE)
{
@@ -722,6 +720,7 @@ public class CDOViewImpl extends org.eclipse.net4j.util.event.Notifier implement
}
}
}
+
public int reload(CDOObject... objects)
{
Collection<InternalCDOObject> internalObjects;
@@ -977,8 +976,7 @@ public class CDOViewImpl extends org.eclipse.net4j.util.event.Notifier implement
return MessageFormat.format("CDOViewResourcesEvent[source={0}, {1}={2}]", getSource(), resourcePath, kind);
}
}
-
-
+
/**
* @since 2.0
*/
@@ -1151,5 +1149,5 @@ public class CDOViewImpl extends org.eclipse.net4j.util.event.Notifier implement
{
subscribe(eObject, adapter, -1);
}
- }
+ }
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/ChangeSubscriptionRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/ChangeSubscriptionRequest.java
index 820a9e2e3d..811ff103a5 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/ChangeSubscriptionRequest.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/ChangeSubscriptionRequest.java
@@ -35,17 +35,18 @@ public class ChangeSubscriptionRequest extends CDOClientRequest<Boolean>
private int viewID;
private List<CDOID> cdoIDs;
-
- private boolean registered;
-
+
+ private boolean subscribeMode;
+
private boolean clear;
- public ChangeSubscriptionRequest(IChannel channel, int viewID, List<CDOID> cdoIDs, boolean registered, boolean clear)
+ public ChangeSubscriptionRequest(IChannel channel, int viewID, List<CDOID> cdoIDs, boolean subscribeMode,
+ boolean clear)
{
super(channel);
this.viewID = viewID;
this.cdoIDs = cdoIDs;
- this.registered = registered;
+ this.subscribeMode = subscribeMode;
this.clear = clear;
}
@@ -62,9 +63,9 @@ public class ChangeSubscriptionRequest extends CDOClientRequest<Boolean>
out.writeInt(viewID);
out.writeBoolean(clear);
- out.writeInt(registered ? cdoIDs.size() : -cdoIDs.size());
+ out.writeInt(subscribeMode ? cdoIDs.size() : -cdoIDs.size());
for (CDOID id : cdoIDs)
- CDOIDUtil.write(out, id);
+ CDOIDUtil.write(out, id);
}
@Override

Back to the top