Class ResourceRepositoryManager
- java.lang.Object
-
- java.util.Observable
-
- org.palladiosimulator.pcmtx.pcmtxviews.manager.EObjectManager<org.palladiosimulator.pcm.resourcetype.ResourceRepository>
-
- org.palladiosimulator.pcmtx.pcmtxviews.manager.ResourceRepositoryManager
-
- All Implemented Interfaces:
Observer
public final class ResourceRepositoryManager extends EObjectManager<org.palladiosimulator.pcm.resourcetype.ResourceRepository>
This class encapsulates the access to aResourceRepository
in a resourcetype model. It provides methods to addEntityType
s to and to removeEntityType
s from a resourcetype model. AResourceManager
provides access to the model resource.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
createAndAddEmptyEntityType()
Creates a defaultEntityType
and adds it to theResourceRepository
.org.palladiosimulator.pcm.resourcetype.ResourceRepository
getEObject()
Returns theResourceRepository
of the resourcetype model.static ResourceRepositoryManager
getInstance()
Returns the singleton instance of this class.void
reloadEObject()
Reloads the currentResourceRepository
to see changes made by other parties.void
removeEntityType(EntityType etype)
Removes the givenEntityType
from theResourceRepository
.void
saveEObject()
Persists theResourceRepository
to the model file.void
setEObject(IResource newResource)
Sets theResourceRepository
to the one contained in the given emf workspace resource.void
update(Observable o, Object arg)
Used by theResourceManager
to notify about modifications of the currentResourceRepository
by other parties.-
Methods inherited from class org.palladiosimulator.pcmtx.pcmtxviews.manager.EObjectManager
clear, getResourceManager, isDirty, runLastUpdate, setDirty, setLastUpdate
-
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
-
-
-
-
Method Detail
-
getInstance
public static final ResourceRepositoryManager getInstance()
Returns the singleton instance of this class.- Returns:
- the singleton instance
-
getEObject
public org.palladiosimulator.pcm.resourcetype.ResourceRepository getEObject()
Returns theResourceRepository
of the resourcetype model.- Specified by:
getEObject
in classEObjectManager<org.palladiosimulator.pcm.resourcetype.ResourceRepository>
- Returns:
- the
ResourceRepository
of the resourcetype model
-
setEObject
public void setEObject(IResource newResource) throws CoreException
Sets theResourceRepository
to the one contained in the given emf workspace resource. Persists the oldResourceRepository
to the model file if it contains unsaved changes.- Specified by:
setEObject
in classEObjectManager<org.palladiosimulator.pcm.resourcetype.ResourceRepository>
- Parameters:
newResource
- the emf workspace resource containing the newResourceRepository
- Throws:
CoreException
- is persisting of the oldResourceRepository
failed.
-
reloadEObject
public void reloadEObject()
Reloads the currentResourceRepository
to see changes made by other parties.- Specified by:
reloadEObject
in classEObjectManager<org.palladiosimulator.pcm.resourcetype.ResourceRepository>
-
createAndAddEmptyEntityType
public void createAndAddEmptyEntityType()
Creates a defaultEntityType
and adds it to theResourceRepository
.
-
removeEntityType
public void removeEntityType(EntityType etype)
Removes the givenEntityType
from theResourceRepository
.- Parameters:
etype
- theEntityType
to remove
-
saveEObject
public void saveEObject() throws CoreException
Persists theResourceRepository
to the model file.- Specified by:
saveEObject
in classEObjectManager<org.palladiosimulator.pcm.resourcetype.ResourceRepository>
- Throws:
CoreException
- if persisting failed
-
update
public void update(Observable o, Object arg)
Used by theResourceManager
to notify about modifications of the currentResourceRepository
by other parties.
-
-