Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2008-10-10 04:28:30 -0400
committerEike Stepper2008-10-10 04:28:30 -0400
commit130ad0ac7c3df041dcf8e73e2f8301baaae7725e (patch)
tree5efb5556a1073d54fc47dcd8b54181dbb403ad91
parent1fcba8a7576a98aed425852d9b4767d38664e10e (diff)
downloadcdo-130ad0ac7c3df041dcf8e73e2f8301baaae7725e.tar.gz
cdo-130ad0ac7c3df041dcf8e73e2f8301baaae7725e.tar.xz
cdo-130ad0ac7c3df041dcf8e73e2f8301baaae7725e.zip
javadoc
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOChangeSubscriptionPolicy.java32
1 files changed, 31 insertions, 1 deletions
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOChangeSubscriptionPolicy.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOChangeSubscriptionPolicy.java
index c029cbbfa4..145bb1c29b 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOChangeSubscriptionPolicy.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOChangeSubscriptionPolicy.java
@@ -15,7 +15,37 @@ import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.ecore.EObject;
/**
+ * Specifies a change subscription policy.
+ * <p>
+ * To activate a policy, you must do the following: <br>
+ * <code>view.setChangeSubscriptionPolicy(CDOChangeSubscriptionPolicy.ALL);</code>
+ * <p>
+ * To register an object, you must add an adapter to the object in which you are interested:<br>
+ * <code>eObject.eAdapters().add(myAdapter);</code>
+ * <p>
+ * By activating this feature, each object having at least one adapter that matches the current policy will be
+ * registered with the server and will be notified for each change occurring in the scope of any other transaction.
+ * <p>
+ * {@link CDOChangeSubscriptionPolicy#NONE} - Disabled. <br>
+ * {@link CDOChangeSubscriptionPolicy#ALL} - Enabled for all adapters used.<br>
+ * {@link CDOChangeSubscriptionPolicy#ONLY_CDO_ADAPTER} - Enabled only for adapters that implement {@link CDOAdapter}. <br>
+ * Any other class that implement {@link CDOChangeSubscriptionPolicy} will enable for whatever rules defined in that
+ * class. <br>
+ * <p>
+ * If <code>myAdapter</code> in the above example matches the current policy, <code>eObject</code> will be registered
+ * with the server and you will receive all changes from other transaction.
+ * <p>
+ * When the policy is changed all objects in the cache will automatically be recalculated.
+ * <p>
+ * You can subscribe to temporary objects. Even if you cannot receive notifications from other {@link CDOTransaction}
+ * for these because they are 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 objects changed.
+ *
* @author Simon McDuff
+ * @see CDOSessionInvalidationEvent
+ * @see CDOInvalidationNotification
* @since 2.0
*/
public interface CDOChangeSubscriptionPolicy
@@ -44,5 +74,5 @@ public interface CDOChangeSubscriptionPolicy
}
};
- boolean shouldSubscribe(EObject eObject, Adapter adapter);
+ public boolean shouldSubscribe(EObject eObject, Adapter adapter);
}

Back to the top