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 through
loadResource(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 java.lang.Object & Resource>
Nested classes/interfaces inherited from class org.eclipse.emf.common.notify.impl.BasicNotifierImpl
BasicNotifierImpl.EAdapterList<E extends java.lang.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
-
Constructor Summary
Constructors Constructor Description SynchronizedResourceSet(IProxyCreationListener proxyListener)
Constructor. -
Method Summary
Modifier and Type Method Description Resource
createResource(URI uri)
Resource
createResource(URI uri, java.lang.String contentType)
void
dispose()
This method should be called when the resource set is no longer needed.java.util.Map<java.lang.Object,java.lang.Object>
getLoadOptions()
Resource
getResource(URI uri, boolean loadOnDemand)
EList<Resource>
getResources()
protected void
handleDemandLoadException(Resource resource, java.io.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 Details
-
SynchronizedResourceSet
Constructor.- Parameters:
proxyListener
- The listener to notify of proxy creations.
-
-
Method Details
-
loadResource
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
-
unload
Unload the given resource.- Parameters:
resource
- Resource to unlodmonitor
- Progress monito to use (currently unused)
-
getResource
- Specified by:
getResource
in interfaceResourceSet
- Overrides:
getResource
in classResourceSetImpl
- See Also:
ResourceSetImpl.getResource(org.eclipse.emf.common.util.URI, boolean)
-
createResource
- Specified by:
createResource
in interfaceResourceSet
- Overrides:
createResource
in classResourceSetImpl
- See Also:
ResourceSetImpl.createResource(org.eclipse.emf.common.util.URI)
-
createResource
- Specified by:
createResource
in interfaceResourceSet
- Overrides:
createResource
in classResourceSetImpl
- See Also:
ResourceSetImpl.createResource(org.eclipse.emf.common.util.URI, java.lang.String)
-
getResources
- Specified by:
getResources
in interfaceResourceSet
- Overrides:
getResources
in classResourceSetImpl
- See Also:
ResourceSetImpl.getResources()
-
getLoadOptions
public java.util.Map<java.lang.Object,java.lang.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
-