public class DefaultResourceSetFactory extends java.lang.Object implements ResourceSetFactory
ResourceSetFactory. It hold the EPackage registry as well as the Factory registry.
EPackage are dynamically injected as EPackageProvider instance.
Factory instance are injected dynamically as ServiceReference instance. So they can be registered using
their properties for contentTyp or fileExtension.
Third additional ResourceSetConfigurator instance can be injected to customize the ResourceSet for
further extension like custom serialization.| Modifier and Type | Field and Description |
|---|---|
protected EPackage.Registry |
packageRegistry |
protected Resource.Factory.Registry |
resourceFactoryRegistry |
protected <any> |
rsfRegistration |
protected <any> |
rsRegistration |
EMF_CAPABILITY_NAME, GECKOPROKECTS_EMF_VERSION| Constructor and Description |
|---|
DefaultResourceSetFactory() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
activate(ComponentContext ctx)
Called on component activation
|
protected void |
addEcoreConfigurator(EPackageConfigurator configurator,
java.util.Map<java.lang.String,java.lang.Object> properties)
Adds the
EPackageConfigurator, to register the Ecore Package |
protected void |
addEcoreResourceFactoryConfigurator(ResourceFactoryConfigurator configurator,
java.util.Map<java.lang.String,java.lang.Object> properties)
Adds a resource factory configurator for the basic Ecore Package
|
protected void |
addEPackageConfigurator(EPackageConfigurator configurator,
java.util.Map<java.lang.String,java.lang.Object> properties)
Adds
EPackageConfigurator, to register a new EPackage |
protected void |
addResourceFactoryConfigurator(ResourceFactoryConfigurator configurator,
java.util.Map<java.lang.String,java.lang.Object> properties)
Adds a resource factory configurator to the registry
|
protected void |
addResourceSetConfigurator(ResourceSetConfigurator resourceSetConfigurator,
java.util.Map<java.lang.String,java.lang.Object> properties)
Adds new
ResourceSetConfigurator to this factory |
ResourceSet |
createResourceSet()
Returns a new instance of a resource set
|
protected void |
deactivate()
Called on component deactivation
|
protected java.util.Dictionary<java.lang.String,java.lang.Object> |
getDictionary()
Creates a dictionary for the stored properties
|
java.util.Collection<ResourceSetConfigurator> |
getResourceSetConfigurators()
Returns a lsit of all resource set configurators or an empty list
|
protected ResourceSet |
internalCreateResourceSet()
Internally creates a
ResourceSet instance |
protected void |
registerServices(ComponentContext ctx)
Registers the
ResourceSet and ResourceSetFactory |
protected void |
removeEPackageConfigurator(EPackageConfigurator configurator,
java.util.Map<java.lang.String,java.lang.Object> properties)
Removes a
EPackageConfigurator from the registry and unconfigures it |
protected void |
removeResourceFactoryConfigurator(ResourceFactoryConfigurator configurator,
java.util.Map<java.lang.String,java.lang.Object> properties)
Removes a resource factory configurator from the registry
|
protected void |
removeResourceSetConfigurator(ResourceSetConfigurator resourceSetConfigurator,
java.util.Map<java.lang.String,java.lang.Object> properties)
Removes a
ResourceSetConfigurator from the list for this factory |
protected void |
setEPackageRegistry(EPackage.Registry registry)
Set the
EPackage.Registry |
protected void |
setResourceFactoryRegistry(Resource.Factory.Registry resourceFactoryRegistry)
Set a
Registry for resource factories |
protected void |
unregisterServices()
De-registers the
ResourceSet and ResourceSetFactory |
protected void |
unsetEPackageRegistry(EPackage.Registry registry)
Un-set the
EPackage registry |
protected void |
unsetResourceFactoryRegistry(Resource.Factory.Registry resourceFactoryRegistry)
Removes the
Resource.Factory.Registryregistry |
protected void |
updatePackageRegistry()
Updates the package registry
|
protected void |
updateProperties(java.lang.String type,
java.util.Map<java.lang.String,java.lang.Object> serviceProperties,
boolean add)
Updates the properties of the service, depending on changes on injected services
|
protected void |
updateRegistrationProperties()
Updates the service registration properties
|
protected void |
updateResourceFactoryRegistry()
Updates the resource factory registry
|
protected volatile EPackage.Registry packageRegistry
protected volatile Resource.Factory.Registry resourceFactoryRegistry
protected <any> rsfRegistration
protected <any> rsRegistration
protected void setEPackageRegistry(EPackage.Registry registry)
EPackage.Registryregistry - the EPackage registry to setprotected void unsetEPackageRegistry(EPackage.Registry registry)
EPackage registryregistry - the EPackage registry to be removedprotected void setResourceFactoryRegistry(Resource.Factory.Registry resourceFactoryRegistry)
Registry for resource factoriesresourceFactoryRegistry - the resource factory to be injectedprotected void unsetResourceFactoryRegistry(Resource.Factory.Registry resourceFactoryRegistry)
Resource.Factory.RegistryregistryresourceFactoryRegistry - the registry to be removedprotected void addEcoreConfigurator(EPackageConfigurator configurator, java.util.Map<java.lang.String,java.lang.Object> properties)
EPackageConfigurator, to register the Ecore Packageconfigurator - the EPackageConfigurator to be registeredproperties - the service propertiesprotected void addEPackageConfigurator(EPackageConfigurator configurator, java.util.Map<java.lang.String,java.lang.Object> properties)
EPackageConfigurator, to register a new EPackageconfigurator - the EPackageConfigurator to be registeredproperties - the service propertiesprotected void removeEPackageConfigurator(EPackageConfigurator configurator, java.util.Map<java.lang.String,java.lang.Object> properties)
EPackageConfigurator from the registry and unconfigures itconfigurator - the configurator to be removedmodelInfo - the model informationproperties - the service propertiesprotected void addEcoreResourceFactoryConfigurator(ResourceFactoryConfigurator configurator, java.util.Map<java.lang.String,java.lang.Object> properties)
configurator - the resource factory configurator to be registeredproperties - the service propertiesprotected void addResourceFactoryConfigurator(ResourceFactoryConfigurator configurator, java.util.Map<java.lang.String,java.lang.Object> properties)
configurator - the resource factory configurator to be registeredproperties - the service propertiesprotected void removeResourceFactoryConfigurator(ResourceFactoryConfigurator configurator, java.util.Map<java.lang.String,java.lang.Object> properties)
configurator - the resource factory configurator to be removedproperties - the service propertiesprotected void addResourceSetConfigurator(ResourceSetConfigurator resourceSetConfigurator, java.util.Map<java.lang.String,java.lang.Object> properties)
ResourceSetConfigurator to this factoryresourceSetConfigurator - the new configurator to be addedproperties - the service propertiesprotected void removeResourceSetConfigurator(ResourceSetConfigurator resourceSetConfigurator, java.util.Map<java.lang.String,java.lang.Object> properties)
ResourceSetConfigurator from the list for this factoryresourceSetConfigurator - properties - the service propertiesprotected void activate(ComponentContext ctx)
ctx - the component contextprotected void registerServices(ComponentContext ctx)
ResourceSet and ResourceSetFactoryctx - the component contextprotected void unregisterServices()
ResourceSet and ResourceSetFactoryprotected void deactivate()
protected ResourceSet internalCreateResourceSet()
ResourceSet instanceResourceSet instancepublic ResourceSet createResourceSet()
ResourceSetFactorycreateResourceSet in interface ResourceSetFactorypublic java.util.Collection<ResourceSetConfigurator> getResourceSetConfigurators()
ResourceSetFactorygetResourceSetConfigurators in interface ResourceSetFactoryprotected void updatePackageRegistry()
protected void updateResourceFactoryRegistry()
protected void updateProperties(java.lang.String type,
java.util.Map<java.lang.String,java.lang.Object> serviceProperties,
boolean add)
type - the type of the property to publishserviceProperties - the service properties from the injected serviceadd - true, if the service was add, false in case of an removeprotected void updateRegistrationProperties()
protected java.util.Dictionary<java.lang.String,java.lang.Object> getDictionary()
Data In Motion Consuling GmbH - All rights reserved