Skip to content
Snippets Groups Projects
Commit 8b82ee4c authored by Nikolaus Huber's avatar Nikolaus Huber
Browse files

properties file now read from arguments list

git-svn-id: https://se1.informatik.uni-wuerzburg.de/usvn/svn/code/code/DMM/trunk@11756 9e42b895-fcda-4063-8a3b-11be15eb1bbd
parent 91b22f12
No related branches found
No related tags found
No related merge requests found
......@@ -10,5 +10,6 @@
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="edu.kit.ipd.descartes.adaptation.AdaptationControl"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="default.properties"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="edu.kit.ipd.descartes.adaptation"/>
</launchConfiguration>
......@@ -85,10 +85,12 @@ public class AdaptationControl {
public static void main(String[] args) throws IOException {
BasicConfigurator.configure();
Logger.getRootLogger().setLevel(Level.DEBUG);
String propertiesfile = args[0];
AdaptationControl adaptationController = new AdaptationControl();
// Initialize controller (load models, create Action handler, etc.)
adaptationController.init();
adaptationController.init(propertiesfile);
Event triggeringEvent = adaptationController.createTriggeringEvent();
// trigger adaptation process
......@@ -133,10 +135,13 @@ public class AdaptationControl {
}
public void init() {
public void init(String propertiesFile) {
try {
// load properties file
loadProperties(DEFAULT_PROP_FILE_PATH);
if (propertiesFile == null || propertiesFile.equals(""))
loadProperties(DEFAULT_PROP_FILE_PATH);
else
loadProperties(propertiesFile);
// load required models
adaptationProcess = adaptationProcessModelLoader.load(URI.createFileURI(adaptationProcessXmiFilePath));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment