Class RoleInstance


  • public class RoleInstance
    extends Object
    A role instance is a role that is either provided or required by a ComponentInstance.

    A required role and a provided role can be connected by calling the linkRoles method.

    See Also:
    OperationProvidedRole, OperationRequiredRole
    • Constructor Detail

      • RoleInstance

        public RoleInstance​(org.palladiosimulator.pcm.repository.OperationInterface interfaze,
                            String id,
                            ComponentInstance component)
        Constructs a role instance for the specified role id that provides or requires the specified interface.
        Parameters:
        interfaze - the provided or required interface
        id - the role id
        component - the component instance that owns this role
    • Method Detail

      • linkRoles

        public static void linkRoles​(RoleInstance requiredRole,
                                     RoleInstance providedRole)
        Connects both specified roles. It is only allowed to connect a requiring role and a providing role, which has to be ensued by the caller.
        Parameters:
        requiredRole - the required role
        providedRole - the provided role
      • getLinkedRole

        public RoleInstance getLinkedRole()
        Returns the role that has been connected to this role by using the linkRoles method.
        Returns:
        the role that is connected to this role
      • getInterface

        public org.palladiosimulator.pcm.repository.OperationInterface getInterface()
        Returns the interface that is provided or required by this role.
        Returns:
        the provided or required interface
      • getId

        public String getId()
        Returns the id of this role.
        Returns:
        the role id
      • getComponent

        public ComponentInstance getComponent()
        Returns the component instance that provides or requires this role.
        Returns:
        the component instance that owns this role