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 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:
      findRoute in interface ILinkingResourceRouter<EntityReference<org.palladiosimulator.pcm.resourceenvironment.ResourceContainer>,EntityReference<org.palladiosimulator.pcm.resourceenvironment.LinkingResource>>
      Parameters:
      transmissionSource - the node where the transmission is originating
      transmissionTarget - the target node of the transmission
      Returns:
      an Optional of an Iterable 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)