Package de.uka.ipd.sdq.simucomframework
Class ResourceRegistry
java.lang.Object
de.uka.ipd.sdq.simucomframework.ResourceRegistry
Central registry for simulated resources (resource containers, linking resources). The central
registry can be used to start and stop all resources simultaniously.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Start all simulated resources in the simulation frameworkvoid
Add a PCM LinkingResourceContainervoid
addResourceContainer
(SimulatedResourceContainer container) Add a PCM ResourceContainerboolean
containsResourceContainer
(String resourceContainerID) createLinkingResourceContainer
(String containerID) Create a simulated PCM LinkingResourcecreateResourceContainer
(String containerID) Create and add a PCM ResourceContainervoid
Stop all resources in the simulation frameworkvoid
getResourceContainer
(String resourceContainerID) Retrieve the resource container with the given IDremoveResourceContainerFromRegistry
(String resourceContainerID) Retrieve the resource container with the given ID
-
Constructor Details
-
ResourceRegistry
Default initialization.- Parameters:
model
- the corresponding SimuCom model.
-
-
Method Details
-
addResourceContainer
Add a PCM ResourceContainer- Parameters:
container
- the resource container to add
-
createResourceContainer
Create and add a PCM ResourceContainer- Parameters:
containerID
- PCM ID of the resource container to create- Returns:
- The simulated resource container object
-
createLinkingResourceContainer
Create a simulated PCM LinkingResource- Parameters:
containerID
- PCM ID of the LinkingResource- Returns:
- The resource container introduced for the linking resource. Note, this container is virtual as it does not exist in the PCMs original model. However, it exists in the simulation to unify resource container and link resource behavior.
-
addLinkingResourceContainer
Add a PCM LinkingResourceContainer- Parameters:
container
- the linking resource container to add
-
getLinkingResourceContainers
-
getSimulatedResourceContainers
-
containsResourceContainer
- Parameters:
resourceContainerID
- ID of the container- Returns:
- True if the given ID is known in the resource registry
-
getResourceContainer
Retrieve the resource container with the given ID- Parameters:
resourceContainerID
- ID of the container to retrieve. The container must exist in this registry- Returns:
- The queried resource container
-
removeResourceContainerFromRegistry
public AbstractSimulatedResourceContainer removeResourceContainerFromRegistry(String resourceContainerID) Retrieve the resource container with the given ID- Parameters:
resourceContainerID
- ID of the container to retrieve. The container must exist in this registry- Returns:
- The queried resource container
-
activateAllActiveResources
public void activateAllActiveResources()Start all simulated resources in the simulation framework -
deactivateAllActiveResources
public void deactivateAllActiveResources()Stop all resources in the simulation framework -
deactivateAllPassiveResources
public void deactivateAllPassiveResources()
-