Class SynchronizedResourceSet
- java.lang.Object
-
- org.eclipse.emf.common.notify.impl.BasicNotifierImpl
-
- org.eclipse.emf.common.notify.impl.NotifierImpl
-
- org.eclipse.emf.ecore.resource.impl.ResourceSetImpl
-
- org.eclipse.emf.compare.ide.ui.internal.logical.resolver.SynchronizedResourceSet
-
- All Implemented Interfaces:
Notifier
,DisposableResourceSet
,ResourceSet
public class SynchronizedResourceSet extends ResourceSetImpl implements DisposableResourceSet
A thread-safe implementation of a ResourceSet that will prevent loading of resources unless explicitly demanded throughloadResource(URI)
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.emf.ecore.resource.impl.ResourceSetImpl
ResourceSetImpl.MappedResourceLocator, ResourceSetImpl.ResourceLocator, ResourceSetImpl.ResourcesEList<E extends Object & Resource>
-
Nested classes/interfaces inherited from class org.eclipse.emf.common.notify.impl.BasicNotifierImpl
BasicNotifierImpl.EAdapterList<E extends Object & Adapter>, BasicNotifierImpl.EObservableAdapterList, BasicNotifierImpl.EScannableAdapterList
-
-
Field Summary
-
Fields inherited from class org.eclipse.emf.ecore.resource.impl.ResourceSetImpl
adapterFactories, loadOptions, packageRegistry, resourceFactoryRegistry, resourceLocator, resources, uriConverter, uriResourceMap
-
Fields inherited from class org.eclipse.emf.common.notify.impl.NotifierImpl
eAdapters, EDELIVER, eFlags, ELAST_NOTIFIER_FLAG
-
Fields inherited from interface org.eclipse.emf.compare.ide.internal.utils.DisposableResourceSet
XTEXT_SCOPING_LIVE_SCOPE_OPTION
-
Fields inherited from interface org.eclipse.emf.ecore.resource.ResourceSet
RESOURCE_SET__RESOURCES
-
-
Constructor Summary
Constructors Constructor Description SynchronizedResourceSet(IProxyCreationListener proxyListener)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Resource
createResource(URI uri)
Resource
createResource(URI uri, String contentType)
void
dispose()
This method should be called when the resource set is no longer needed.Map<Object,Object>
getLoadOptions()
Resource
getResource(URI uri, boolean loadOnDemand)
EList<Resource>
getResources()
protected void
handleDemandLoadException(Resource resource, IOException exception)
Resource
loadResource(URI uri)
This will load the given URI as an EMF Resource.void
unload(Resource resource, org.eclipse.core.runtime.IProgressMonitor monitor)
Unload the given resource.-
Methods inherited from class org.eclipse.emf.ecore.resource.impl.ResourceSetImpl
delegatedGetResource, demandCreateResource, demandLoad, demandLoadHelper, getAdapterFactories, getAllContents, getEObject, getPackageRegistry, getResourceFactoryRegistry, getURIConverter, getURIResourceMap, setPackageRegistry, setResourceFactoryRegistry, setURIConverter, setURIResourceMap, toString
-
Methods inherited from class org.eclipse.emf.common.notify.impl.NotifierImpl
eAdapters, eBasicAdapters, eDeliver, eSetDeliver
-
Methods inherited from class org.eclipse.emf.common.notify.impl.BasicNotifierImpl
eBasicAdapterArray, eBasicHasAdapters, eNotificationRequired, eNotify
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.emf.common.notify.Notifier
eAdapters, eDeliver, eNotify, eSetDeliver
-
Methods inherited from interface org.eclipse.emf.ecore.resource.ResourceSet
getAdapterFactories, getAllContents, getEObject, getPackageRegistry, getResourceFactoryRegistry, getURIConverter, setPackageRegistry, setResourceFactoryRegistry, setURIConverter
-
-
-
-
Constructor Detail
-
SynchronizedResourceSet
public SynchronizedResourceSet(IProxyCreationListener proxyListener)
Constructor.- Parameters:
proxyListener
- The listener to notify of proxy creations.
-
-
Method Detail
-
loadResource
public Resource loadResource(URI uri)
This will load the given URI as an EMF Resource.This is the only entry point within this resource set to load an EMF resource, and it will _only_ load the resource pointed at by
uri
, ignoring all cross-referenced resources (including containment proxies).- Parameters:
uri
- The URI to load as a resource.- Returns:
- The loaded Resource.
-
handleDemandLoadException
protected void handleDemandLoadException(Resource resource, IOException exception)
-
unload
public void unload(Resource resource, org.eclipse.core.runtime.IProgressMonitor monitor)
Unload the given resource.- Parameters:
resource
- Resource to unlodmonitor
- Progress monito to use (currently unused)
-
getResource
public Resource getResource(URI uri, boolean loadOnDemand)
- Specified by:
getResource
in interfaceResourceSet
- Overrides:
getResource
in classResourceSetImpl
- See Also:
ResourceSetImpl.getResource(org.eclipse.emf.common.util.URI, boolean)
-
createResource
public Resource createResource(URI uri)
- Specified by:
createResource
in interfaceResourceSet
- Overrides:
createResource
in classResourceSetImpl
- See Also:
ResourceSetImpl.createResource(org.eclipse.emf.common.util.URI)
-
createResource
public Resource createResource(URI uri, String contentType)
- Specified by:
createResource
in interfaceResourceSet
- Overrides:
createResource
in classResourceSetImpl
- See Also:
ResourceSetImpl.createResource(org.eclipse.emf.common.util.URI, java.lang.String)
-
getResources
public EList<Resource> getResources()
- Specified by:
getResources
in interfaceResourceSet
- Overrides:
getResources
in classResourceSetImpl
- See Also:
ResourceSetImpl.getResources()
-
getLoadOptions
public Map<Object,Object> getLoadOptions()
- Specified by:
getLoadOptions
in interfaceResourceSet
- Overrides:
getLoadOptions
in classResourceSetImpl
- See Also:
ResourceSetImpl.getLoadOptions()
-
dispose
public void dispose()
This method should be called when the resource set is no longer needed.- Specified by:
dispose
in interfaceDisposableResourceSet
-
-