Package org.eclipse.emf.cdo.util
Class CDOUtil
- java.lang.Object
- 
- org.eclipse.emf.cdo.util.CDOUtil
 
- 
 public final class CDOUtil extends java.lang.ObjectVarious static methods that may help in CDO client applications.- Author:
- Eike Stepper
 
- 
- 
Field SummaryFields Modifier and Type Field Description static java.lang.StringCDO_ANNOTATION_URIstatic java.lang.StringDOCUMENTATION_KEYstatic java.lang.StringPROP_VIEW_CONFIGURATORstatic java.lang.StringPROP_VIEW_CONFIGURATOR_DESCRIPTIONstatic java.lang.StringPROP_VIEW_CONFIGURATOR_TYPE
 - 
Method SummaryAll Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static voidcleanStaleReference(org.eclipse.emf.ecore.EObject eObject, org.eclipse.emf.ecore.EStructuralFeature eFeature)static voidcleanStaleReference(org.eclipse.emf.ecore.EObject eObject, org.eclipse.emf.ecore.EStructuralFeature eFeature, int index)static voidconfigureView(CDOView view)static CDOBranchcreateBranch(CDOBranchPoint base, java.lang.String name)static CDOCollectionLoadingPolicycreateCollectionLoadingPolicy(int initialChunkSize, int resolveChunkSize)static CDOFeatureAnalyzercreateModelBasedFeatureAnalyzer()static CDORevisionPrefetchingPolicycreateRevisionPrefetchingPolicy(int chunkSize)static CDOFetchRuleManagercreateThreadLocalFetchRuleManager()static CDOFeatureAnalyzercreateUIFeatureAnalyzer()static CDOFeatureAnalyzercreateUIFeatureAnalyzer(long maxTimeBetweenOperation)static CDOXATransactioncreateXATransaction(org.eclipse.emf.common.notify.Notifier... notifiers)static <T extends org.eclipse.emf.ecore.EObject>
 org.eclipse.emf.common.util.EList<T>filterReadables(java.util.Collection<T> collection)static java.lang.StringgetAnnotation(ModelElement modelElement, java.lang.String sourceURI, java.lang.String key)static CDOObjectgetCDOObject(org.eclipse.emf.ecore.EObject object)static CDOObjectgetCDOObject(org.eclipse.emf.ecore.EObject object, boolean adaptLegacy)static java.util.List<? extends CDOObject>getCDOObjects(java.util.Collection<? extends org.eclipse.emf.ecore.EObject> objects)static java.util.List<? extends CDOObject>getCDOObjects(org.eclipse.emf.ecore.EObject... objects)static java.lang.StringgetDocumentation(ModelElement modelElement)static org.eclipse.emf.ecore.EObjectgetEObject(org.eclipse.emf.ecore.EObject object)static java.util.Map<java.lang.String,org.eclipse.emf.ecore.EObject>getIntrinsicIDToEObjectMap(CDOResource resource)Returns the map used to cache the EObject that is identified by thevalueof its ID feature.static CDOBranchPointRangegetLifetime(CDOObject object)static org.eclipse.emf.common.util.EList<org.eclipse.emf.ecore.resource.Resource>getResources(org.eclipse.emf.ecore.resource.ResourceSet resourceSet)static CDORevisiongetRevisionByVersion(CDOObject object, int version)static CDORevisiongetRevisionByVersion(CDOObject object, CDOBranch branch, int version)static CDOSessiongetSession(java.lang.Object object)static CDOViewgetView(org.eclipse.emf.common.notify.Notifier notifier)static CDOViewgetView(org.eclipse.emf.ecore.resource.ResourceSet resourceSet, org.eclipse.emf.common.util.URI uri)static CDOViewSetgetViewSet(org.eclipse.emf.common.notify.Notifier notifier)static CDOXATransactiongetXATransaction(CDOViewSet viewSet)static booleanisCDOObject(org.eclipse.emf.ecore.EObject object)static booleanisInvalidationRunnerActive()Deprecated.As of 4.0 use CDOView.isInvalidationRunnerActive()static booleanisLegacyModeDefault()Deprecated.As of 4.2 the legacy mode is always enabled.static booleanisLegacyObject(org.eclipse.emf.ecore.EObject object)static booleanisSessionDirty(CDOSession session)static booleanisStaleObject(java.lang.Object object)static booleanisWritableObject(org.eclipse.emf.ecore.EObject eObject)Queries whether an object is writable (is permitted to be modified in the current view context).static voidload(org.eclipse.emf.ecore.EObject eObject, CDOView view)static java.io.InputStreamopenInputStream(CDOLob<?> lob, java.lang.String encoding)static java.io.InputStreamopenInputStream(CDOResourceLeaf leaf)static booleanprepareDynamicEPackage(org.eclipse.emf.ecore.EPackage startPackage)static booleanregisterResourceFactory(org.eclipse.emf.ecore.resource.Resource.Factory.Registry registry)static AnnotationsetAnnotation(ModelElement modelElement, java.lang.String sourceURI, java.lang.String key, java.lang.String value)static voidsetCredentialsProvider(org.eclipse.emf.common.util.URI uri, org.eclipse.net4j.util.security.IPasswordCredentialsProvider provider)static AnnotationsetDocumentation(ModelElement modelElement, java.lang.String value)static voidsetIntrinsicIDToEObjectMap(CDOResource resource, java.util.Map<java.lang.String,org.eclipse.emf.ecore.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(java.util.concurrent.locks.Lock viewLock)Sets thelockto be used for the next view that is opened in the context of the current thread.static CDOObjectwrapExternalObject(org.eclipse.emf.ecore.EObject object, CDOView view)
 
- 
- 
- 
Field Detail- 
PROP_VIEW_CONFIGURATORpublic static final java.lang.String PROP_VIEW_CONFIGURATOR - Since:
- 4.14
- See Also:
- Constant Field Values
 
 - 
PROP_VIEW_CONFIGURATOR_TYPEpublic static final java.lang.String PROP_VIEW_CONFIGURATOR_TYPE - Since:
- 4.14
- See Also:
- Constant Field Values
 
 - 
PROP_VIEW_CONFIGURATOR_DESCRIPTIONpublic static final java.lang.String PROP_VIEW_CONFIGURATOR_DESCRIPTION - Since:
- 4.14
- See Also:
- Constant Field Values
 
 - 
CDO_ANNOTATION_URIpublic static final java.lang.String CDO_ANNOTATION_URI - Since:
- 4.3
- See Also:
- Constant Field Values
 
 - 
DOCUMENTATION_KEYpublic static final java.lang.String DOCUMENTATION_KEY - Since:
- 4.3
- See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
registerResourceFactorypublic static boolean registerResourceFactory(org.eclipse.emf.ecore.resource.Resource.Factory.Registry registry) - Since:
- 4.0
 
 - 
getIntrinsicIDToEObjectMappublic static java.util.Map<java.lang.String,org.eclipse.emf.ecore.EObject> getIntrinsicIDToEObjectMap(CDOResource resource) 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(org.eclipse.emf.cdo.eresource.CDOResource, java.util.Map<java.lang.String, org.eclipse.emf.ecore.EObject>)
 
 - 
setIntrinsicIDToEObjectMappublic static void setIntrinsicIDToEObjectMap(CDOResource resource, java.util.Map<java.lang.String,org.eclipse.emf.ecore.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 or- null.
- Since:
- 4.2
- See Also:
- getIntrinsicIDToEObjectMap(org.eclipse.emf.cdo.eresource.CDOResource)
 
 - 
getSessionpublic static CDOSession getSession(java.lang.Object object) - Since:
- 3.0
 
 - 
setNextViewLockpublic static void setNextViewLock(java.util.concurrent.locks.Lock viewLock) 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:
- CDOSession.Options.setDelegableViewLockEnabled(boolean)
 
 - 
configureViewpublic static void configureView(CDOView view) - Since:
- 4.4
 
 - 
prepareDynamicEPackagepublic static boolean prepareDynamicEPackage(org.eclipse.emf.ecore.EPackage startPackage) - Since:
- 2.0
 
 - 
createCollectionLoadingPolicypublic static CDOCollectionLoadingPolicy createCollectionLoadingPolicy(int initialChunkSize, int resolveChunkSize) - Since:
- 2.0
 
 - 
createRevisionPrefetchingPolicypublic static CDORevisionPrefetchingPolicy createRevisionPrefetchingPolicy(int chunkSize) - Since:
- 2.0
 
 - 
createThreadLocalFetchRuleManagerpublic static CDOFetchRuleManager createThreadLocalFetchRuleManager() - Since:
- 4.1
 
 - 
createModelBasedFeatureAnalyzerpublic static CDOFeatureAnalyzer createModelBasedFeatureAnalyzer() - Since:
- 4.1
 
 - 
createUIFeatureAnalyzerpublic static CDOFeatureAnalyzer createUIFeatureAnalyzer() - Since:
- 4.1
 
 - 
createUIFeatureAnalyzerpublic static CDOFeatureAnalyzer createUIFeatureAnalyzer(long maxTimeBetweenOperation) - Since:
- 4.1
 
 - 
createXATransactionpublic static CDOXATransaction createXATransaction(org.eclipse.emf.common.notify.Notifier... notifiers) - Since:
- 4.0
 
 - 
getXATransactionpublic static CDOXATransaction getXATransaction(CDOViewSet viewSet) - Since:
- 2.0
 
 - 
getViewSetpublic static CDOViewSet getViewSet(org.eclipse.emf.common.notify.Notifier notifier) - Since:
- 4.0
 
 - 
getViewpublic static CDOView getView(org.eclipse.emf.common.notify.Notifier notifier) - Since:
- 4.4
 
 - 
getViewpublic static CDOView getView(org.eclipse.emf.ecore.resource.ResourceSet resourceSet, org.eclipse.emf.common.util.URI uri) - Since:
- 4.4
 
 - 
isStaleObjectpublic static boolean isStaleObject(java.lang.Object object) - Since:
- 3.0
 
 - 
cleanStaleReferencepublic static void cleanStaleReference(org.eclipse.emf.ecore.EObject eObject, org.eclipse.emf.ecore.EStructuralFeature eFeature)- Since:
- 3.0
 
 - 
cleanStaleReferencepublic static void cleanStaleReference(org.eclipse.emf.ecore.EObject eObject, org.eclipse.emf.ecore.EStructuralFeature eFeature, int index)- Since:
- 3.0
 
 - 
loadpublic static void load(org.eclipse.emf.ecore.EObject eObject, CDOView view)- Since:
- 2.0
 
 - 
wrapExternalObjectpublic static CDOObject wrapExternalObject(org.eclipse.emf.ecore.EObject object, CDOView view) - Since:
- 4.2
 
 - 
getEObjectpublic static org.eclipse.emf.ecore.EObject getEObject(org.eclipse.emf.ecore.EObject object) - Since:
- 2.0
 
 - 
getCDOObjectpublic static CDOObject getCDOObject(org.eclipse.emf.ecore.EObject object) - Since:
- 2.0
 
 - 
getCDOObjectpublic static CDOObject getCDOObject(org.eclipse.emf.ecore.EObject object, boolean adaptLegacy) - Since:
- 4.4
 
 - 
getCDOObjectspublic static java.util.List<? extends CDOObject> getCDOObjects(org.eclipse.emf.ecore.EObject... objects) - Since:
- 4.6
 
 - 
getCDOObjectspublic static java.util.List<? extends CDOObject> getCDOObjects(java.util.Collection<? extends org.eclipse.emf.ecore.EObject> objects) - Since:
- 4.6
 
 - 
isCDOObjectpublic static boolean isCDOObject(org.eclipse.emf.ecore.EObject object) - Since:
- 4.4
 
 - 
createBranchpublic static CDOBranch createBranch(CDOBranchPoint base, java.lang.String name) - Since:
- 4.6
 
 - 
filterReadablespublic static <T extends org.eclipse.emf.ecore.EObject> org.eclipse.emf.common.util.EList<T> filterReadables(java.util.Collection<T> collection) - Since:
- 4.3
 
 - 
getLifetimepublic static CDOBranchPointRange getLifetime(CDOObject object) - Since:
- 4.4
 
 - 
getRevisionByVersionpublic static CDORevision getRevisionByVersion(CDOObject object, int version) - Since:
- 2.0
 
 - 
getRevisionByVersionpublic static CDORevision getRevisionByVersion(CDOObject object, CDOBranch branch, int version) - Since:
- 3.0
 
 - 
getResourcespublic static org.eclipse.emf.common.util.EList<org.eclipse.emf.ecore.resource.Resource> getResources(org.eclipse.emf.ecore.resource.ResourceSet resourceSet) - Since:
- 2.0
 
 - 
isSessionDirtypublic static boolean isSessionDirty(CDOSession session) - Since:
- 2.0
- See Also:
- CDOTransaction
 
 - 
isInvalidationRunnerActive@Deprecated public static boolean isInvalidationRunnerActive() Deprecated.As of 4.0 use CDOView.isInvalidationRunnerActive()- Since:
- 3.0
 
 - 
isWritableObjectpublic static boolean isWritableObject(org.eclipse.emf.ecore.EObject eObject) Queries whether an object is writable (is permitted to be modified in the current view context).- Parameters:
- eObject- an object
- Returns:
- falseif the- eObjectis managed by CDO and does not have write permission;- true, otherwise
- Since:
- 4.3
 
 - 
isLegacyObjectpublic static boolean isLegacyObject(org.eclipse.emf.ecore.EObject object) - Since:
- 3.0
 
 - 
isLegacyModeDefault@Deprecated public static boolean isLegacyModeDefault() Deprecated.As of 4.2 the legacy mode is always enabled.- Since:
- 3.0
 
 - 
setLegacyModeDefault@Deprecated public static void setLegacyModeDefault(boolean on) Deprecated.As of 4.2 the legacy mode is always enabled.- Since:
- 3.0
 
 - 
setCredentialsProviderpublic static void setCredentialsProvider(org.eclipse.emf.common.util.URI uri, org.eclipse.net4j.util.security.IPasswordCredentialsProvider provider)- Since:
- 4.0
 
 - 
getAnnotationpublic static java.lang.String getAnnotation(ModelElement modelElement, java.lang.String sourceURI, java.lang.String key) - Since:
- 4.3
 
 - 
setAnnotationpublic static Annotation setAnnotation(ModelElement modelElement, java.lang.String sourceURI, java.lang.String key, java.lang.String value) - Since:
- 4.3
 
 - 
getDocumentationpublic static java.lang.String getDocumentation(ModelElement modelElement) - Since:
- 4.3
 
 - 
setDocumentationpublic static Annotation setDocumentation(ModelElement modelElement, java.lang.String value) - Since:
- 4.3
 
 - 
openInputStreampublic static java.io.InputStream openInputStream(CDOResourceLeaf leaf) throws java.io.IOException - Throws:
- java.io.IOException
- Since:
- 4.13
 
 - 
openInputStreampublic static java.io.InputStream openInputStream(CDOLob<?> lob, java.lang.String encoding) throws java.io.IOException - Throws:
- java.io.IOException
- Since:
- 4.13
 
 
- 
 
-