use of org.palladiosimulator.pcm.core.composition.AssemblyContext in project Palladio-Editors-Sirius by PalladioSimulator.
the class AddAllocationContextAssemblyContext method getAssemblyContext.
private AssemblyContext getAssemblyContext(AllocationContext allocationContext) {
Collection<Object> filter = new ArrayList<Object>();
filter.add(org.palladiosimulator.pcm.system.System.class);
filter.add(AssemblyContext.class);
Collection<EReference> additionalChildReferences = new ArrayList<EReference>();
PalladioSelectEObjectDialog dialog = new PalladioSelectEObjectDialog(SHELL, filter, additionalChildReferences, allocationContext.eResource().getResourceSet());
dialog.setProvidedService(AssemblyContext.class);
dialog.open();
return (AssemblyContext) dialog.getResult();
}
use of org.palladiosimulator.pcm.core.composition.AssemblyContext in project Palladio-Editors-Sirius by PalladioSimulator.
the class AddAllocationContextAssemblyContext method execute.
@Override
public void execute(final Collection<? extends EObject> selections, final Map<String, Object> parameters) {
AllocationContext allocationContext = (AllocationContext) parameters.get("instance");
AssemblyContext assemblyContext = (AssemblyContext) getAssemblyContext(allocationContext);
allocationContext.setAssemblyContext_AllocationContext(assemblyContext);
}
use of org.palladiosimulator.pcm.core.composition.AssemblyContext 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.core.composition.AssemblyContext in project iobserve-analysis by research-iobserve.
the class GraphFactory method createModelGraph.
/*
* Build Graph Helpers
*/
private ModelGraph createModelGraph() {
final Map<String, DeploymentNode> servers = new HashMap<>();
final Map<String, ComponentNode> components = new HashMap<>();
// Build Servers Nodes
for (final ResourceContainerPrivacy resContainer : this.resourceContainers.values()) {
final DeploymentNode server = new DeploymentNode(resContainer.getId(), resContainer.getEntityName(), resContainer.getGeolocation());
servers.put(resContainer.getId(), server);
}
// Build Component Nodes
for (final AssemblyContext ac : this.assemblyContexts.values()) {
final DeploymentNode hostServer = servers.get(this.ac2rcMap.get(ac.getId()));
final DataPrivacyLvl acPrivacyLvl = this.assemblyContextPrivacyLvl.get(ac.getId());
final ComponentNode component = new ComponentNode(ac.getId(), ac.getEntityName(), acPrivacyLvl, hostServer, ac.getEncapsulatedComponent__AssemblyContext().getId(), this.assemblyID2allocID.get(ac.getId()));
hostServer.addComponent(component);
components.put(ac.getId(), component);
}
// Set Edges
for (final AssemblyConnectorPrivacy acp : this.assemblyConnectors.values()) {
final String provACID = acp.getProvidingAssemblyContext_AssemblyConnector().getId();
final String reqACID = acp.getRequiringAssemblyContext_AssemblyConnector().getId();
final ComponentNode provNode = components.get(provACID);
final ComponentNode reqNode = components.get(reqACID);
final ComponentEdge edge = new ComponentEdge(acp.getId(), acp.getEntityName(), provNode, reqNode, acp.getPrivacyLevel());
provNode.addCommunicationEdge(edge);
reqNode.addCommunicationEdge(edge);
}
return new ModelGraph(servers.values(), components.values(), this.modelProvider);
}
use of org.palladiosimulator.pcm.core.composition.AssemblyContext in project iobserve-analysis by research-iobserve.
the class GraphFactory method extractAssemblyContexts.
/*
* Extract Information Helpers
*/
private void extractAssemblyContexts(final org.palladiosimulator.pcm.system.System sysModel) {
final EList<AssemblyContext> newAssemblyContexts = sysModel.getAssemblyContexts__ComposedStructure();
final Set<String> acs = new HashSet<>();
for (final AssemblyContext assemblyContext : newAssemblyContexts) {
this.assemblyContexts.put(assemblyContext.getId(), assemblyContext);
acs.add(assemblyContext.getId());
}
if (GraphFactory.LOGGER.isInfoEnabled()) {
GraphFactory.LOGGER.info("Individual Assembly Contexts found in System Model: " + acs.size());
}
}
Aggregations