Class ResourceRepositoryManager

  • All Implemented Interfaces:
    Observer

    public final class ResourceRepositoryManager
    extends EObjectManager<org.palladiosimulator.pcm.resourcetype.ResourceRepository>
    This class encapsulates the access to a ResourceRepository in a resourcetype model. It provides methods to add EntityTypes to and to remove EntityTypes from a resourcetype model. A ResourceManager provides access to the model resource.
    • 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 the ResourceRepository of the resourcetype model.
        Specified by:
        getEObject in class EObjectManager<org.palladiosimulator.pcm.resourcetype.ResourceRepository>
        Returns:
        the ResourceRepository of the resourcetype model
      • setEObject

        public void setEObject​(IResource newResource)
                        throws CoreException
        Sets the ResourceRepository to the one contained in the given emf workspace resource. Persists the old ResourceRepository to the model file if it contains unsaved changes.
        Specified by:
        setEObject in class EObjectManager<org.palladiosimulator.pcm.resourcetype.ResourceRepository>
        Parameters:
        newResource - the emf workspace resource containing the new ResourceRepository
        Throws:
        CoreException - is persisting of the old ResourceRepository failed.
      • reloadEObject

        public void reloadEObject()
        Reloads the current ResourceRepository to see changes made by other parties.
        Specified by:
        reloadEObject in class EObjectManager<org.palladiosimulator.pcm.resourcetype.ResourceRepository>
      • createAndAddEmptyEntityType

        public void createAndAddEmptyEntityType()
        Creates a default EntityType and adds it to the ResourceRepository.
      • removeEntityType

        public void removeEntityType​(EntityType etype)
        Removes the given EntityType from the ResourceRepository.
        Parameters:
        etype - the EntityType to remove
      • saveEObject

        public void saveEObject()
                         throws CoreException
        Persists the ResourceRepository to the model file.
        Specified by:
        saveEObject in class EObjectManager<org.palladiosimulator.pcm.resourcetype.ResourceRepository>
        Throws:
        CoreException - if persisting failed
      • update

        public void update​(Observable o,
                           Object arg)
        Used by the ResourceManager to notify about modifications of the current ResourceRepository by other parties.