## org.eclipse.emf.cdo.view
Interface CDOView.Options

All Superinterfaces:
  org.eclipse.net4j.util.event.INotifier, org.eclipse.net4j.util.options.IOptions

All Known Subinterfaces:
  CDOTransaction.Options

Enclosing interface:
  CDOView

    public static interface CDOView.Options

extends org.eclipse.net4j.util.options.IOptions

Nested Class Summary
`static interface` `CDOView.Options.CacheReferenceTypeEvent`
`static interface` `CDOView.Options.ChangeSubscriptionPoliciesEvent`
`static interface` `CDOView.Options.InvalidationNotificationEvent`
`static interface` `CDOView.Options.ReferencePolicyEvent`
`static interface` `CDOView.Options.RevisionPrefetchingPolicyEvent`

Nested classes/interfaces inherited from interface org.eclipse.net4j.util.event.INotifier
`org.eclipse.net4j.util.event.INotifier.Introspection`

Field Summary
`static int` `NO_REVISION_PREFETCHING`

Method Summary
`void` `addChangeSubscriptionPolicy(CDOAdapterPolicy policy)` Adds a change subscription policy to this view.
`org.eclipse.net4j.util.ref.ReferenceType` `getCacheReferenceType()` Returns the reference type to be used in the internal object cache.
`CDOAdapterPolicy[]` `getChangeSubscriptionPolicies()` Returns the current set of `change subscription policies`.
`CDORevisionPrefetchingPolicy` `getRevisionPrefetchingPolicy()` Returns the CDORevisionPrefetchingPolicy in used.
`CDOAdapterPolicy` `getStrongReferencePolicy()`
`boolean` `isInvalidationNotificationEnabled()` Returns `true` if the `objects` in this view will notify their `adapters` about the fact that they are invalidated (due to remote changes), `false` otherwise.
`void` `removeChangeSubscriptionPolicy(CDOAdapterPolicy policy)` Removes a change subscription policy from this view.
`boolean` `setCacheReferenceType(org.eclipse.net4j.util.ref.ReferenceType referenceType)` Sets the reference type to be used in the internal object cache to either `STRONG`, `SOFT` or `WEAK`.
`void` `setInvalidationNotificationEnabled(boolean enabled)` Specifies whether the `objects` in this view will notify their `adapters` about the fact that they are invalidated (due to remote changes) or not.
`void` `setRevisionPrefetchingPolicy(CDORevisionPrefetchingPolicy prefetchingPolicy)` The CDORevisionPrefetchingPolicy feature of the CDOView allows CDO users to fetch many objects at a time.
`void` `setStrongReferencePolicy(CDOAdapterPolicy policy)` Sets the reference type to be used when an adapter is used to an object.

Methods inherited from interface org.eclipse.net4j.util.options.IOptions
`getContainer`

Methods inherited from interface org.eclipse.net4j.util.event.INotifier
`addListener, removeListener`

Field Detail

### NO_REVISION_PREFETCHING

    static final int NO_REVISION_PREFETCHING

See Also:
  Constant Field Values

Method Detail

### getCacheReferenceType

    org.eclipse.net4j.util.ref.ReferenceType getCacheReferenceType()

  Returns the reference type to be used in the internal object cache.

  Returns:
    Either `STRONG`, `SOFT` or `WEAK`.

### setCacheReferenceType

    boolean setCacheReferenceType(org.eclipse.net4j.util.ref.ReferenceType referenceType)

  Sets the reference type to be used in the internal object cache to either `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.

### isInvalidationNotificationEnabled

    boolean isInvalidationNotificationEnabled()

  Returns `true` if the `objects` in this view will notify their `adapters` about the fact that they are invalidated (due to remote changes), `false` otherwise.

  See Also:
    `CDOInvalidationNotification`

### setInvalidationNotificationEnabled

    void setInvalidationNotificationEnabled(boolean enabled)

  Specifies whether the `objects` in this view will notify their `adapters` about the fact that they are invalidated (due to remote changes) or not.

  See Also:
    `CDOInvalidationNotification`

### getChangeSubscriptionPolicies

    CDOAdapterPolicy[] getChangeSubscriptionPolicies()

  Returns the current set of `change subscription policies`.

  Returns:
    The current set of change subscription policies, never `null`.
  See Also:
    `#setChangeSubscriptionPolicy(CDOAdapterPolicy)`

### addChangeSubscriptionPolicy

    void addChangeSubscriptionPolicy(CDOAdapterPolicy policy)

  Adds a change subscription policy to this view.

  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`.
  Any other class that implement `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.

  Note: It can be used with `CDOSession.options().setPassiveUpdate(false)`. In this case, it will receive changes without having the objects changed.

### removeChangeSubscriptionPolicy

    void removeChangeSubscriptionPolicy(CDOAdapterPolicy policy)

  Removes a change subscription policy from this view.

### getStrongReferencePolicy

    CDOAdapterPolicy getStrongReferencePolicy()

### setStrongReferencePolicy

    void setStrongReferencePolicy(CDOAdapterPolicy policy)

  Sets the reference type to be used when an adapter is used to an object.

  When `CDOView.setStrongReference(CDOAdapterPolicy.ALL)` is used, it is possible that the target object will be GC. In that case, the adapter will never received notifications. By Default the value is at `CDOAdapterPolicy.ALL`

### getRevisionPrefetchingPolicy

    CDORevisionPrefetchingPolicy getRevisionPrefetchingPolicy()

  Returns the CDORevisionPrefetchingPolicy in used.

### setRevisionPrefetchingPolicy

    void setRevisionPrefetchingPolicy(CDORevisionPrefetchingPolicy prefetchingPolicy)

  The CDORevisionPrefetchingPolicy feature of the CDOView allows CDO users to fetch many objects at a time.

  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.

Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) and others. All Rights Reserved.