public static interface CDOView.Options extends CDOCommonView.Options
view configuration options.| Modifier and Type | Interface and Description |
|---|---|
static interface |
CDOView.Options.CacheReferenceTypeEvent
|
static interface |
CDOView.Options.ChangeSubscriptionPoliciesEvent
|
static interface |
CDOView.Options.DetachmentNotificationEvent
An
options event fired from view options when the
detachment notification enabled option has changed. |
static interface |
CDOView.Options.FeatureAnalyzerEvent
|
static interface |
CDOView.Options.InvalidationNotificationEvent
An
options event fired from view options when the
invalidation notification enabled option has changed. |
static interface |
CDOView.Options.InvalidationPolicyEvent
|
static interface |
CDOView.Options.LoadNotificationEvent
|
static interface |
CDOView.Options.ReferencePolicyEvent
Deprecated.
Use
CDOView.Options.StrongReferencePolicyEvent instead. |
static interface |
CDOView.Options.RevisionPrefetchingPolicyEvent
|
static interface |
CDOView.Options.StaleReferencePolicyEvent
|
static interface |
CDOView.Options.StrongReferencePolicyEvent
|
CDOCommonView.Options.LockNotificationEvent| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_REVISION_PREFETCHING |
static int |
NO_REVISION_PREFETCHING |
| Modifier and Type | Method and Description |
|---|---|
void |
addChangeSubscriptionPolicy(CDOAdapterPolicy policy)
Adds a change subscription policy to this view.
|
ReferenceType |
getCacheReferenceType()
Returns the reference type to be used in the internal object cache.
|
CDOAdapterPolicy[] |
getChangeSubscriptionPolicies()
Returns the current set of
change subscription policies. |
CDOView |
getContainer()
Returns the
view of this options object. |
CDOFeatureAnalyzer |
getFeatureAnalyzer() |
CDOInvalidationPolicy |
getInvalidationPolicy() |
CDORevisionPrefetchingPolicy |
getRevisionPrefetchingPolicy()
Returns the CDORevisionPrefetchingPolicy in use.
|
CDOStaleReferencePolicy |
getStaleReferenceBehaviour()
Deprecated.
|
CDOStaleReferencePolicy |
getStaleReferencePolicy()
Returns the CDOStaleReferencePolicy in use.
|
CDOAdapterPolicy |
getStrongReferencePolicy()
Returns the strong reference policy in use.
|
boolean |
isDetachmentNotificationEnabled()
|
boolean |
isInvalidationNotificationEnabled()
|
boolean |
isLoadNotificationEnabled()
|
void |
removeChangeSubscriptionPolicy(CDOAdapterPolicy policy)
Removes a change subscription policy from this view.
|
boolean |
setCacheReferenceType(ReferenceType referenceType)
|
void |
setDetachmentNotificationEnabled(boolean enabled)
|
void |
setFeatureAnalyzer(CDOFeatureAnalyzer featureAnalyzer) |
void |
setInvalidationNotificationEnabled(boolean enabled)
|
void |
setInvalidationPolicy(CDOInvalidationPolicy policy) |
void |
setLoadNotificationEnabled(boolean enabled)
|
void |
setRevisionPrefetchingPolicy(CDORevisionPrefetchingPolicy prefetchingPolicy)
The CDORevisionPrefetchingPolicy feature of the CDOView allows CDO users to fetch many objects at a time.
|
void |
setStaleReferenceBehaviour(CDOStaleReferencePolicy policy)
Deprecated.
|
void |
setStaleReferencePolicy(CDOStaleReferencePolicy policy)
Sets a policy on how to deal with stale references.
|
void |
setStrongReferencePolicy(CDOAdapterPolicy policy)
Sets the policy that determines what object/adapter pairs of this
view
are supposed to be protected against garbage collection. |
isLockNotificationEnabled, setLockNotificationEnabledaddListener, getListeners, hasListeners, removeListenerstatic final int DEFAULT_REVISION_PREFETCHING
static final int NO_REVISION_PREFETCHING
CDOView getContainer()
view of this options object.getContainer in interface IOptionsboolean isLoadNotificationEnabled()
true if the objects in this view will notify their
adapters about the fact that they are loaded,
false otherwise.void setLoadNotificationEnabled(boolean enabled)
objects in this view will notify their
adapters about the fact that they are loaded or not.boolean isDetachmentNotificationEnabled()
true if the objects in this view will notify their
adapters about the fact that they are detached (due to
remote changes), false otherwise.CDONotification.DETACH_OBJECTvoid setDetachmentNotificationEnabled(boolean enabled)
objects in this view will notify their
adapters about the fact that they are detached (due to
remote changes) or not.CDONotification.DETACH_OBJECTboolean isInvalidationNotificationEnabled()
true if the objects in this view will notify their
adapters about the fact that they are invalidated (due to
remote changes), false otherwise.CDOInvalidationNotificationvoid setInvalidationNotificationEnabled(boolean enabled)
objects in this view will notify their
adapters about the fact that they are invalidated (due to
remote changes) or not.CDOInvalidationNotificationCDOInvalidationPolicy getInvalidationPolicy()
void setInvalidationPolicy(CDOInvalidationPolicy policy)
CDOAdapterPolicy[] getChangeSubscriptionPolicies()
change subscription policies.null.addChangeSubscriptionPolicy(CDOAdapterPolicy)void addChangeSubscriptionPolicy(CDOAdapterPolicy policy)
To activate a policy, you must do the following:
view.options().addChangeSubscriptionPolicy(CDOChangeSubscriptionPolicy.ALL);
To register an object, you must add an adapter to the object in which you are interested:
eObject.eAdapters().add(myAdapter);
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.
CDOAdapterPolicy.NONE - Ignored.
CDOAdapterPolicy.ALL - Enabled for all adapters used.
CDOAdapterPolicy.CDO - Enabled only for adapters that implement CDOAdapter.
CDOAdapterPolicy will enable for whatever rules defined in that class.
If myAdapter in the above example matches the current policy, eObject will be
registered with the server and you will receive all changes from other transaction.
When the policy is changed all objects in the cache will automatically be recalculated.
You can subscribe to temporary objects. Even if you cannot receive notifications from other
CDOTransaction for these because they are only local to you, at commit time these objects will be
registered automatically.
void removeChangeSubscriptionPolicy(CDOAdapterPolicy policy)
ReferenceType getCacheReferenceType()
boolean setCacheReferenceType(ReferenceType referenceType)
STRONG,
SOFT or WEAK. If null is passed the default
reference type SOFT is set. If the given reference type does not differ from the one
being currently set the new value is ignored and false is returned. Otherwise existing object
references are converted to the new type and true is returned.CDOAdapterPolicy getStrongReferencePolicy()
void setStrongReferencePolicy(CDOAdapterPolicy policy)
view
are supposed to be protected against garbage collection.
A view uses references of the type determined by getCacheReferenceType() to hold on to loaded objects.
If this type is not STRONG and the application does not hold other strong
references to an object then this object and possibly any adapters attached to this object are subject to garbage collection.
To avoid automatic garbage collection while specific adapters are attached to an object this view calls the
CDOAdapterPolicy.isValid()
method for all adapters that are attached to this object.
An extra strong reference to this object is maintained if any of these calls return true.
The following adapter policies can be used as strong reference policies:
CDOAdapterPolicy.NONE - No adapter will prevent GC.
CDOAdapterPolicy.ALL - Any adapter prevent GC.
CDOAdapterPolicy.CDO - Only adapters that implement CDOAdapter will prevent GC.
CDOAdapterPolicy will prevent GC according to whatever rules defined
in that class.
The default strong reference policy is CDOAdapterPolicy.ALL, preventing garbage collection for all adapted objects.
getStrongReferencePolicy()@Deprecated CDOStaleReferencePolicy getStaleReferenceBehaviour()
getStaleReferencePolicy()@Deprecated void setStaleReferenceBehaviour(CDOStaleReferencePolicy policy)
setStaleReferencePolicy(CDOStaleReferencePolicy)CDOStaleReferencePolicy getStaleReferencePolicy()
void setStaleReferencePolicy(CDOStaleReferencePolicy policy)
CDORevisionPrefetchingPolicy getRevisionPrefetchingPolicy()
void setRevisionPrefetchingPolicy(CDORevisionPrefetchingPolicy prefetchingPolicy)
The difference between the CDOCollectionLoadingPolicy feature and the CDORevisionPrefetchingPolicy feature is subtle. The CDOCollectionLoadingPolicy feature determines how and when to fetch CDOIDs, while the CDORevisionPrefetchingPolicy feature determines how and when to resolve CDOIDs (i.e. fetch the target objects).
view.options().setRevisionPrefetchingPolicy (CDONet4jUtil.createRevisionPrefetchingPolicy(10));
The end-user could provide its own implementation of the CDORevisionPrefetchingPolicy interface.
CDOFeatureAnalyzer getFeatureAnalyzer()
void setFeatureAnalyzer(CDOFeatureAnalyzer featureAnalyzer)
Copyright (c) 2004-2019 Eike Stepper (Loehne, Germany) and others.
All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html