Search in sources :

Example 1 with Signature

use of org.palladiosimulator.pcm.repository.Signature in project Palladio-Editors-Sirius by PalladioSimulator.

the class AddSystemSpecifiedExecutionTime method execute.

@Override
public void execute(Collection<? extends EObject> selections, Map<String, Object> parameters) {
    SystemSpecifiedExecutionTime sset = (SystemSpecifiedExecutionTime) parameters.get("instance");
    Signature sig = getSignature(sset);
    for (SpecifiedQoSAnnotation s : sset.getQosAnnotations_SpecifiedQoSAnnotation().getSpecifiedQoSAnnotations_QoSAnnotations()) {
        if ((s instanceof SystemSpecifiedExecutionTime) && (s.getSignature_SpecifiedQoSAnnation() != null) && (s.getRole_SpecifiedQoSAnnotation().equals(sset.getRole_SpecifiedQoSAnnotation())) && (s.getSignature_SpecifiedQoSAnnation().equals(sig)))
            return;
    }
    sset.setSignature_SpecifiedQoSAnnation(sig);
}
Also used : Signature(org.palladiosimulator.pcm.repository.Signature) SpecifiedQoSAnnotation(org.palladiosimulator.pcm.qosannotations.SpecifiedQoSAnnotation) SystemSpecifiedExecutionTime(org.palladiosimulator.pcm.qosannotations.qos_performance.SystemSpecifiedExecutionTime)

Example 2 with Signature

use of org.palladiosimulator.pcm.repository.Signature in project Palladio-Editors-Sirius by PalladioSimulator.

the class AddSystemSpecifiedExecutionTime method getSignature.

private Signature getSignature(SystemSpecifiedExecutionTime sset) {
    Collection<Object> filter = new ArrayList<Object>();
    filter.add(Repository.class);
    filter.add(Interface.class);
    filter.add(Signature.class);
    Collection<EReference> additionalChildReferences = new ArrayList<EReference>();
    PalladioSelectEObjectDialog dialog = new PalladioSelectEObjectDialog(SHELL, filter, additionalChildReferences, sset.eResource().getResourceSet());
    dialog.setProvidedService(Signature.class);
    dialog.open();
    return (Signature) dialog.getResult();
}
Also used : PalladioSelectEObjectDialog(org.palladiosimulator.editors.commons.dialogs.selection.PalladioSelectEObjectDialog) Signature(org.palladiosimulator.pcm.repository.Signature) ArrayList(java.util.ArrayList) EObject(org.eclipse.emf.ecore.EObject) EReference(org.eclipse.emf.ecore.EReference)

Example 3 with Signature

use of org.palladiosimulator.pcm.repository.Signature in project Palladio-Editors-Sirius by PalladioSimulator.

the class AddSEFF method execute.

@Override
public void execute(Collection<? extends EObject> selections, Map<String, Object> parameters) {
    ResourceDemandingSEFF seff = (ResourceDemandingSEFF) parameters.get("instance");
    Signature signature = getSignature(seff);
    for (ServiceEffectSpecification s : seff.getBasicComponent_ServiceEffectSpecification().getServiceEffectSpecifications__BasicComponent()) {
        if (s.getDescribedService__SEFF() != null && s.getDescribedService__SEFF().equals(signature)) {
            // do nothing if the chosen signature already has a corresponding SEFF
            return;
        }
    }
    seff.setDescribedService__SEFF(signature);
}
Also used : ResourceDemandingSEFF(org.palladiosimulator.pcm.seff.ResourceDemandingSEFF) Signature(org.palladiosimulator.pcm.repository.Signature) ServiceEffectSpecification(org.palladiosimulator.pcm.seff.ServiceEffectSpecification)

Example 4 with Signature

use of org.palladiosimulator.pcm.repository.Signature in project Palladio-Editors-Sirius by PalladioSimulator.

the class AddSEFF method getSignature.

private Signature getSignature(ResourceDemandingSEFF seff) {
    // Filter list (Repository > Interface > Signature)
    Collection<Object> filter = new ArrayList<Object>();
    filter.add(Repository.class);
    filter.add(Interface.class);
    filter.add(Signature.class);
    // Additional Child References
    Collection<EReference> additionalChildReferences = new ArrayList<EReference>();
    // Creating the dialog
    PalladioSelectEObjectDialog dialog = new PalladioSelectEObjectDialog(SHELL, filter, additionalChildReferences, seff.eResource().getResourceSet());
    // Setting the needed object type
    dialog.setProvidedService(Signature.class);
    // Filter: Show only provided interfaces
    for (Object o : dialog.getTreeViewer().getExpandedElements()) {
        BasicComponent parent = seff.getBasicComponent_ServiceEffectSpecification();
        EList<ProvidedRole> providedRoles = parent.getProvidedRoles_InterfaceProvidingEntity();
        if (o instanceof Interface) {
            if (!isReferenced(providedRoles, (Interface) o)) {
                dialog.getTreeViewer().remove(o);
            }
        }
    }
    dialog.open();
    return (Signature) dialog.getResult();
}
Also used : OperationProvidedRole(org.palladiosimulator.pcm.repository.OperationProvidedRole) InfrastructureProvidedRole(org.palladiosimulator.pcm.repository.InfrastructureProvidedRole) ProvidedRole(org.palladiosimulator.pcm.repository.ProvidedRole) PalladioSelectEObjectDialog(org.palladiosimulator.editors.commons.dialogs.selection.PalladioSelectEObjectDialog) Signature(org.palladiosimulator.pcm.repository.Signature) ArrayList(java.util.ArrayList) BasicComponent(org.palladiosimulator.pcm.repository.BasicComponent) EObject(org.eclipse.emf.ecore.EObject) EReference(org.eclipse.emf.ecore.EReference) Interface(org.palladiosimulator.pcm.repository.Interface)

Example 5 with Signature

use of org.palladiosimulator.pcm.repository.Signature in project Palladio-Editors-Sirius by PalladioSimulator.

the class AddCollectionIteratorAction method getParameter.

private Parameter getParameter(CollectionIteratorAction action, ServiceEffectSpecification seff) {
    Collection<Object> filter = new ArrayList<Object>();
    filter.add(Repository.class);
    filter.add(Interface.class);
    filter.add(Signature.class);
    filter.add(Parameter.class);
    Collection<EReference> additionalChildReferences = new ArrayList<EReference>();
    PalladioSelectEObjectDialog dialog = new PalladioSelectEObjectDialog(SHELL, filter, additionalChildReferences, action.eResource().getResourceSet());
    dialog.setProvidedService(Parameter.class);
    for (Object o : dialog.getTreeViewer().getExpandedElements()) {
        if (o instanceof Signature) {
            if (!o.equals(seff.getDescribedService__SEFF())) {
                dialog.getTreeViewer().remove(o);
                continue;
            }
            EList<Parameter> parameters = null;
            if (o instanceof OperationSignature)
                parameters = ((OperationSignature) o).getParameters__OperationSignature();
            else if (o instanceof InfrastructureSignature) {
                parameters = ((InfrastructureSignature) o).getParameters__InfrastructureSignature();
            }
            for (Parameter p : parameters) {
                if (!(p.getDataType__Parameter() instanceof CollectionDataType))
                    dialog.getTreeViewer().remove(p);
            }
        }
    }
    dialog.open();
    return (Parameter) dialog.getResult();
}
Also used : OperationSignature(org.palladiosimulator.pcm.repository.OperationSignature) InfrastructureSignature(org.palladiosimulator.pcm.repository.InfrastructureSignature) PalladioSelectEObjectDialog(org.palladiosimulator.editors.commons.dialogs.selection.PalladioSelectEObjectDialog) InfrastructureSignature(org.palladiosimulator.pcm.repository.InfrastructureSignature) OperationSignature(org.palladiosimulator.pcm.repository.OperationSignature) Signature(org.palladiosimulator.pcm.repository.Signature) CollectionDataType(org.palladiosimulator.pcm.repository.CollectionDataType) ArrayList(java.util.ArrayList) Parameter(org.palladiosimulator.pcm.repository.Parameter) EObject(org.eclipse.emf.ecore.EObject) EReference(org.eclipse.emf.ecore.EReference)

Aggregations

Signature (org.palladiosimulator.pcm.repository.Signature)5 ArrayList (java.util.ArrayList)3 EObject (org.eclipse.emf.ecore.EObject)3 EReference (org.eclipse.emf.ecore.EReference)3 PalladioSelectEObjectDialog (org.palladiosimulator.editors.commons.dialogs.selection.PalladioSelectEObjectDialog)3 SpecifiedQoSAnnotation (org.palladiosimulator.pcm.qosannotations.SpecifiedQoSAnnotation)1 SystemSpecifiedExecutionTime (org.palladiosimulator.pcm.qosannotations.qos_performance.SystemSpecifiedExecutionTime)1 BasicComponent (org.palladiosimulator.pcm.repository.BasicComponent)1 CollectionDataType (org.palladiosimulator.pcm.repository.CollectionDataType)1 InfrastructureProvidedRole (org.palladiosimulator.pcm.repository.InfrastructureProvidedRole)1 InfrastructureSignature (org.palladiosimulator.pcm.repository.InfrastructureSignature)1 Interface (org.palladiosimulator.pcm.repository.Interface)1 OperationProvidedRole (org.palladiosimulator.pcm.repository.OperationProvidedRole)1 OperationSignature (org.palladiosimulator.pcm.repository.OperationSignature)1 Parameter (org.palladiosimulator.pcm.repository.Parameter)1 ProvidedRole (org.palladiosimulator.pcm.repository.ProvidedRole)1 ResourceDemandingSEFF (org.palladiosimulator.pcm.seff.ResourceDemandingSEFF)1 ServiceEffectSpecification (org.palladiosimulator.pcm.seff.ServiceEffectSpecification)1