use of org.palladiosimulator.pcm.repository.ImplementationComponentType in project Palladio-Editors-Sirius by PalladioSimulator.
the class ComposedProvidingRequiringEntityServices method getVariableUsages.
/**
* Returns a list containing all {@link VariableUsage}s associated with the
* {@link AssemblyContext}. This means all usages that are defined on the context itself and
* those of its encapsulated component which are not overwritten.
*
* @param assemblyContext
* AssemblyContext
* @return associated VariableUsages
* @see #isOverridden(VariableUsage, AssemblyContext)
*/
public Collection<EObject> getVariableUsages(final AssemblyContext assemblyContext) {
final Collection<EObject> usages = new HashSet<>();
// only ImplementationComponentTypes can have VariableUsages
if (!(assemblyContext.getEncapsulatedComponent__AssemblyContext() instanceof ImplementationComponentType))
return usages;
final Collection<VariableUsage> componentVariableUsages = ((ImplementationComponentType) assemblyContext.getEncapsulatedComponent__AssemblyContext()).getComponentParameterUsage_ImplementationComponentType();
// combine the sets
usages.addAll(assemblyContext.getConfigParameterUsages__AssemblyContext());
for (final VariableUsage vu : componentVariableUsages) {
if (!isOverridden(vu, assemblyContext)) {
usages.add(vu);
}
}
return usages;
}
use of org.palladiosimulator.pcm.repository.ImplementationComponentType in project Palladio-Editors-Sirius by PalladioSimulator.
the class ReconnectSourceOfConformsCompleteRelation method execute.
@Override
public void execute(Collection<? extends EObject> selections, Map<String, Object> parameters) {
ImplementationComponentType newSource = (ImplementationComponentType) parameters.get("target");
ImplementationComponentType oldSource = (ImplementationComponentType) parameters.get("source");
DNodeContainer otherEnd = (DNodeContainer) parameters.get("otherEnd");
CompleteComponentType target = (CompleteComponentType) otherEnd.getTarget();
newSource.getParentCompleteComponentTypes().add(target);
oldSource.getParentCompleteComponentTypes().remove(target);
}
Aggregations