Class AllocationLookupSyncer

  • All Implemented Interfaces:
    Extension, IModelObserver

    public class AllocationLookupSyncer
    extends Object
    implements IModelObserver
    The Allocation Lookup Syncer updates the cache for the mapping of allocation context to resource container. 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.
    • Constructor Summary

      Constructors 
      Constructor Description
      AllocationLookupSyncer​(EntityReferenceFactory<org.palladiosimulator.pcm.resourceenvironment.ResourceContainer> resourceContainerReferenceFactory, org.palladiosimulator.analyzer.workflow.blackboard.PCMResourceSetPartition globalPartition, AssemblyAllocationManager allocationManager)
      Creates a new Allocation Lookup Syncer.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void addAssemblyAllocation​(org.palladiosimulator.pcm.core.composition.AssemblyContext ctx, org.palladiosimulator.pcm.system.System system, 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.
      protected void appendAssemblyContextRecursively​(org.palladiosimulator.pcm.core.entity.Entity container, org.palladiosimulator.pcm.core.composition.AssemblyContext context, org.jgrapht.Graph<org.palladiosimulator.pcm.core.entity.Entity,​?> graph)  
      protected List<org.palladiosimulator.pcm.core.composition.AssemblyContext> determineBaseAssemblyPath​(org.palladiosimulator.pcm.core.composition.AssemblyContext ctx, org.palladiosimulator.pcm.system.System system)  
      protected void handleNotification​(Notification msg)  
      void initialize()  
      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.
    • Constructor Detail

      • AllocationLookupSyncer

        @Inject
        public AllocationLookupSyncer​(EntityReferenceFactory<org.palladiosimulator.pcm.resourceenvironment.ResourceContainer> resourceContainerReferenceFactory,
                                      org.palladiosimulator.analyzer.workflow.blackboard.PCMResourceSetPartition globalPartition,
                                      AssemblyAllocationManager allocationManager)
        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)
      • 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,
                                             org.palladiosimulator.pcm.system.System system,
                                             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.
      • determineBaseAssemblyPath

        protected List<org.palladiosimulator.pcm.core.composition.AssemblyContext> determineBaseAssemblyPath​(org.palladiosimulator.pcm.core.composition.AssemblyContext ctx,
                                                                                                             org.palladiosimulator.pcm.system.System system)
      • appendAssemblyContextRecursively

        protected void appendAssemblyContextRecursively​(org.palladiosimulator.pcm.core.entity.Entity container,
                                                        org.palladiosimulator.pcm.core.composition.AssemblyContext context,
                                                        org.jgrapht.Graph<org.palladiosimulator.pcm.core.entity.Entity,​?> graph)
      • 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.