Class RoleInstance
- java.lang.Object
-
- edu.kit.ipd.sdq.eventsim.system.staticstructure.RoleInstance
-
public class RoleInstance extends Object
A role instance is a role that is either provided or required by aComponentInstance.A required role and a provided role can be connected by calling the
linkRolesmethod.- See Also:
OperationProvidedRole,OperationRequiredRole
-
-
Constructor Summary
Constructors Constructor Description 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.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ComponentInstancegetComponent()Returns the component instance that provides or requires this role.StringgetId()Returns the id of this role.org.palladiosimulator.pcm.repository.OperationInterfacegetInterface()Returns the interface that is provided or required by this role.RoleInstancegetLinkedRole()Returns the role that has been connected to this role by using thelinkRolesmethod.static voidlinkRoles(RoleInstance requiredRole, RoleInstance providedRole)Connects both specified roles.
-
-
-
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 interfaceid- the role idcomponent- 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 roleprovidedRole- the provided role
-
getLinkedRole
public RoleInstance getLinkedRole()
Returns the role that has been connected to this role by using thelinkRolesmethod.- 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
-
-