public abstract class DefaultEMFRepository extends java.lang.Object implements EMFRepository
EMFRepository.| Modifier and Type | Field and Description |
|---|---|
protected java.util.Map<java.lang.Object,java.lang.Object> |
defaultResourceSetLoadOptions |
PROP_BASE_URI, PROP_CONTENT_TYPE, PROP_DEFAULT_LOAD_OPTIONS, PROP_ID| Constructor and Description |
|---|
DefaultEMFRepository() |
| Modifier and Type | Method and Description |
|---|---|
void |
activate(java.util.Map<java.lang.String,?> properties)
Called on service activation
|
void |
cleanResource(Resource resource)
In EMF data are cached.
|
void |
close() |
URI |
createEClassUri(EClass eClass)
Creates an uri for a given
EClass |
URI |
createEClassUri(java.lang.String eClass)
Creates an uri for a given
EClass |
<T extends EObject> |
createProxy(EClass eClass,
java.lang.String id)
Returns the
EObject tha is a proxy of the given EClass and with the given id |
Resource |
createResource(EObject object)
Creates a resource for a given
EObject. |
Resource |
createResource(EObject object,
java.lang.String contentType)
Creates a resource for a given
EObject. |
Resource |
createResource(URI uri)
Creates a resource for the given
URI |
Resource |
createResource(URI uri,
java.lang.String contentType)
Creates a resource for the given
URI |
ResourceSet |
createResourceSet()
Creates a new
ResourceSet out side the repository |
URI |
createUri(EObject object)
Creates the
URI from a given EObject |
void |
deactivate()
Called on service de-activation
|
void |
delete(EObject object)
Deletes an object
|
EObject |
detach(EObject object)
Detaches an object from the resource
|
void |
dispose()
Cleans up all resources
|
java.lang.Object |
getAdapter(java.lang.Class<?> adapter)
An adapter method to adapt the repository for e.g.
|
<T extends EObject> |
getAllEObjects(EClass eClass)
Returns a list of all
EObject of the given EClass or an empty List |
<T extends EObject> |
getAllEObjects(EClass eClass,
java.util.Map<?,?> options)
Returns a list of all
EObject of the given EClass or an empty List |
java.lang.String |
getBaseUri()
Returns the base uri
|
<T extends EObject> |
getEObject(EClass eClass,
java.lang.Object id)
Returns the
EObject of the given EClass name and id or null |
<T extends EObject> |
getEObject(EClass eClass,
java.lang.Object id,
java.util.Map<?,?> options)
Returns the
EObject of the given EClass name and id or null |
<T extends EObject> |
getEObject(URI uri)
Returns the
EObject for a given URI or null |
<T extends EObject> |
getEObject(URI uri,
java.util.Map<?,?> options)
Returns the
EObject for a given URI or null |
java.lang.String |
getId()
Returns the id of the resource provider
|
Resource |
getResource(URI uri,
boolean loadOnDemand)
Gets a resource for the given
URI and loads it on demand, if the parameter is set to true |
ResourceSet |
getResourceSet()
Gets the repository owned
ResourceSet |
ResourceSetFactory |
getResourceSetFactory()
Returns the injected resource set factory
|
boolean |
isDisposed()
Returns
true, if the repository was already disposed |
void |
reload(EObject object)
Reloads an object
|
void |
save(java.util.Collection<EObject> objects)
Saves the given object
|
void |
save(java.util.Collection<EObject> objects,
java.util.Map<?,?> options)
Saves the given object
|
void |
save(EObject... objects)
Saves the given object
|
void |
save(EObject object)
Saves the given object
|
void |
save(EObject object,
java.util.Map<?,?> options)
Saves the given object
|
void |
save(EObject object,
java.lang.String contentType)
Saves the given object
|
void |
save(EObject object,
java.lang.String contentType,
java.util.Map<?,?> options)
Saves the given object
|
void |
save(EObject object,
URI uri)
Saves the given object
|
void |
save(EObject object,
URI uri,
java.util.Map<?,?> options)
Saves the given object
|
void |
save(java.util.Map<?,?> options,
EObject... objects)
Saves the given object at the given uri
|
void |
setResourceSetFactory(ResourceSetFactory resourceSetFactory)
Sets the resource set factory using OSGi DS
|
void |
unsetResourceSetFactory(ResourceSetFactory resourceSetFactory)
Un-sets the resource set factory using OSGi DS
|
protected java.util.Map<java.lang.Object,java.lang.Object> defaultResourceSetLoadOptions
public java.lang.String getId()
EMFRepositorygetId in interface EMFRepositorypublic java.lang.String getBaseUri()
EMFRepositorygetBaseUri in interface EMFRepositorypublic void save(EObject object,
java.lang.String contentType,
java.util.Map<?,?> options)
EMFRepositorysave in interface EMFRepositoryobject - the object to savecontentType - the corresponding content type of the modeloptions - the save optionspublic <T extends EObject> T createProxy(EClass eClass,
java.lang.String id)
EMFRepositoryEObject tha is a proxy of the given EClass and with the given idcreateProxy in interface EMFRepositoryeClass - the EClass to create the proxy forid - the id of the ObjectEObject as a proxypublic void save(EObject object,
java.lang.String contentType)
EMFRepositorysave in interface EMFRepositoryobject - the object to savecontentType - the corresponding content type of the modelpublic void save(java.util.Collection<EObject> objects)
EMFRepositorysave in interface EMFRepositoryobjects - the object to savepublic void save(EObject... objects)
EMFRepositorysave in interface EMFRepositoryobjects - the object to savepublic void save(java.util.Map<?,?> options,
EObject... objects)
EMFRepositorysave in interface EMFRepositoryoptions - the object to saveobjects - the uri of the storage locationpublic void save(java.util.Collection<EObject> objects,
java.util.Map<?,?> options)
EMFRepositorysave in interface EMFRepositoryobjects - the object to saveoptions - the save optionspublic void save(EObject object,
java.util.Map<?,?> options)
EMFRepositorysave in interface EMFRepositoryobject - the object to saveoptions - the save optionspublic void save(EObject object)
EMFRepositorysave in interface EMFRepositoryobject - the object to savepublic void save(EObject object,
URI uri,
java.util.Map<?,?> options)
EMFRepositorysave in interface EMFRepositoryobject - the object to saveuri - the corresponding content type of the modeloptions - the save optionspublic void save(EObject object,
URI uri)
EMFRepositorysave in interface EMFRepositoryobject - the object to saveuri - the corresponding content type of the modelpublic <T extends EObject> T getEObject(EClass eClass,
java.lang.Object id,
java.util.Map<?,?> options)
EMFRepositoryEObject of the given EClass name and id or nullgetEObject in interface EMFRepositoryeClass - the String name of the EObjectid - the primary key of the objectoptions - the load optionsEObject of the given EClass name and id or nullpublic <T extends EObject> T getEObject(EClass eClass,
java.lang.Object id)
EMFRepositoryEObject of the given EClass name and id or nullgetEObject in interface EMFRepositoryeClass - the String name of the EObjectid - the primary key of the objectEObject of the given EClass name and id or nullpublic <T extends EObject> java.util.List<T> getAllEObjects(EClass eClass,
java.util.Map<?,?> options)
EMFRepositoryEObject of the given EClass or an empty ListgetAllEObjects in interface EMFRepositoryeClass - the EClass of the objects to returnoptions - the load optionsListpublic <T extends EObject> java.util.List<T> getAllEObjects(EClass eClass)
EMFRepositoryEObject of the given EClass or an empty ListgetAllEObjects in interface EMFRepositoryeClass - the EClass of the objects to returnListpublic <T extends EObject> T getEObject(URI uri,
java.util.Map<?,?> options)
EMFRepositoryEObject for a given URI or nullgetEObject in interface EMFRepositoryuri - the object urioptions - the load optionsEObject instance or nullpublic <T extends EObject> T getEObject(URI uri)
EMFRepositoryEObject for a given URI or nullgetEObject in interface EMFRepositoryuri - the object uriEObject instance or nullpublic void reload(EObject object)
EMFRepositoryreload in interface EMFRepositoryobject - the EObject to reloadpublic void delete(EObject object)
EMFRepositorydelete in interface EMFRepositoryobject - the EObject to reloadpublic EObject detach(EObject object)
EMFRepositorydetach in interface EMFRepositoryobject - the object to detachEObjectpublic ResourceSet getResourceSet()
EMFRepositoryResourceSetgetResourceSet in interface EMFRepositoryResourceSetpublic ResourceSet createResourceSet()
EMFRepositoryResourceSet out side the repositorycreateResourceSet in interface EMFRepositoryResourceSetpublic Resource getResource(URI uri,
boolean loadOnDemand)
EMFRepositoryURI and loads it on demand, if the parameter is set to truegetResource in interface EMFRepositoryResource or nullpublic Resource createResource(EObject object,
java.lang.String contentType)
EMFRepositoryEObject. If the object already has a resource,
this will returned. Otherwise a new resource will be created and the object will be attached to the resourcecreateResource in interface EMFRepositoryobject - the EObject to create the resource fromcontentType - the content type of the object (find it in the package interface)public Resource createResource(EObject object)
EMFRepositoryEObject. If the object already has a resource,
this will returned. Otherwise a new resource will be created and the object will be attached to the resourcecreateResource in interface EMFRepositoryobject - the EObject to create the resource frompublic void cleanResource(Resource resource)
EMFRepositorycleanResource in interface EMFRepositorypublic URI createUri(EObject object)
EMFRepositoryURI from a given EObjectcreateUri in interface EMFRepositoryobject - the EObject to create the URI fromURI or null on errorspublic URI createEClassUri(java.lang.String eClass)
EClasseClass - the EClass to create the URI fromnullpublic URI createEClassUri(EClass eClass)
EClasseClass - the EClass to create the URI fromnullpublic void dispose()
EMFRepositorydispose in interface EMFRepositorypublic void close()
throws java.lang.Exception
close in interface java.lang.AutoCloseablejava.lang.Exceptionpublic boolean isDisposed()
EMFRepositorytrue, if the repository was already disposedisDisposed in interface EMFRepositorypublic Resource createResource(URI uri)
URIcreateResource in interface EMFRepositoryuri - the URI to create a resource fromResource or nullpublic Resource createResource(URI uri,
java.lang.String contentType)
URIcreateResource in interface EMFRepositoryuri - the URI to create a resource fromcontentType - the content type of the objectResource or nullpublic java.lang.Object getAdapter(java.lang.Class<?> adapter)
EMFRepositorygetAdapter in interface EMFRepositoryadapter - the type to adapt tonullpublic void activate(java.util.Map<java.lang.String,?> properties)
properties - the service propertiespublic void deactivate()
public ResourceSetFactory getResourceSetFactory()
public void unsetResourceSetFactory(ResourceSetFactory resourceSetFactory)
resourceSetFactory - the resource set factory to setpublic void setResourceSetFactory(ResourceSetFactory resourceSetFactory)
resourceSetFactory - the resource set factory to setData In Motion Consulting