org.eclipse.emf.internal.cdo
Class CDOObjectImpl

java.lang.Object
  extended by org.eclipse.emf.common.notify.impl.BasicNotifierImpl
      extended by org.eclipse.emf.ecore.impl.BasicEObjectImpl
          extended by org.eclipse.emf.ecore.impl.EObjectImpl
              extended by org.eclipse.emf.ecore.impl.EStoreEObjectImpl
                  extended by org.eclipse.emf.internal.cdo.CDOObjectImpl
All Implemented Interfaces:
CDOObject, CDOWithID, CDOPackageTypeRegistry.CDOObjectMarker, Notifier, EObject, EStructuralFeature.Internal.DynamicValueHolder, InternalEObject, InternalCDOLoadable, InternalCDOObject
Direct Known Subclasses:
CDOResourceNodeImpl, ModelElementImpl, PermissionImpl, UserPasswordImpl

public class CDOObjectImpl
extends EStoreEObjectImpl
implements InternalCDOObject

The base class of all native objects.


Nested Class Summary
 class CDOObjectImpl.CDOStoreEcoreEMap
           
 class CDOObjectImpl.CDOStoreFeatureMap
          TODO Remove this when EMF has fixed bug 197487
static class CDOObjectImpl.CDOStoreSettingsImpl
          For internal use only.
 class CDOObjectImpl.CDOStoreUnorderedEList<E>
           
 
Nested classes/interfaces inherited from class org.eclipse.emf.ecore.impl.EStoreEObjectImpl
EStoreEObjectImpl.BasicEStoreEList<E>, EStoreEObjectImpl.BasicEStoreFeatureMap, EStoreEObjectImpl.EStoreEList<E>, EStoreEObjectImpl.EStoreEPropertiesHolderImpl, EStoreEObjectImpl.EStoreFeatureMap, EStoreEObjectImpl.EStoreImpl
 
Nested classes/interfaces inherited from class org.eclipse.emf.ecore.impl.BasicEObjectImpl
BasicEObjectImpl.EPropertiesHolder, BasicEObjectImpl.EPropertiesHolderBaseImpl, BasicEObjectImpl.EPropertiesHolderImpl
 
Nested classes/interfaces inherited from class org.eclipse.emf.common.notify.impl.BasicNotifierImpl
BasicNotifierImpl.EAdapterList<E extends Object & Adapter>, BasicNotifierImpl.EObservableAdapterList
 
Nested classes/interfaces inherited from interface org.eclipse.emf.ecore.InternalEObject
InternalEObject.EStore
 
Field Summary
 
Fields inherited from class org.eclipse.emf.ecore.impl.EStoreEObjectImpl
ENO_SETTINGS, eSettings, eStore, EUNINITIALIZED_CONTAINER
 
Fields inherited from class org.eclipse.emf.ecore.impl.EObjectImpl
eAdapters, eContainer, eContainerFeatureID, EDELIVER, EDYNAMIC_CLASS, eFlags, ELAST_EOBJECT_FLAG, ELAST_NOTIFIER_FLAG, eProperties, EPROXY
 
Fields inherited from class org.eclipse.emf.ecore.impl.BasicEObjectImpl
EVIRTUAL_GET, EVIRTUAL_IS_SET, EVIRTUAL_NO_VALUE, EVIRTUAL_SET, EVIRTUAL_UNSET
 
Fields inherited from interface org.eclipse.emf.ecore.InternalEObject
EOPPOSITE_FEATURE_BASE
 
Fields inherited from interface org.eclipse.emf.ecore.EStructuralFeature.Internal.DynamicValueHolder
NIL
 
Constructor Summary
CDOObjectImpl()
           
 
Method Summary
protected  Object[] cdoBasicSettings()
           
 boolean cdoConflict()
          Returns true if this object contains local changes that are conflicting with recognized remote changes, false otherwise.
 CDOResourceImpl cdoDirectResource()
          Returns the directly containing resource of this object, or null if this object is not an element of the contents list of any CDO resource.
 CDOID cdoID()
          Returns the technical object identifier of this object, or null if the state of this object is TRANSIENT or INVALID.
 EStructuralFeature cdoInternalDynamicFeature(int dynamicFeatureID)
           
 InternalEObject cdoInternalInstance()
           
 void cdoInternalPostAttach()
           
 void cdoInternalPostDetach(boolean remote)
          It is really important for accessing the data to go through cdoStore().
 void cdoInternalPostInvalidate()
           
 void cdoInternalPostLoad()
           
 void cdoInternalPostRollback()
           
 void cdoInternalPreCommit()
           
 void cdoInternalPreLoad()
           
 void cdoInternalSetID(CDOID id)
           
 void cdoInternalSetResource(CDOResource resource)
           
 void cdoInternalSetRevision(CDORevision revision)
           
 CDOState cdoInternalSetState(CDOState state)
           
 void cdoInternalSetView(CDOView view)
           
 boolean cdoInvalid()
          Returns true if this object is considered as locally invalid (TODO Simon: please briefly explain what this state means) , false otherwise.
 CDOLockState cdoLockState()
          Returns the CDOLockState of this object.
 void cdoPrefetch(int depth)
          Ensures that the revisions of the contained objects up to the given depth are in the local revision cache.
 CDOLock cdoReadLock()
          Returns the read lock associated with this object.
 void cdoReload()
          TODO: JavaDoc
 CDOResourceImpl cdoResource()
          Returns the resource of this object, no matter where this object is located in the containment tree of that resource, or null if this object is not contained in a CDO resource.
 InternalCDORevision cdoRevision()
          Returns the revision of this object, or null if this object does currently not have a revision.
protected  Object[] cdoSettings()
           
 CDOState cdoState()
          Returns the local state of this object.
 InternalCDOView cdoView()
          Returns the view this object is associated with, or null if this object is not associated with a view.
 CDOLock cdoWriteLock()
          Returns the write lock associated with this object.
 CDOLock cdoWriteOption()
          Returns the write option associated with this object.
protected  FeatureMap createFeatureMap(EStructuralFeature eStructuralFeature)
           
protected  EList<?> createList(EStructuralFeature eStructuralFeature)
           
static CDOLock createLock(InternalCDOObject object, IRWLockManager.LockType type)
           
protected  CDOObjectImpl.CDOStoreEcoreEMap createMap(EStructuralFeature eStructuralFeature)
           
protected  CDOObjectImpl.CDOStoreUnorderedEList<Object> createUnorderedList(EStructuralFeature eStructuralFeature)
           
 Object dynamicGet(int dynamicFeatureID)
           
 void dynamicSet(int dynamicFeatureID, Object value)
           
 void dynamicUnset(int dynamicFeatureID)
           
 EList<Adapter> eAdapters()
           
protected  void eBasicSetContainer(InternalEObject newEContainer, int newContainerFeatureID)
           
 NotificationChain eBasicSetContainer(InternalEObject newContainer, int newContainerFeatureID, NotificationChain msgs)
          Code took from BasicEObjectImpl.eBasicSetContainer(org.eclipse.emf.ecore.InternalEObject, int) and modify it to detect when object are moved in the same context.
 int eContainerFeatureID()
           
 Resource.Internal eDirectResource()
           
protected  boolean eDynamicIsSet(int dynamicFeatureID, EStructuralFeature eFeature)
           
protected  void eInitializeContainer()
           
 InternalEObject eInternalContainer()
           
 Resource.Internal eInternalResource()
           
protected  boolean eIsCaching()
          Don't cache non-transient features in this CDOObject's EStoreEObjectImpl.eSettings().
 boolean equals(Object obj)
          Specializing the behaviour of equals(Object) is not permitted as per EObject specification.
protected  void eSetDirectResource(Resource.Internal resource)
           
 NotificationChain eSetResource(Resource.Internal resource, NotificationChain notifications)
          Code took from BasicEObjectImpl.eSetResource(org.eclipse.emf.ecore.resource.Resource.Internal, org.eclipse.emf.common.notify.NotificationChain) and modify it to detect when object are moved in the same context.
 InternalEObject.EStore eStore()
           
static CDOLockState getLockState(InternalCDOObject object)
           
 int hashCode()
          Specializing the behaviour of hashCode() is not permitted as per EObject specification.
static void instanceToRevisionFeature(InternalCDOView view, InternalCDOObject object, EStructuralFeature feature, Object setting)
           
static void revisionToInstanceFeature(InternalCDOObject instance, InternalCDORevision revision, EStructuralFeature eFeature)
           
 String toString()
           
 
Methods inherited from class org.eclipse.emf.ecore.impl.EStoreEObjectImpl
eDerivedStructuralFeatureID, eHasSettings, eProperties, eSetStore, eSettings, eStaticFeatureCount
 
Methods inherited from class org.eclipse.emf.ecore.impl.EObjectImpl
eBasicAdapters, eBasicProperties, eClass, eDeliver, eInvoke, eIsProxy, eSetClass, eSetDeliver, eSetProxyURI, eStaticClass
 
Methods inherited from class org.eclipse.emf.ecore.impl.BasicEObjectImpl
eAddVirtualValue, eAllContents, eBaseStructuralFeatureID, eBasicRemoveFromContainer, eBasicRemoveFromContainerFeature, eComputeVirtualValuesCapacity, eContainer, eContainerAdapterArray, eContainingFeature, eContainmentFeature, eContainmentFeature, eContains, eContents, eCrossReferences, eDerivedOperationID, eDerivedOperationID, eDerivedStructuralFeatureID, eDynamicBasicRemoveFromContainer, eDynamicClass, eDynamicFeature, eDynamicFeatureID, eDynamicGet, eDynamicGet, eDynamicGet, eDynamicInverseAdd, eDynamicInverseAdd, eDynamicInverseRemove, eDynamicInverseRemove, eDynamicInvoke, eDynamicInvoke, eDynamicIsSet, eDynamicIsSet, eDynamicSet, eDynamicSet, eDynamicSet, eDynamicUnset, eDynamicUnset, eDynamicUnset, eGet, eGet, eGet, eGet, eInverseAdd, eInverseAdd, eInverseRemove, eInverseRemove, eInvocationDelegate, eInvoke, eIsSet, eIsSet, eObjectForURIFragmentSegment, eOpenGet, eOpenIsSet, eOpenSet, eOpenUnset, eProxyURI, eRemoveVirtualValue, eResolveProxy, eResource, eSet, eSet, eSetting, eSettingDelegate, eSetVirtualIndexBits, eSetVirtualValue, eSetVirtualValues, eStaticOperationCount, eUnset, eUnset, eURIFragmentSegment, eVirtualBitCount, eVirtualGet, eVirtualGet, eVirtualIndex, eVirtualIndexBits, eVirtualIsSet, eVirtualSet, eVirtualUnset, eVirtualValue, eVirtualValues
 
Methods inherited from class org.eclipse.emf.common.notify.impl.BasicNotifierImpl
eBasicAdapterArray, eBasicHasAdapters, eNotificationRequired, eNotify
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.emf.ecore.InternalEObject
eBaseStructuralFeatureID, eBasicRemoveFromContainer, eDerivedOperationID, eDerivedStructuralFeatureID, eGet, eGet, eInverseAdd, eInverseRemove, eInvoke, eIsSet, eNotificationRequired, eObjectForURIFragmentSegment, eProxyURI, eResolveProxy, eSet, eSetClass, eSetProxyURI, eSetStore, eSetting, eUnset, eURIFragmentSegment
 
Methods inherited from interface org.eclipse.emf.ecore.EObject
eAllContents, eClass, eContainer, eContainingFeature, eContainmentFeature, eContents, eCrossReferences, eGet, eGet, eInvoke, eIsProxy, eIsSet, eResource, eSet, eUnset
 
Methods inherited from interface org.eclipse.emf.common.notify.Notifier
eDeliver, eNotify, eSetDeliver
 

Constructor Detail

CDOObjectImpl

public CDOObjectImpl()
Method Detail

cdoID

public CDOID cdoID()
Description copied from interface: CDOObject
Returns the technical object identifier of this object, or null if the state of this object is TRANSIENT or INVALID.

If the state of this object is NEW the returned CDOID instance can be cast to CDOIDTemp and is unique in the scope of the associated transaction. In all other states a non-null return value uniquely identifies a persistent object in the scope of the whole repository.

Specified by:
cdoID in interface CDOObject
Specified by:
cdoID in interface CDOWithID
See Also:
CDOObject.cdoState()

cdoState

public CDOState cdoState()
Description copied from interface: CDOObject
Returns the local state of this object.

Specified by:
cdoState in interface CDOObject

cdoRevision

public InternalCDORevision cdoRevision()
Description copied from interface: CDOObject
Returns the revision of this object, or null if this object does currently not have a revision. The revision is used to store all modeled data of this object, together with some technical data required by the framework.

Specified by:
cdoRevision in interface CDOObject
Specified by:
cdoRevision in interface InternalCDOObject
Since:
2.0

cdoView

public InternalCDOView cdoView()
Description copied from interface: CDOObject
Returns the view this object is associated with, or null if this object is not associated with a view. This view manages all aspects of this object and cahces it as long as required.

Specified by:
cdoView in interface CDOObject
Specified by:
cdoView in interface InternalCDOObject
Since:
2.0

cdoResource

public CDOResourceImpl cdoResource()
Description copied from interface: CDOObject
Returns the resource of this object, no matter where this object is located in the containment tree of that resource, or null if this object is not contained in a CDO resource.

This method may not return null return for objects that have no direct resource. Please note that, depending on the containment depth of this object, the evaluation of the resource can be a costly operation.

Specified by:
cdoResource in interface CDOObject
See Also:
CDOObject.cdoDirectResource()

cdoDirectResource

public CDOResourceImpl cdoDirectResource()
Description copied from interface: CDOObject
Returns the directly containing resource of this object, or null if this object is not an element of the contents list of any CDO resource.

Please note that, independend of the containment depth of this object, the evaluation of the direct resource is an operation with a constant cost.

Specified by:
cdoDirectResource in interface CDOObject
Since:
2.0

cdoPrefetch

public void cdoPrefetch(int depth)
Description copied from interface: CDOObject
Ensures that the revisions of the contained objects up to the given depth are in the local revision cache. Subsequent access to the respective contained objects will not lead to server round-trips after calling this method.

Specified by:
cdoPrefetch in interface CDOObject
Parameters:
depth - CDORevision.DEPTH_NONE, CDORevision.DEPTH_INFINITE or any other positive integer number.
Since:
3.0

cdoReload

public void cdoReload()
Description copied from interface: CDOObject
TODO: JavaDoc

Specified by:
cdoReload in interface CDOObject

cdoConflict

public boolean cdoConflict()
Description copied from interface: CDOObject
Returns true if this object contains local changes that are conflicting with recognized remote changes, false otherwise.

This method is a convenience method to determine whether the state of this object is either CONFLICT or INVALID_CONFLICT.

Specified by:
cdoConflict in interface CDOObject
Since:
2.0

cdoInvalid

public boolean cdoInvalid()
Description copied from interface: CDOObject
Returns true if this object is considered as locally invalid (TODO Simon: please briefly explain what this state means) , false otherwise.

This method is a convenience method to determine whether the state of this object is either INVALID or INVALID_CONFLICT.

Specified by:
cdoInvalid in interface CDOObject
Since:
2.0

cdoReadLock

public CDOLock cdoReadLock()
Description copied from interface: CDOObject
Returns the read lock associated with this object.

Specified by:
cdoReadLock in interface CDOObject
Returns:
Never null.
Since:
2.0

cdoWriteLock

public CDOLock cdoWriteLock()
Description copied from interface: CDOObject
Returns the write lock associated with this object.

Specified by:
cdoWriteLock in interface CDOObject
Returns:
Never null.
Since:
2.0

cdoWriteOption

public CDOLock cdoWriteOption()
Description copied from interface: CDOObject
Returns the write option associated with this object.

A write option is a lock that

  • is exclusive; i.e. can only be held by one view
  • prevents other views from obtaining a write lock on the same object
  • does not prevent other views from obtaining a read lock on the same object
  • It thus allows a view to ensure that it is the only that who will be able to obtain a write lock in the future, without preventing read locks to be obtained by others at this moment.

    Specified by:
    cdoWriteOption in interface CDOObject
    Since:
    4.1

    cdoLockState

    public CDOLockState cdoLockState()
    Description copied from interface: CDOObject
    Returns the CDOLockState of this object.

    Specified by:
    cdoLockState in interface CDOObject
    Since:
    4.1

    cdoInternalSetID

    public void cdoInternalSetID(CDOID id)
    Specified by:
    cdoInternalSetID in interface InternalCDOObject

    cdoInternalSetState

    public CDOState cdoInternalSetState(CDOState state)
    Specified by:
    cdoInternalSetState in interface InternalCDOObject

    cdoInternalSetRevision

    public void cdoInternalSetRevision(CDORevision revision)
    Specified by:
    cdoInternalSetRevision in interface InternalCDOObject
    Since:
    2.0

    cdoInternalSetView

    public void cdoInternalSetView(CDOView view)
    Specified by:
    cdoInternalSetView in interface InternalCDOObject
    Since:
    2.0

    cdoInternalSetResource

    public void cdoInternalSetResource(CDOResource resource)

    cdoInternalPreLoad

    public void cdoInternalPreLoad()
    Specified by:
    cdoInternalPreLoad in interface InternalCDOLoadable
    Since:
    2.0

    cdoInternalPostLoad

    public void cdoInternalPostLoad()
    Specified by:
    cdoInternalPostLoad in interface InternalCDOLoadable

    cdoInternalPostInvalidate

    public void cdoInternalPostInvalidate()
    Specified by:
    cdoInternalPostInvalidate in interface InternalCDOObject
    Since:
    2.0

    cdoInternalPostAttach

    public void cdoInternalPostAttach()
    Specified by:
    cdoInternalPostAttach in interface InternalCDOObject

    cdoInternalPostDetach

    public void cdoInternalPostDetach(boolean remote)
    It is really important for accessing the data to go through cdoStore(). eStore() will redirect you to the transient data.

    Specified by:
    cdoInternalPostDetach in interface InternalCDOObject
    Since:
    2.0

    cdoInternalPostRollback

    public void cdoInternalPostRollback()
    Specified by:
    cdoInternalPostRollback in interface InternalCDOObject
    Since:
    3.0

    cdoInternalPreCommit

    public void cdoInternalPreCommit()
    Specified by:
    cdoInternalPreCommit in interface InternalCDOObject

    cdoInternalInstance

    public InternalEObject cdoInternalInstance()
    Specified by:
    cdoInternalInstance in interface InternalCDOObject

    cdoInternalDynamicFeature

    public EStructuralFeature cdoInternalDynamicFeature(int dynamicFeatureID)
    Specified by:
    cdoInternalDynamicFeature in interface InternalCDOObject

    eAdapters

    public EList<Adapter> eAdapters()
    Specified by:
    eAdapters in interface Notifier
    Overrides:
    eAdapters in class EObjectImpl
    Since:
    2.0

    eDirectResource

    public Resource.Internal eDirectResource()
    Specified by:
    eDirectResource in interface InternalEObject
    Overrides:
    eDirectResource in class BasicEObjectImpl
    Since:
    2.0

    eInternalResource

    public Resource.Internal eInternalResource()
    Specified by:
    eInternalResource in interface InternalEObject
    Overrides:
    eInternalResource in class BasicEObjectImpl

    dynamicGet

    public Object dynamicGet(int dynamicFeatureID)
    Specified by:
    dynamicGet in interface EStructuralFeature.Internal.DynamicValueHolder
    Overrides:
    dynamicGet in class EStoreEObjectImpl

    dynamicSet

    public void dynamicSet(int dynamicFeatureID,
                           Object value)
    Specified by:
    dynamicSet in interface EStructuralFeature.Internal.DynamicValueHolder
    Overrides:
    dynamicSet in class EStoreEObjectImpl

    dynamicUnset

    public void dynamicUnset(int dynamicFeatureID)
    Specified by:
    dynamicUnset in interface EStructuralFeature.Internal.DynamicValueHolder
    Overrides:
    dynamicUnset in class EStoreEObjectImpl

    eDynamicIsSet

    protected boolean eDynamicIsSet(int dynamicFeatureID,
                                    EStructuralFeature eFeature)
    Overrides:
    eDynamicIsSet in class EStoreEObjectImpl
    Since:
    2.0

    eStore

    public InternalEObject.EStore eStore()
    Specified by:
    eStore in interface InternalEObject
    Overrides:
    eStore in class EStoreEObjectImpl
    Since:
    2.0

    eInternalContainer

    public InternalEObject eInternalContainer()
    Specified by:
    eInternalContainer in interface InternalEObject
    Overrides:
    eInternalContainer in class EStoreEObjectImpl

    eContainerFeatureID

    public int eContainerFeatureID()
    Specified by:
    eContainerFeatureID in interface InternalEObject
    Overrides:
    eContainerFeatureID in class EStoreEObjectImpl

    eBasicSetContainer

    public NotificationChain eBasicSetContainer(InternalEObject newContainer,
                                                int newContainerFeatureID,
                                                NotificationChain msgs)
    Code took from BasicEObjectImpl.eBasicSetContainer(org.eclipse.emf.ecore.InternalEObject, int) and modify it to detect when object are moved in the same context. (E.g.: An object is moved from resA to resB. resA and resB belongs to the same CDORepositoryInfo. Without this special handling, a detach and newObject will be generated for the object moved)

    Specified by:
    eBasicSetContainer in interface InternalEObject
    Overrides:
    eBasicSetContainer in class BasicEObjectImpl
    Since:
    2.0

    eSetResource

    public NotificationChain eSetResource(Resource.Internal resource,
                                          NotificationChain notifications)
    Code took from BasicEObjectImpl.eSetResource(org.eclipse.emf.ecore.resource.Resource.Internal, org.eclipse.emf.common.notify.NotificationChain) and modify it to detect when object are moved in the same context.

    Specified by:
    eSetResource in interface InternalEObject
    Overrides:
    eSetResource in class BasicEObjectImpl
    Since:
    2.0

    hashCode

    public final int hashCode()
    Specializing the behaviour of hashCode() is not permitted as per EObject specification.

    Overrides:
    hashCode in class Object

    equals

    public final boolean equals(Object obj)
    Specializing the behaviour of equals(Object) is not permitted as per EObject specification.

    Overrides:
    equals in class Object

    toString

    public String toString()
    Overrides:
    toString in class BasicEObjectImpl

    cdoSettings

    protected Object[] cdoSettings()
    Since:
    2.0

    cdoBasicSettings

    protected Object[] cdoBasicSettings()
    Since:
    2.0

    createFeatureMap

    protected FeatureMap createFeatureMap(EStructuralFeature eStructuralFeature)
    Overrides:
    createFeatureMap in class EStoreEObjectImpl

    createMap

    protected CDOObjectImpl.CDOStoreEcoreEMap createMap(EStructuralFeature eStructuralFeature)
    Since:
    4.1

    createUnorderedList

    protected CDOObjectImpl.CDOStoreUnorderedEList<Object> createUnorderedList(EStructuralFeature eStructuralFeature)
    Since:
    4.1

    createList

    protected EList<?> createList(EStructuralFeature eStructuralFeature)
    Overrides:
    createList in class EStoreEObjectImpl

    eInitializeContainer

    protected void eInitializeContainer()
    Overrides:
    eInitializeContainer in class EStoreEObjectImpl

    eSetDirectResource

    protected void eSetDirectResource(Resource.Internal resource)
    Overrides:
    eSetDirectResource in class BasicEObjectImpl

    eIsCaching

    protected boolean eIsCaching()
    Don't cache non-transient features in this CDOObject's EStoreEObjectImpl.eSettings().

    Overrides:
    eIsCaching in class EStoreEObjectImpl

    eBasicSetContainer

    protected void eBasicSetContainer(InternalEObject newEContainer,
                                      int newContainerFeatureID)
    Overrides:
    eBasicSetContainer in class EObjectImpl

    revisionToInstanceFeature

    public static void revisionToInstanceFeature(InternalCDOObject instance,
                                                 InternalCDORevision revision,
                                                 EStructuralFeature eFeature)
    Since:
    2.0

    instanceToRevisionFeature

    public static void instanceToRevisionFeature(InternalCDOView view,
                                                 InternalCDOObject object,
                                                 EStructuralFeature feature,
                                                 Object setting)
    Since:
    3.0

    createLock

    public static CDOLock createLock(InternalCDOObject object,
                                     IRWLockManager.LockType type)
    Since:
    4.1

    getLockState

    public static CDOLockState getLockState(InternalCDOObject object)
    Since:
    4.1


    Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.