1 | package de.uka.ipd.sdq.dsexplore.analysis; |
2 | |
3 | import java.util.ArrayList; |
4 | import java.util.List; |
5 | |
6 | import org.eclipse.emf.ecore.EObject; |
7 | |
8 | import de.uka.ipd.sdq.dsexplore.launch.DSEConstantsContainer.QualityAttribute; |
9 | import de.uka.ipd.sdq.dsexplore.qml.contracttype.QMLContractType.Dimension; |
10 | import de.uka.ipd.sdq.dsexplore.qml.handling.QMLConstantsContainer; |
11 | import de.uka.ipd.sdq.dsexplore.qml.reader.QMLDimensionReader; |
12 | |
13 | public abstract class AbstractPerformanceAttributeDeclaration implements IAnalysisQualityAttributeDeclaration{ |
14 | |
15 | protected Dimension responseTimeDimension; |
16 | protected Dimension throughputDimension; |
17 | protected Dimension maxUtilizationDimension; |
18 | |
19 | public static final String[] qualityAttributes = { |
20 | QMLConstantsContainer.QUALITY_ATTRIBUTE_DIMENSION_RESPONSETIME_DEFINITION_PATH, |
21 | QMLConstantsContainer.QUALITY_ATTRIBUTE_DIMENSION_THROUGHPUT_DEFINITION_PATH, |
22 | QMLConstantsContainer.QUALITY_ATTRIBUTE_DIMENSION_MAX_UTIL_DEFINITION_PATH}; |
23 | |
24 | public AbstractPerformanceAttributeDeclaration() { |
25 | super(); |
26 | QMLDimensionReader reader = new QMLDimensionReader(); |
27 | responseTimeDimension = reader.getDimension(qualityAttributes[0]); |
28 | throughputDimension = reader.getDimension(qualityAttributes[1]); |
29 | maxUtilizationDimension = reader.getDimension(qualityAttributes[2]); |
30 | } |
31 | |
32 | @Override |
33 | public List<Dimension> getDimensions() { |
34 | |
35 | List<Dimension> dimensionList = new ArrayList<Dimension>(2); |
36 | dimensionList.add(responseTimeDimension); |
37 | dimensionList.add(throughputDimension); |
38 | dimensionList.add(maxUtilizationDimension); |
39 | |
40 | return dimensionList; |
41 | } |
42 | |
43 | @Override |
44 | public QualityAttribute getQualityAttribute() { |
45 | return QualityAttribute.PERFORMANCE_QUALITY; |
46 | } |
47 | |
48 | |
49 | public Dimension getResponseTime() { |
50 | return this.responseTimeDimension; |
51 | } |
52 | |
53 | public Dimension getThroughput() { |
54 | return this.throughputDimension; |
55 | } |
56 | |
57 | public Dimension getMaxUtilization() { |
58 | return this.maxUtilizationDimension; |
59 | } |
60 | |
61 | } |