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 aResourceRepositoryin a resourcetype model. It provides methods to addEntityTypes to and to removeEntityTypes from a resourcetype model. AResourceManagerprovides access to the model resource.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcreateAndAddEmptyEntityType()Creates a defaultEntityTypeand adds it to theResourceRepository.org.palladiosimulator.pcm.resourcetype.ResourceRepositorygetEObject()Returns theResourceRepositoryof the resourcetype model.static ResourceRepositoryManagergetInstance()Returns the singleton instance of this class.voidreloadEObject()Reloads the currentResourceRepositoryto see changes made by other parties.voidremoveEntityType(EntityType etype)Removes the givenEntityTypefrom theResourceRepository.voidsaveEObject()Persists theResourceRepositoryto the model file.voidsetEObject(IResource newResource)Sets theResourceRepositoryto the one contained in the given emf workspace resource.voidupdate(Observable o, Object arg)Used by theResourceManagerto notify about modifications of the currentResourceRepositoryby 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 theResourceRepositoryof the resourcetype model.- Specified by:
getEObjectin classEObjectManager<org.palladiosimulator.pcm.resourcetype.ResourceRepository>- Returns:
- the
ResourceRepositoryof the resourcetype model
-
setEObject
public void setEObject(IResource newResource) throws CoreException
Sets theResourceRepositoryto the one contained in the given emf workspace resource. Persists the oldResourceRepositoryto the model file if it contains unsaved changes.- Specified by:
setEObjectin classEObjectManager<org.palladiosimulator.pcm.resourcetype.ResourceRepository>- Parameters:
newResource- the emf workspace resource containing the newResourceRepository- Throws:
CoreException- is persisting of the oldResourceRepositoryfailed.
-
reloadEObject
public void reloadEObject()
Reloads the currentResourceRepositoryto see changes made by other parties.- Specified by:
reloadEObjectin classEObjectManager<org.palladiosimulator.pcm.resourcetype.ResourceRepository>
-
createAndAddEmptyEntityType
public void createAndAddEmptyEntityType()
Creates a defaultEntityTypeand adds it to theResourceRepository.
-
removeEntityType
public void removeEntityType(EntityType etype)
Removes the givenEntityTypefrom theResourceRepository.- Parameters:
etype- theEntityTypeto remove
-
saveEObject
public void saveEObject() throws CoreExceptionPersists theResourceRepositoryto the model file.- Specified by:
saveEObjectin classEObjectManager<org.palladiosimulator.pcm.resourcetype.ResourceRepository>- Throws:
CoreException- if persisting failed
-
update
public void update(Observable o, Object arg)
Used by theResourceManagerto notify about modifications of the currentResourceRepositoryby other parties.
-
-