Class AllocationLookupSyncer

  • All Implemented Interfaces:
    de.uka.ipd.sdq.simucomframework.resources.IAssemblyAllocationLookup<EntityReference<org.palladiosimulator.pcm.resourceenvironment.ResourceContainer>>

    public class AllocationLookupSyncer
    extends Object
    implements de.uka.ipd.sdq.simucomframework.resources.IAssemblyAllocationLookup<EntityReference<org.palladiosimulator.pcm.resourceenvironment.ResourceContainer>>
    The Allocation Lookup Syncer provides an accessible cache for the mapping of allocation context to resource container. It provides the lookup functionality of the Context for SimuLizar. In contrast to the generated SimuComContext variant, the allocation lookup syncer also supports nested assembly contexts through the usage of FQComponentIDs. LIMITATION: Due to the way the listener is currently registered, changes to CompositeComponents will not trigger notifications. If this feature is required the syncer also needs to listen to changes in the repository model.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void addAssemblyAllocation​(org.palladiosimulator.pcm.core.composition.AssemblyContext ctx, List<org.palladiosimulator.pcm.core.composition.AssemblyContext> ctxHierarchy, EntityReference<org.palladiosimulator.pcm.resourceenvironment.ResourceContainer> container)
      Adds an entry for the provided assembly context taking into account a stack of assembly contexts capturing the assemblies of containing composite components.
      protected void addInitialAllocations​(org.palladiosimulator.pcm.allocation.Allocation allocation)
      Traverses a provided Allocation model and creates mappings for all containers Allocation contexts.
      EntityReference<org.palladiosimulator.pcm.resourceenvironment.ResourceContainer> getAllocatedEntity​(String assemblyContextId)
      Returns the simulated resource container to which the provided assembly is allocated to.
      protected void handleNotification​(Notification msg)  
      protected void removeAssemblyAllocation​(org.palladiosimulator.pcm.core.composition.AssemblyContext ctx, List<org.palladiosimulator.pcm.core.composition.AssemblyContext> ctxHierarchy)
      Removes the entry for the provided assembly context taking into account a stack of assembly contexts capturing the assemblies of containing composite components.
      • Methods inherited from interface de.uka.ipd.sdq.simucomframework.resources.IAssemblyAllocationLookup

        getAllocatedEntity, getAllocatedEntity
    • Constructor Detail

      • AllocationLookupSyncer

        @Inject
        public AllocationLookupSyncer​(EntityReferenceFactory<org.palladiosimulator.pcm.resourceenvironment.ResourceContainer> resourceContainerReferenceFactory,
                                      PCMPartitionManager modelManager)
        Creates a new Allocation Lookup Syncer.
        Parameters:
        resourceContainerAccess - a service to look up simulate resource container instances based on the id of their model counterpart.
    • Method Detail

      • handleNotification

        protected void handleNotification​(Notification msg)
      • getAllocatedEntity

        public EntityReference<org.palladiosimulator.pcm.resourceenvironment.ResourceContainer> getAllocatedEntity​(String assemblyContextId)
        Returns the simulated resource container to which the provided assembly is allocated to. If the assembly is not allocated directly, but through a hierarchy of CompositeComponents, the lookup needs to be done using the string representation of the FQComponentID.
        Specified by:
        getAllocatedEntity in interface de.uka.ipd.sdq.simucomframework.resources.IAssemblyAllocationLookup<EntityReference<org.palladiosimulator.pcm.resourceenvironment.ResourceContainer>>
        Returns:
        the simulated resource container
      • addInitialAllocations

        protected void addInitialAllocations​(org.palladiosimulator.pcm.allocation.Allocation allocation)
        Traverses a provided Allocation model and creates mappings for all containers Allocation contexts.
        Parameters:
        allocation - the Allocation model
      • addAssemblyAllocation

        protected void addAssemblyAllocation​(org.palladiosimulator.pcm.core.composition.AssemblyContext ctx,
                                             List<org.palladiosimulator.pcm.core.composition.AssemblyContext> ctxHierarchy,
                                             EntityReference<org.palladiosimulator.pcm.resourceenvironment.ResourceContainer> container)
        Adds an entry for the provided assembly context taking into account a stack of assembly contexts capturing the assemblies of containing composite components. In case the assembly refers to a CompositeComponent the method recursively descends to include mappings for the assemblies contained in the CompositeComponent.
        Parameters:
        ctx - the assembly context to create a mapping for.
        ctxHierarchy - the assemblies of potential enclosing CompositeComponents. Provide an empty list if none.
        container - the simulated resource container to which the assembly context is allocated.
      • removeAssemblyAllocation

        protected void removeAssemblyAllocation​(org.palladiosimulator.pcm.core.composition.AssemblyContext ctx,
                                                List<org.palladiosimulator.pcm.core.composition.AssemblyContext> ctxHierarchy)
        Removes the entry for the provided assembly context taking into account a stack of assembly contexts capturing the assemblies of containing composite components. In case the assembly refers to a CompositeComponent the method recursively descends to also remove mappings for the assemblies contained in the CompositeComponent.
        Parameters:
        ctx - the assembly context to remove the mapping.
        ctxHierarchy - the assemblies of potential enclosing CompositeComponents. Provide an empty list if none.