org.eclipse.emf.compare.ide.ui.internal.logical.resolver

## 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 Object & Resource>`

### Nested classes/interfaces inherited from class org.eclipse.emf.common.notify.impl.BasicNotifierImpl

`BasicNotifierImpl.EAdapterList<E extends Object & Adapter>, BasicNotifierImpl.EObservableAdapterList`

### 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 and Description
`SynchronizedResourceSet(IProxyCreationListener proxyListener)` Constructor.

### Method Summary

All Methods Instance Methods Concrete Methods
`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.ecore.resource.ResourceSet

`getAdapterFactories, getAllContents, getEObject, getPackageRegistry, getResourceFactoryRegistry, getURIConverter, setPackageRegistry, setResourceFactoryRegistry, setURIConverter`

### Methods inherited from interface org.eclipse.emf.common.notify.Notifier

`eAdapters, eDeliver, eNotify, eSetDeliver`

### 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)

Overrides:
  `handleDemandLoadException` in class `ResourceSetImpl`
See Also:
  `ResourceSetImpl.handleDemandLoadException(org.eclipse.emf.ecore.resource.Resource, java.io.IOException)`

#### unload

    public void unload(Resource resource,
                       org.eclipse.core.runtime.IProgressMonitor monitor)

Unload the given resource.

Parameters:
  `resource` - Resource to unlod
  `monitor` - Progress monito to use (currently unused)

#### getResource

    public Resource getResource(URI uri,
                                boolean loadOnDemand)

Specified by:
  `getResource` in interface `ResourceSet`
Overrides:
  `getResource` in class `ResourceSetImpl`
See Also:
  `ResourceSetImpl.getResource(org.eclipse.emf.common.util.URI, boolean)`

#### createResource

    public Resource createResource(URI uri)

Specified by:
  `createResource` in interface `ResourceSet`
Overrides:
  `createResource` in class `ResourceSetImpl`
See Also:
  `ResourceSetImpl.createResource(org.eclipse.emf.common.util.URI)`

#### createResource

    public Resource createResource(URI uri,
                                   String contentType)

Specified by:
  `createResource` in interface `ResourceSet`
Overrides:
  `createResource` in class `ResourceSetImpl`
See Also:
  `ResourceSetImpl.createResource(org.eclipse.emf.common.util.URI, java.lang.String)`

#### getResources

    public EList<Resource> getResources()

Specified by:
  `getResources` in interface `ResourceSet`
Overrides:
  `getResources` in class `ResourceSetImpl`
See Also:
  `ResourceSetImpl.getResources()`

#### getLoadOptions

    public Map<Object,Object> getLoadOptions()

Specified by:
  `getLoadOptions` in interface `ResourceSet`
Overrides:
  `getLoadOptions` in class `ResourceSetImpl`
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 interface `DisposableResourceSet`