public class BatchLinkableResource extends DerivedStateAwareResource implements ISynchronizable<BatchLinkableResource>, IBatchLinkableResource
getEObject(String)
, the BatchLinkingService
is used
to resolve a chunk of proxies.LazyLinkingResource.CyclicLinkingException, LazyLinkingResource.DiagnosticMessageContext
org.eclipse.emf.ecore.resource.impl.ResourceImpl.ContentsEList<E extends java.lang.Object & org.eclipse.emf.ecore.EObject>, org.eclipse.emf.ecore.resource.impl.ResourceImpl.ModificationTrackingAdapter
org.eclipse.emf.common.notify.impl.BasicNotifierImpl.EAdapterList<E extends java.lang.Object & org.eclipse.emf.common.notify.Adapter>, org.eclipse.emf.common.notify.impl.BasicNotifierImpl.EObservableAdapterList
org.eclipse.emf.ecore.resource.Resource.Diagnostic, org.eclipse.emf.ecore.resource.Resource.Factory, org.eclipse.emf.ecore.resource.Resource.Internal, org.eclipse.emf.ecore.resource.Resource.IOWrappedException
fullyInitialized, isInitializing
UNRESOLVABLE_FRAGMENT
resolving, UNRESOLVEABLE_PROXIES_KEY
isUpdating, operationCanceledManager, OPTION_ENCODING, OPTION_FORMAT, OPTION_RESOLVE_ALL, OPTION_SERIALIZATION_OPTIONS
contents, defaultDeleteOptions, defaultLoadOptions, defaultSaveOptions, errors, intrinsicIDToEObjectMap, isLoaded, isLoading, isModified, modificationTrackingAdapter, resourceSet, timeStamp, unloadingContents, uri, warnings
eAdapters, EDELIVER, eFlags, ELAST_NOTIFIER_FLAG
OPTION_CIPHER, OPTION_LINE_DELIMITER, OPTION_LINE_DELIMITER_UNSPECIFIED, OPTION_SAVE_ONLY_IF_CHANGED, OPTION_SAVE_ONLY_IF_CHANGED_FILE_BUFFER, OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER, OPTION_ZIP, RESOURCE__CONTENTS, RESOURCE__ERRORS, RESOURCE__IS_LOADED, RESOURCE__IS_MODIFIED, RESOURCE__IS_TRACKING_MODIFICATION, RESOURCE__RESOURCE_SET, RESOURCE__TIME_STAMP, RESOURCE__URI, RESOURCE__WARNINGS
Constructor and Description |
---|
BatchLinkableResource() |
Modifier and Type | Method and Description |
---|---|
<Result> Result |
execute(IUnitOfWork<Result,? super BatchLinkableResource> unit)
Execute the unit of work in a context that allows for modification.
|
org.eclipse.emf.common.util.EList<org.eclipse.emf.ecore.EObject> |
getContents()
As soon as an external client tries to access the content of the resource,
the
derived state will be added to the content of this resource. |
org.eclipse.emf.ecore.EObject |
getEObject(java.lang.String uriFragment)
Delegates to the
BatchLinkingService if the requested reference is
linkeable in batch mode . |
java.lang.Object |
getLock()
Returns the lock of the owning
ResourceSet , if it exposes such a lock. |
protected org.eclipse.emf.ecore.EObject |
handleCyclicResolution(Triple<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EReference,INode> triple) |
void |
linkBatched(CancelIndicator monitor) |
void |
resolveLazyCrossReferences(CancelIndicator monitor)
Delegates to the BatchLinkingService to resolve all references.
|
clearInternalState, discardDerivedState, doGetContents, doUnload, getEObjectForURIFragmentRootSegment, getUnloadingContents, getURIFragmentRootSegment, installDerivedState, isFullyInitialized, isInitializing, setDerivedStateComputer, updateInternalState, updateInternalState
getPortableURIs, getResourceDescription, getResourceStorageFacade, getUnresolvableURIFragments, isLoadedFromStorage, load, load, setIsLoadedFromStorage, setResourceDescription
addLazyProxyInformation, clearLazyProxyInformation, createAndAddDiagnostic, createAndAddDiagnostic, createDiagnostic, createDiagnosticMessage, createDiagnosticMessageContext, doLinking, doLoad, doResolveLazyCrossReference, getDiagnosticList, getDiagnosticMessageProvider, getEncoder, getEObject, getLazyProxyInformation, getLinkingHelper, getLinkingService, getReferences, hasLazyProxyInformation, isEagerLinking, isPotentialLazyCrossReference, isUnresolveableProxyCacheable, markUnresolvable, removeDiagnostic, removeLazyProxyInformation, resolveLazyCrossReference, setDiagnosticMessageProvider, setEagerLinking, setEncoder, setLinkingHelper, setLinkingService
addSyntaxDiagnostic, addSyntaxErrors, basicGetEObject, clearErrorsAndWarnings, createReader, doSave, getCache, getConcreteSyntaxValidator, getEncoding, getFragmentProvider, getLanguageName, getLinker, getModificationStamp, getParser, getParseResult, getResourceServiceProvider, getSerializer, getUnloader, getURIFragment, isValidationDisabled, reattachModificationTracker, reparse, setCache, setEncodingFromOptions, setFragmentProvider, setInjectedParser, setLanguageName, setLinker, setModificationStamp, setParser, setParseResult, setResourceServiceProvider, setSerializer, setUnloader, setValidationDisabled, unload, update, validateConcreteSyntax
addModificationTrackingAdapters, attached, attachedHelper, basicSetResourceSet, createModificationTrackingAdapter, delete, detached, detachedHelper, getAllContents, getAllProperContents, getAllProperContents, getDefaultURIConverter, getEObject, getEObjectByID, getErrors, getIntrinsicIDToEObjectMap, getResourceSet, getTimeStamp, getURI, getURIConverter, getWarnings, handleLoadResponse, handleSaveResponse, isAttachedDetachedHelperRequired, isContentZipEntry, isLoaded, isLoading, isModified, isTrackingModification, load, mergeMaps, newContentZipEntry, removeModificationTrackingAdapters, save, save, saveOnlyIfChangedWithFileBuffer, saveOnlyIfChangedWithMemoryBuffer, setIntrinsicIDToEObjectMap, setLoaded, setModified, setTimeStamp, setTrackingModification, setURI, toKeyString, toString, unload, unloaded, useZip
eAdapters, eBasicAdapters, eDeliver, eSetDeliver
eBasicAdapterArray, eBasicHasAdapters, eNotificationRequired, eNotify
public java.lang.Object getLock()
ResourceSet
, if it exposes such a lock.
Otherwise this resource itself is used as the lock context.getLock
in interface ISynchronizable<BatchLinkableResource>
public <Result> Result execute(IUnitOfWork<Result,? super BatchLinkableResource> unit) throws java.lang.Exception
execute
in interface ISynchronizable<BatchLinkableResource>
unit
- the action to perform. May not be null
java.lang.Exception
- the exception that was thrown by the unit.public org.eclipse.emf.ecore.EObject getEObject(java.lang.String uriFragment)
BatchLinkingService
if the requested reference is
linkeable in batch mode
.
Implementation detail: This specialization of getEObject
synchronizes on the lock
which is exposed by the synchronizable
resource rather than on the resource directly. This guards against reentrant resolution
from different threads that could block each other.
Usually one would want to lock only in the BatchLinkingService
but we could
have intermixed lazy cross reference
and vanilla EMF cross references which again could lead to a
dead lock.getEObject
in interface org.eclipse.emf.ecore.resource.Resource
getEObject
in class StorageAwareResource
public org.eclipse.emf.common.util.EList<org.eclipse.emf.ecore.EObject> getContents()
As soon as an external client tries to access the content of the resource,
the derived state
will be added to the content of this resource.
Implementation detail: Overridden to use the shared lock
.
getContents
in interface org.eclipse.emf.ecore.resource.Resource
getContents
in class DerivedStateAwareResource
public void resolveLazyCrossReferences(CancelIndicator monitor)
resolveLazyCrossReferences
in class LazyLinkingResource
monitor
- a CancelIndicator
can be used to stop the resolution.protected org.eclipse.emf.ecore.EObject handleCyclicResolution(Triple<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EReference,INode> triple) throws java.lang.AssertionError
handleCyclicResolution
in class LazyLinkingResource
java.lang.AssertionError
public void linkBatched(CancelIndicator monitor)
linkBatched
in interface IBatchLinkableResource