Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon McDuff2008-08-08 10:50:30 -0400
committerSimon McDuff2008-08-08 10:50:30 -0400
commita2d241c6b62549d3ef86d1bd7c6a909061729ac9 (patch)
tree9d17e82453a63cef512115aea7f1ee380f8e247e
parent0fabc3ba6f3c85942279966e62473ab2e3dddccd (diff)
downloadcdo-a2d241c6b62549d3ef86d1bd7c6a909061729ac9.tar.gz
cdo-a2d241c6b62549d3ef86d1bd7c6a909061729ac9.tar.xz
cdo-a2d241c6b62549d3ef86d1bd7c6a909061729ac9.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/src/org/eclipse/emf/cdo/CDOSavepoint.java5
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOSession.java4
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOTransaction.java6
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOView.java32
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/CDOResourceImpl.java3
5 files changed, 44 insertions, 6 deletions
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOSavepoint.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOSavepoint.java
index 1234746078..d59a9c038c 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOSavepoint.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOSavepoint.java
@@ -8,6 +8,11 @@
package org.eclipse.emf.cdo;
/**
+ * Creates a save point in the {@link CDOTransaction} that can be used to roll back a part of the transaction, and
+ * specifies the save point.
+ * <p>
+ * <b>Note:</b> Save point do not flush to disk. Everything is done on the client side.
+ *
* @author Simon McDuff
* @since 2.0
*/
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 ad9e3029b2..e3becf7629 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
@@ -69,10 +69,14 @@ public interface CDOSession extends CDOProtocolSession, IContainer<CDOView>
/**
* Specifies whether object will be invalidate from others users changes.
* <p>
+ * e.g. : session.setPassiveUpdateEnabled(false);
+ * <p>
* By default this value is enabled.
* <p>
* If you disabled this property, you can still have the latest version of objects by calling {@link #refresh()}.
* <p>
+ * e.g. : session.refresh();
+ * <p>
* You would disabled it in the case where you need performance and/or want to control when objects will be refresh.
* <p>
* When we enable it, it will automatically perform a refresh to be in sync with the server.
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOTransaction.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOTransaction.java
index 5cd22dde49..af0ba4274b 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOTransaction.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOTransaction.java
@@ -70,6 +70,12 @@ public interface CDOTransaction extends CDOView
public void rollback(CDOSavepoint savepoint);
/**
+ * Creates a save point in the {@link CDOTransaction} that can be used to roll back a part of the transaction, and
+ * specifies the save point.
+ * <p>
+ * Save point do not flush to disk.
+ * <p>
+ *
* @since 2.0
*/
public CDOSavepoint setSavepoint();
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOView.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOView.java
index eccf2bde08..629544d55e 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOView.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOView.java
@@ -66,16 +66,36 @@ public interface CDOView extends CDOProtocolView, INotifier
* @since 2.0
*/
public CDOChangeSubscriptionPolicy getChangeSubscriptionPolicy();
-
+
/**
- * Specifies the change subscription policy. By default, the value is set to {@link CDOChangeSubscriptionPolicy.NONE}.
+ * Specifies the change subscription policy. By default, the value is set to {@link CDOChangeSubscriptionPolicy#NONE}.
+ * <p>
+ * To activate the policy you need to do the following : <br>
+ * e.g.: <code>transaction.setChangeSubscriptionPolicy(CDOChangeSubscriptionPolicy.ALL);</code>
+ * <p>
+ * To register an object you need to add an adapter to this object. <br>
+ * e.g.: <code>eObject.eAdapters().add(anAdapter);</code>
* <p>
* By activating this feature, every objects that have at least one adapter that match the current policy will be
* registered to the server and will be notify for every changes happening on any other CDOTransaction.
* <p>
- * {@link CDOChangeSubscriptionPolicy.NONE} - Disabled
- * {@link CDOChangeSubscriptionPolicy.ALL} - Enabled
- * Any others classes that implement {@link CDOChangeSubscriptionPolicy} - Enabled
+ * {@link CDOChangeSubscriptionPolicy#NONE} - Disabled. <br>
+ * {@link CDOChangeSubscriptionPolicy#ALL} - Enabled for all adapters used.<br>
+ * {@link CDOChangeSubscriptionPolicy#ONLY_CDOADAPTER} - Enabled only for adapters that implement {@link CDOAdapter}.<br>
+ * Any others classes that implement {@link CDOChangeSubscriptionPolicy} - Enabled for whatever rules define in that
+ * class. <br>
+ * <p>
+ * If the <code>anAdapter</code> matches the current policy, <code>eObject</code> will be registered to the server and
+ * you will receive all changes from others {@link CDOTransaction}.
+ * <p>
+ * When the policy changed it will recalculate automatically every objects in the cache.
+ * <p>
+ * You can subscribe temporary objects. Even if you cannot receive notification from other {@link CDOTransaction} for
+ * that object because it is only local to you, at commit time these objects will be registered automatically.
+ * <p>
+ * <b>Note :</b> It can be used with <code> CDOSession.setPassiveUpdate(false) </code>. In this case, it will receive
+ * changes without having the object change.
+ *
* @since 2.0
*/
public void setChangeSubscriptionPolicy(CDOChangeSubscriptionPolicy changeSubscriptionPolicy);
@@ -98,7 +118,7 @@ public interface CDOView extends CDOProtocolView, INotifier
public boolean isObjectRegistered(CDOID id);
public int reload(CDOObject... objects);
-
+
/**
* @since 2.0
*/
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/CDOResourceImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/CDOResourceImpl.java
index e40dabd983..ca3813618c 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/CDOResourceImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/CDOResourceImpl.java
@@ -329,6 +329,9 @@ public class CDOResourceImpl extends CDOObjectImpl implements CDOResource
}
/**
+ * <b>Note:</b> URI from temporary objects are going to changed when we commit the CDOTransaction. Objects will not be
+ * accessible from their temporary URI once CDOTransaction is committed.
+ *
* @ADDED
*/
public EObject getEObject(String uriFragment)

Back to the top