| 1 | package de.uka.ipd.sdq.codegen.simucontroller.runconfig; |
| 2 | |
| 3 | import java.util.List; |
| 4 | import java.util.Map; |
| 5 | |
| 6 | import de.uka.ipd.sdq.simulation.AbstractSimulationConfig; |
| 7 | import de.uka.ipd.sdq.workflow.launchconfig.extension.ExtendableJobConfiguration; |
| 8 | |
| 9 | public abstract class AbstractSimulationWorkflowConfiguration extends AbstractPCMCompletionWorkflowRunConfiguration |
| 10 | implements Cloneable, ExtendableJobConfiguration { |
| 11 | |
| 12 | /** The configuration of the current launch to work with. */ |
| 13 | private Map<String, Object> attributes = null; |
| 14 | |
| 15 | private boolean simulateLinkingResources; |
| 16 | |
| 17 | private String featureConfigFile; |
| 18 | |
| 19 | public AbstractSimulationWorkflowConfiguration(Map<String, Object> attributes) { |
| 20 | this.attributes = attributes; |
| 21 | } |
| 22 | |
| 23 | public boolean getSimulateLinkingResources() { |
| 24 | return simulateLinkingResources; |
| 25 | } |
| 26 | |
| 27 | public void setSimulateLinkingResources(boolean simulateLinkingResources) { |
| 28 | checkFixed(); |
| 29 | this.simulateLinkingResources = simulateLinkingResources; |
| 30 | this.setLoadMiddlewareAndCompletionFiles(simulateLinkingResources); |
| 31 | } |
| 32 | |
| 33 | public abstract AbstractSimulationConfig getSimulationConfiguration(); |
| 34 | |
| 35 | /** |
| 36 | * Get the configuration of the current launch. |
| 37 | * |
| 38 | * @return the launchConfiguration |
| 39 | */ |
| 40 | public Map<String, Object> getAttributes() { |
| 41 | return attributes; |
| 42 | } |
| 43 | |
| 44 | /** |
| 45 | * @return Returns the filename of the mark model instance containing the |
| 46 | * PCM connector completion configuration |
| 47 | */ |
| 48 | public String getFeatureConfigFile() { |
| 49 | return featureConfigFile; |
| 50 | } |
| 51 | |
| 52 | /** |
| 53 | * Sets the filename of the mark model for connector completions |
| 54 | * |
| 55 | * @param featureConfigFile |
| 56 | * File name of the connector completion file |
| 57 | */ |
| 58 | public void setFeatureConfigFile(String featureConfigFile) { |
| 59 | checkFixed(); |
| 60 | this.featureConfigFile = featureConfigFile; |
| 61 | } |
| 62 | |
| 63 | /** |
| 64 | * Call super.getPCMModelFiles and then add my own featureconfig file. |
| 65 | */ |
| 66 | @Override |
| 67 | public List<String> getPCMModelFiles() { |
| 68 | List<String> pcmModelFiles = super.getPCMModelFiles(); |
| 69 | |
| 70 | if (featureConfigFile != null) |
| 71 | pcmModelFiles.add(featureConfigFile); |
| 72 | |
| 73 | return pcmModelFiles; |
| 74 | } |
| 75 | |
| 76 | } |