Package org.eclipse.emf.cdo.util
Class CDOUtil
java.lang.Object
org.eclipse.emf.cdo.util.CDOUtil
Various static methods that may help in CDO client applications.
- Author:
- Eike Stepper
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcleanStaleReference(EObject eObject, EStructuralFeature eFeature) static voidcleanStaleReference(EObject eObject, EStructuralFeature eFeature, int index) static voidconfigureView(CDOView view) static CDOBranchcreateBranch(CDOBranchPoint base, String name) static CDOCollectionLoadingPolicycreateCollectionLoadingPolicy(int initialChunkSize, int resolveChunkSize) static CDOFeatureAnalyzerstatic CDORevisionPrefetchingPolicycreateRevisionPrefetchingPolicy(int chunkSize) static CDOFetchRuleManagerstatic CDOFeatureAnalyzerstatic CDOFeatureAnalyzercreateUIFeatureAnalyzer(long maxTimeBetweenOperation) static CDOXATransactioncreateXATransaction(Notifier... notifiers) filterReadables(Collection<T> collection) static StringgetAnnotation(ModelElement modelElement, String sourceURI, String key) static CDOObjectgetCDOObject(EObject object) static CDOObjectgetCDOObject(EObject object, boolean adaptLegacy) getCDOObjects(Collection<? extends EObject> objects) getCDOObjects(EObject... objects) static StringgetDocumentation(ModelElement modelElement) static EObjectgetEObject(EObject object) getIntrinsicIDToEObjectMap(CDOResource resource) Returns the map used to cache the EObject that is identified by thevalueof its ID feature.static CDOBranchPointRangegetLifetime(CDOObject object) getResources(ResourceSet resourceSet) static CDORevisiongetRevisionByVersion(CDOObject object, int version) static CDORevisiongetRevisionByVersion(CDOObject object, CDOBranch branch, int version) static CDORevisionDeltagetRevisionDelta(CDOObject object) static CDOSessiongetSession(Object object) static CDOViewstatic CDOViewgetView(ResourceSet resourceSet, URI uri) static CDOViewSetgetViewSet(Notifier notifier) static CDOXATransactiongetXATransaction(CDOViewSet viewSet) static booleanisCDOObject(EObject object) static booleanDeprecated.As of 4.0 use CDOView.isInvalidationRunnerActive()static booleanDeprecated.As of 4.2 the legacy mode is always enabled.static booleanisLegacyObject(EObject object) static booleanisReadable(EObject object) static booleanisSessionDirty(CDOSession session) static booleanisStaleObject(Object object) static booleanisWritable(EObject object) static booleanisWritableObject(EObject eObject) Queries whether an object is writable (is permitted to be modified in the current view context).static voidstatic InputStreamopenInputStream(CDOLob<?> lob, String encoding) static InputStreamstatic booleanprepareDynamicEPackage(EPackage startPackage) static booleanstatic AnnotationsetAnnotation(ModelElement modelElement, String sourceURI, String key, String value) static voidsetCredentialsProvider(URI uri, org.eclipse.net4j.util.security.IPasswordCredentialsProvider provider) static AnnotationsetDocumentation(ModelElement modelElement, String value) static voidsetIntrinsicIDToEObjectMap(CDOResource resource, Map<String, EObject> intrinsicIDToEObjectMap) Sets the map used to cache the EObject identified by the value of its ID feature.static voidsetLegacyModeDefault(boolean on) Deprecated.As of 4.2 the legacy mode is always enabled.static voidsetNextViewLock(Lock viewLock) Sets thelockto be used for the next view that is opened in the context of the current thread.static CDOObjectwrapExternalObject(EObject object, CDOView view)
-
Field Details
-
PROP_VIEW_CONFIGURATOR
- Since:
- 4.14
- See Also:
-
PROP_VIEW_CONFIGURATOR_TYPE
- Since:
- 4.14
- See Also:
-
PROP_VIEW_CONFIGURATOR_DESCRIPTION
- Since:
- 4.14
- See Also:
-
CDO_ANNOTATION_URI
- Since:
- 4.3
- See Also:
-
DOCUMENTATION_KEY
- Since:
- 4.3
- See Also:
-
-
Method Details
-
registerResourceFactory
- Since:
- 4.0
-
getIntrinsicIDToEObjectMap
Returns the map used to cache the EObject that is identified by thevalueof its ID feature.- Returns:
- the map used to cache the EObject that is identified by the value of its ID feature.
- Since:
- 4.2
- See Also:
-
setIntrinsicIDToEObjectMap
public static void setIntrinsicIDToEObjectMap(CDOResource resource, Map<String, EObject> intrinsicIDToEObjectMap) Sets the map used to cache the EObject identified by the value of its ID feature. This cache is only activated if the map is notnull. The map will be lazily loaded by thegetEObjectByIDmethod. It is up to the client to clear the cache when it becomes invalid, e.g., when the ID of a previously mapped EObject is changed.- Parameters:
intrinsicIDToEObjectMap- the new map ornull.- Since:
- 4.2
- See Also:
-
getSession
- Since:
- 3.0
-
setNextViewLock
Sets thelockto be used for the next view that is opened in the context of the current thread.This method is useful, for example, if EMF
adapterscallDisplay.syncExec()in response to CDO notifications. In these cases aDelegableReentrantLockcan be injected into the newview, which does not deadlock when both CDO's invalidation thread and the display thread acquire the view lock.This method involves a
ThreadLocalvariable to avoid method explosion inCDOViewContainerandCDOTransactionContainer. After calling this method make sure to either open a newviewfrom the current thread or callsetNextViewLock(null)to clear theThreadLocalvariable.- Since:
- 4.5
- See Also:
-
configureView
- Since:
- 4.4
-
prepareDynamicEPackage
- Since:
- 2.0
-
createCollectionLoadingPolicy
public static CDOCollectionLoadingPolicy createCollectionLoadingPolicy(int initialChunkSize, int resolveChunkSize) - Since:
- 2.0
-
createRevisionPrefetchingPolicy
- Since:
- 2.0
-
createThreadLocalFetchRuleManager
- Since:
- 4.1
-
createModelBasedFeatureAnalyzer
- Since:
- 4.1
-
createUIFeatureAnalyzer
- Since:
- 4.1
-
createUIFeatureAnalyzer
- Since:
- 4.1
-
createXATransaction
- Since:
- 4.0
-
getXATransaction
- Since:
- 2.0
-
getViewSet
- Since:
- 4.0
-
getView
- Since:
- 4.4
-
getView
- Since:
- 4.4
-
isStaleObject
- Since:
- 3.0
-
cleanStaleReference
- Since:
- 3.0
-
cleanStaleReference
- Since:
- 3.0
-
load
- Since:
- 2.0
-
wrapExternalObject
- Since:
- 4.2
-
isReadable
- Since:
- 4.23
-
isWritable
- Since:
- 4.23
-
getEObject
- Since:
- 2.0
-
getCDOObject
- Since:
- 2.0
-
getCDOObject
- Since:
- 4.4
-
getCDOObjects
- Since:
- 4.6
-
getCDOObjects
- Since:
- 4.6
-
isCDOObject
- Since:
- 4.4
-
createBranch
- Since:
- 4.6
-
filterReadables
- Since:
- 4.3
-
getRevisionDelta
- Since:
- 4.20
-
getLifetime
- Since:
- 4.4
-
getRevisionByVersion
- Since:
- 2.0
-
getRevisionByVersion
- Since:
- 3.0
-
getResources
- Since:
- 2.0
-
isSessionDirty
- Since:
- 2.0
- See Also:
-
isInvalidationRunnerActive
Deprecated.As of 4.0 use CDOView.isInvalidationRunnerActive()- Since:
- 3.0
-
isWritableObject
Queries whether an object is writable (is permitted to be modified in the current view context).- Parameters:
eObject- an object- Returns:
falseif theeObjectis managed by CDO and does not have write permission;true, otherwise- Since:
- 4.3
-
isLegacyObject
- Since:
- 3.0
-
isLegacyModeDefault
Deprecated.As of 4.2 the legacy mode is always enabled.- Since:
- 3.0
-
setLegacyModeDefault
Deprecated.As of 4.2 the legacy mode is always enabled.- Since:
- 3.0
-
setCredentialsProvider
public static void setCredentialsProvider(URI uri, org.eclipse.net4j.util.security.IPasswordCredentialsProvider provider) - Since:
- 4.0
-
getAnnotation
- Since:
- 4.3
-
setAnnotation
public static Annotation setAnnotation(ModelElement modelElement, String sourceURI, String key, String value) - Since:
- 4.3
-
getDocumentation
- Since:
- 4.3
-
setDocumentation
- Since:
- 4.3
-
openInputStream
- Throws:
IOException- Since:
- 4.13
-
openInputStream
- Throws:
IOException- Since:
- 4.13
-