use of org.palladiosimulator.pcm.subsystem.SubSystem in project Palladio-Editors-Sirius by PalladioSimulator.
the class AllocationServices method getNestedUndeployedAssemblyContexts.
public Collection<AssemblyContext> getNestedUndeployedAssemblyContexts(AssemblyContext parentAssemblyContext, Allocation allocation) {
if (!(parentAssemblyContext.getEncapsulatedComponent__AssemblyContext() instanceof SubSystem))
return null;
SubSystem encapsulatedSubsystem = (SubSystem) parentAssemblyContext.getEncapsulatedComponent__AssemblyContext();
Collection<AssemblyContext> result = new ArrayList<AssemblyContext>();
for (AssemblyContext nestedAssemblyContext : encapsulatedSubsystem.getAssemblyContexts__ComposedStructure()) {
if (!isAllocated(nestedAssemblyContext, allocation))
result.add(nestedAssemblyContext);
}
return result;
}
use of org.palladiosimulator.pcm.subsystem.SubSystem in project Palladio-Editors-Sirius by PalladioSimulator.
the class AllocationServices method getUndeployedSubAssemblyContexts.
public Collection<AssemblyContext> getUndeployedSubAssemblyContexts(AssemblyContext assemblyContext, Allocation allocation, boolean recursively) {
if (!(assemblyContext.getEncapsulatedComponent__AssemblyContext() instanceof SubSystem))
throw new IllegalArgumentException("The encapsulated component of " + assemblyContext + " must be a SubSystem");
SubSystem subSystem = (SubSystem) assemblyContext.getEncapsulatedComponent__AssemblyContext();
Collection<AssemblyContext> result = new ArrayList<AssemblyContext>();
for (AssemblyContext a : subSystem.getAssemblyContexts__ComposedStructure()) {
if (!isAllocated(a, allocation)) {
result.add(a);
if (recursively && a.getEncapsulatedComponent__AssemblyContext() instanceof SubSystem) {
result.addAll(getUndeployedSubAssemblyContexts(a, allocation, true));
}
}
}
return result;
}
use of org.palladiosimulator.pcm.subsystem.SubSystem in project Palladio-Editors-Sirius by PalladioSimulator.
the class AllocationServices method getUndeployedAssemblyContexts.
public Collection<AssemblyContext> getUndeployedAssemblyContexts(Allocation allocation) {
Collection<AssemblyContext> assemblyContexts = allocation.getSystem_Allocation().getAssemblyContexts__ComposedStructure();
Collection<AssemblyContext> result = new ArrayList<AssemblyContext>();
for (AssemblyContext assemblyContext : assemblyContexts) {
if (assemblyContext.getEncapsulatedComponent__AssemblyContext() instanceof SubSystem) {
if (hasDeployedComponents((SubSystem) assemblyContext.getEncapsulatedComponent__AssemblyContext(), allocation)) {
result.add(assemblyContext);
result.addAll(getUndeployedSubAssemblyContexts(assemblyContext, allocation, true));
}
}
}
return result;
}
Aggregations