Class ComponentInstance


  • public class ComponentInstance
    extends Object
    A component instance is an instance of a component type (e.g. a BasicComponent). Component types are instantiated by putting them into their contexts:
    • the AssemblyContext defines how the component instance is wired with other component instances
    • the AllocationContext specifies the deployment of the component, i.e. on which resource container the component instance is to be executed
    • the UsageContext specifies the component usage, which includes the component's parameter characterisations
    When constructing a component instance, all three contexts have to be specified. For the UsageContext, however, it suffices to specify the component parameter characterisation.

    Once created, a component instance gives convenient access to its contexts:

    • AssemblyContext: findProvidingComponent()
    • AllocationContext: getResourceContainer()
    • UsageContext: getComponentParameters()
    • Constructor Detail

      • ComponentInstance

        public ComponentInstance​(org.palladiosimulator.pcm.repository.BasicComponent type,
                                 org.palladiosimulator.pcm.core.composition.AssemblyContext assemblyCtx,
                                 SimulatedResourceContainer deployedOn,
                                 de.uka.ipd.sdq.simucomframework.variables.stackframe.SimulatedStackframe<Object> parameters)
        Constructs a new component instance by specifying the three contexts as described in the class-level documentation.
        Parameters:
        model - the simulation model
        type - the component type that is to be instantiated
    • Method Detail

      • getProvidedRole

        public RoleInstance getProvidedRole​(org.palladiosimulator.pcm.repository.OperationProvidedRole role)
        Parameters:
        role - the role type
        Returns:
        the role instance for the specified role type
      • getRequiredRole

        public RoleInstance getRequiredRole​(org.palladiosimulator.pcm.repository.OperationRequiredRole role)
        Parameters:
        role - the role type
        Returns:
        the role instance for the specified role type
      • getProvidingComponent

        public ComponentInstance getProvidingComponent​(org.palladiosimulator.pcm.repository.OperationSignature signature)
        Parameters:
        signature - the call's signature
        Returns:
        the component instance that provides a call with the specified signature to this component instance
      • getAssemblyCtx

        public org.palladiosimulator.pcm.core.composition.AssemblyContext getAssemblyCtx()
        Returns the AssemblyContext that encapsulates this component instance.
        Returns:
        the AssemblyContext of this component instance
      • getServiceEffectSpecification

        public org.palladiosimulator.pcm.seff.ResourceDemandingSEFF getServiceEffectSpecification​(org.palladiosimulator.pcm.repository.OperationSignature signature)
        Parameters:
        signature - the signature
        Returns:
        the service effect specification of the specified signature
      • getComponentParameters

        public de.uka.ipd.sdq.simucomframework.variables.stackframe.SimulatedStackframe<Object> getComponentParameters()
        Returns:
        the parameter characterisations for the parameters of this component instance
      • getResourceContainer

        public SimulatedResourceContainer getResourceContainer()
        Returns:
        the resource container in which the component instance is deployed