1 | package de.uka.ipd.sdq.pcmsolver.runconfig; |
2 | |
3 | import java.util.ArrayList; |
4 | |
5 | import org.apache.log4j.Level; |
6 | import org.eclipse.core.runtime.CoreException; |
7 | import org.eclipse.debug.core.ILaunch; |
8 | import org.eclipse.debug.core.ILaunchConfiguration; |
9 | |
10 | import de.fzi.se.accuracy.jobs.AccuracyInfluenceAnalysisJob; |
11 | import de.uka.ipd.sdq.workflow.IJob; |
12 | import de.uka.ipd.sdq.workflow.launchconfig.AbstractWorkflowConfigurationBuilder; |
13 | import de.uka.ipd.sdq.workflow.launchconfig.LoggerAppenderStruct; |
14 | import de.uka.ipd.sdq.workflow.pcm.configurations.AbstractPCMLaunchConfigurationDelegate; |
15 | import de.uka.ipd.sdq.workflow.pcm.configurations.PCMWorkflowConfigurationBuilder; |
16 | |
17 | public class PCMSolverLaunchConfigurationDelegate |
18 | extends |
19 | AbstractPCMLaunchConfigurationDelegate<PCMSolverWorkflowRunConfiguration> { |
20 | |
21 | @Override |
22 | protected IJob createWorkflowJob(PCMSolverWorkflowRunConfiguration config, |
23 | ILaunch launch) throws CoreException { |
24 | |
25 | // To enable accuracy analysis, the former top-level job (PCMSolverReliabilityJob) |
26 | // is replaced through a new AccuracyInfluenceAnalysisJob: |
27 | PCMSolverWorkflowJobBuilder jobBuilder = new PCMSolverWorkflowJobBuilder(launch); |
28 | return new AccuracyInfluenceAnalysisJob(config, jobBuilder); |
29 | } |
30 | |
31 | @Override |
32 | protected PCMSolverWorkflowRunConfiguration deriveConfiguration( |
33 | ILaunchConfiguration configuration, String mode) |
34 | throws CoreException { |
35 | PCMSolverWorkflowRunConfiguration solverConfiguration = new PCMSolverWorkflowRunConfiguration(); |
36 | |
37 | AbstractWorkflowConfigurationBuilder builder; |
38 | |
39 | builder = new PCMWorkflowConfigurationBuilder(configuration, mode); |
40 | builder.fillConfiguration(solverConfiguration); |
41 | |
42 | builder = new PCMSolverConfigurationBasedConfigBuilder(configuration, |
43 | mode); |
44 | builder.fillConfiguration(solverConfiguration); |
45 | |
46 | return solverConfiguration; |
47 | } |
48 | |
49 | @Override |
50 | protected ArrayList<LoggerAppenderStruct> setupLogging(Level logLevel) |
51 | throws CoreException { |
52 | ArrayList<LoggerAppenderStruct> loggerList = super |
53 | .setupLogging(logLevel); |
54 | loggerList.add(setupLogger("de.uka.ipd.sdq.pcmsolver", logLevel, |
55 | Level.DEBUG == logLevel ? DETAILED_LOG_PATTERN |
56 | : SHORT_LOG_PATTERN)); |
57 | |
58 | return loggerList; |
59 | } |
60 | |
61 | } |