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
linkRoles
method.- 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 ComponentInstance
getComponent()
Returns the component instance that provides or requires this role.String
getId()
Returns the id of this role.org.palladiosimulator.pcm.repository.OperationInterface
getInterface()
Returns the interface that is provided or required by this role.RoleInstance
getLinkedRole()
Returns the role that has been connected to this role by using thelinkRoles
method.static void
linkRoles(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 thelinkRoles
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
-
-