1 | package de.uka.ipd.sdq.cip.runtime.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.uka.ipd.sdq.cip.runtime.workflow.jobs.CipJob; |
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.mdsd.AbstractWorkflowBasedMDSDLaunchConfigurationDelegate; |
15 | import de.uka.ipd.sdq.workflow.mdsd.blackboard.MDSDBlackboard; |
16 | |
17 | public class CipLaunchConfigurationDelegate |
18 | extends |
19 | AbstractWorkflowBasedMDSDLaunchConfigurationDelegate<CipConfiguration>{ |
20 | |
21 | @Override |
22 | protected MDSDBlackboard createBlackboard() { |
23 | return new MDSDBlackboard(); |
24 | } |
25 | |
26 | @Override |
27 | protected IJob createWorkflowJob(CipConfiguration config, |
28 | final ILaunch launch) throws CoreException { |
29 | return new CipJob(config,launch); |
30 | } |
31 | |
32 | @Override |
33 | protected CipConfiguration deriveConfiguration( |
34 | ILaunchConfiguration configuration, String mode) |
35 | throws CoreException { |
36 | CipConfiguration cipConfiguration = new CipConfiguration(); |
37 | |
38 | AbstractWorkflowConfigurationBuilder builder; |
39 | builder = new CipLaunchConfigurationBasedConfigBuilder(configuration,mode); |
40 | builder.fillConfiguration(cipConfiguration); |
41 | |
42 | return cipConfiguration; |
43 | } |
44 | |
45 | /* (non-Javadoc) |
46 | * @see de.uka.ipd.sdq.workflow.launchconfig.AbstractWorkflowBasedLaunchConfigurationDelegate#setupLogging(org.apache.log4j.Level) |
47 | */ |
48 | @Override |
49 | protected ArrayList<LoggerAppenderStruct> setupLogging(Level logLevel) throws CoreException { |
50 | ArrayList<LoggerAppenderStruct> loggerList = super.setupLogging(logLevel); |
51 | |
52 | // Setup openArchitectureWare Logging |
53 | loggerList.add(setupLogger("de.uka.ipd.sdq.cip", logLevel, Level.DEBUG == logLevel ? DETAILED_LOG_PATTERN : SHORT_LOG_PATTERN)); |
54 | loggerList.add(setupLogger("de.uka.ipd.sdq.workflow.mdsd.emf.qvtr", logLevel, Level.DEBUG == logLevel ? DETAILED_LOG_PATTERN : SHORT_LOG_PATTERN)); |
55 | |
56 | return loggerList; |
57 | } |
58 | |
59 | } |