Class ResourceEnvironmentObservingLegacyRouter
java.lang.Object
org.palladiosimulator.simulizar.interpreter.linking.impl.ResourceEnvironmentObservingLegacyRouter
- All Implemented Interfaces:
ILinkingResourceRouter<EntityReference<org.palladiosimulator.pcm.resourceenvironment.ResourceContainer>,EntityReference<org.palladiosimulator.pcm.resourceenvironment.LinkingResource>>
public class ResourceEnvironmentObservingLegacyRouter
extends Object
implements ILinkingResourceRouter<EntityReference<org.palladiosimulator.pcm.resourceenvironment.ResourceContainer>,EntityReference<org.palladiosimulator.pcm.resourceenvironment.LinkingResource>>
This class implements the routing behavior of SimuCom for SimuLizar. It checks for every
registered linking resource if both resource containers are connected to this link.
This router monitors the ResourceEnvironment model to pick up on changes and update the internal
data structures.
-
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoAddConnectedResourceContainer(org.palladiosimulator.pcm.resourceenvironment.LinkingResource link, org.palladiosimulator.pcm.resourceenvironment.ResourceContainer container) protected voiddoAddLinkingResource(org.palladiosimulator.pcm.resourceenvironment.LinkingResource link) protected voiddoRemoveConnectedResourceContainer(org.palladiosimulator.pcm.resourceenvironment.LinkingResource link, org.palladiosimulator.pcm.resourceenvironment.ResourceContainer container) protected voiddoRemoveLinkingResource(org.palladiosimulator.pcm.resourceenvironment.LinkingResource link) Optional<Iterable<EntityReference<org.palladiosimulator.pcm.resourceenvironment.LinkingResource>>>findRoute(EntityReference<org.palladiosimulator.pcm.resourceenvironment.ResourceContainer> transmissionSource, EntityReference<org.palladiosimulator.pcm.resourceenvironment.ResourceContainer> transmissionTarget) Determines a series of links between transmissionSource and transmissionTarget.protected voidprotected voidHandle notifications about new or deleted linking resourcesprotected voidprotected voidinitialize(org.palladiosimulator.pcm.resourceenvironment.ResourceEnvironment env)
-
Method Details
-
findRoute
public Optional<Iterable<EntityReference<org.palladiosimulator.pcm.resourceenvironment.LinkingResource>>> findRoute(EntityReference<org.palladiosimulator.pcm.resourceenvironment.ResourceContainer> transmissionSource, EntityReference<org.palladiosimulator.pcm.resourceenvironment.ResourceContainer> transmissionTarget) Determines a series of links between transmissionSource and transmissionTarget. LIMITATION: Routes are only found between containers which are connected directly to the same linking resource.- Specified by:
findRoutein interfaceILinkingResourceRouter<EntityReference<org.palladiosimulator.pcm.resourceenvironment.ResourceContainer>,EntityReference<org.palladiosimulator.pcm.resourceenvironment.LinkingResource>> - Parameters:
transmissionSource- the node where the transmission is originatingtransmissionTarget- the target node of the transmission- Returns:
- an
Optionalof anIterableof links if there is a route between the nodes. The iterable may be empty, e. g. if source equals target. If there is no route between source and target an empty optional is returned.
-
handleNotification
-
initialize
protected void initialize(org.palladiosimulator.pcm.resourceenvironment.ResourceEnvironment env) -
handleLinkingResourcesChange
Handle notifications about new or deleted linking resources- Parameters:
msg- the notification
-
handleConnectedResourceContainersChange
-
doAddLinkingResource
protected void doAddLinkingResource(org.palladiosimulator.pcm.resourceenvironment.LinkingResource link) -
doRemoveLinkingResource
protected void doRemoveLinkingResource(org.palladiosimulator.pcm.resourceenvironment.LinkingResource link) -
doAddConnectedResourceContainer
protected void doAddConnectedResourceContainer(org.palladiosimulator.pcm.resourceenvironment.LinkingResource link, org.palladiosimulator.pcm.resourceenvironment.ResourceContainer container) -
doRemoveConnectedResourceContainer
protected void doRemoveConnectedResourceContainer(org.palladiosimulator.pcm.resourceenvironment.LinkingResource link, org.palladiosimulator.pcm.resourceenvironment.ResourceContainer container)
-