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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
doAddConnectedResourceContainer(org.palladiosimulator.pcm.resourceenvironment.LinkingResource link, org.palladiosimulator.pcm.resourceenvironment.ResourceContainer container)
protected void
doAddLinkingResource(org.palladiosimulator.pcm.resourceenvironment.LinkingResource link)
protected void
doRemoveConnectedResourceContainer(org.palladiosimulator.pcm.resourceenvironment.LinkingResource link, org.palladiosimulator.pcm.resourceenvironment.ResourceContainer container)
protected void
doRemoveLinkingResource(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 void
handleConnectedResourceContainersChange(Notification msg)
protected void
handleLinkingResourcesChange(Notification msg)
Handle notifications about new or deleted linking resourcesprotected void
handleNotification(Notification msg)
protected void
initialize(org.palladiosimulator.pcm.resourceenvironment.ResourceEnvironment env)
-
-
-
Method Detail
-
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:
findRoute
in 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
Optional
of anIterable
of 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
protected void handleNotification(Notification msg)
-
initialize
protected void initialize(org.palladiosimulator.pcm.resourceenvironment.ResourceEnvironment env)
-
handleLinkingResourcesChange
protected void handleLinkingResourcesChange(Notification msg)
Handle notifications about new or deleted linking resources- Parameters:
msg
- the notification
-
handleConnectedResourceContainersChange
protected void handleConnectedResourceContainersChange(Notification msg)
-
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)
-
-