Search in sources :

Example 6 with AssemblyContext

use of org.palladiosimulator.pcm.core.composition.AssemblyContext 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;
}
Also used : SubSystem(org.palladiosimulator.pcm.subsystem.SubSystem) ArrayList(java.util.ArrayList) AssemblyContext(org.palladiosimulator.pcm.core.composition.AssemblyContext)

Example 7 with AssemblyContext

use of org.palladiosimulator.pcm.core.composition.AssemblyContext in project Palladio-Editors-Sirius by PalladioSimulator.

the class AddAssemblyContext method execute.

@Override
public void execute(final Collection<? extends EObject> selections, final Map<String, Object> parameters) {
    final Object parameter = parameters.get(NEW_ASSEMBLY_CONTEXT);
    if (parameter == null || !(parameter instanceof AssemblyContext)) {
        return;
    }
    final AssemblyContext assemblyContext = (AssemblyContext) parameter;
    final RepositoryComponent repositoryComponent = getRepositoryComponent(assemblyContext);
    if (repositoryComponent != null) {
        assemblyContext.setEncapsulatedComponent__AssemblyContext(repositoryComponent);
        assemblyContext.setEntityName("Assembly_" + repositoryComponent.getEntityName());
    }
}
Also used : EObject(org.eclipse.emf.ecore.EObject) AssemblyContext(org.palladiosimulator.pcm.core.composition.AssemblyContext) RepositoryComponent(org.palladiosimulator.pcm.repository.RepositoryComponent)

Aggregations

AssemblyContext (org.palladiosimulator.pcm.core.composition.AssemblyContext)7 ArrayList (java.util.ArrayList)4 SubSystem (org.palladiosimulator.pcm.subsystem.SubSystem)3 EObject (org.eclipse.emf.ecore.EObject)2 EReference (org.eclipse.emf.ecore.EReference)1 PalladioSelectEObjectDialog (org.palladiosimulator.editors.commons.dialogs.selection.PalladioSelectEObjectDialog)1 AllocationContext (org.palladiosimulator.pcm.allocation.AllocationContext)1 AssemblyConnector (org.palladiosimulator.pcm.core.composition.AssemblyConnector)1 AssemblyEventConnector (org.palladiosimulator.pcm.core.composition.AssemblyEventConnector)1 AssemblyInfrastructureConnector (org.palladiosimulator.pcm.core.composition.AssemblyInfrastructureConnector)1 Connector (org.palladiosimulator.pcm.core.composition.Connector)1 EventChannelSinkConnector (org.palladiosimulator.pcm.core.composition.EventChannelSinkConnector)1 EventChannelSourceConnector (org.palladiosimulator.pcm.core.composition.EventChannelSourceConnector)1 ProvidedDelegationConnector (org.palladiosimulator.pcm.core.composition.ProvidedDelegationConnector)1 ProvidedInfrastructureDelegationConnector (org.palladiosimulator.pcm.core.composition.ProvidedInfrastructureDelegationConnector)1 RequiredDelegationConnector (org.palladiosimulator.pcm.core.composition.RequiredDelegationConnector)1 RequiredInfrastructureDelegationConnector (org.palladiosimulator.pcm.core.composition.RequiredInfrastructureDelegationConnector)1 SinkDelegationConnector (org.palladiosimulator.pcm.core.composition.SinkDelegationConnector)1 SourceDelegationConnector (org.palladiosimulator.pcm.core.composition.SourceDelegationConnector)1 RepositoryComponent (org.palladiosimulator.pcm.repository.RepositoryComponent)1