[Major] Refactored StrolchConfiguration.xml to use environments
Now the agent requires an environment parameter to start, and the configuration of that environment is used to load different sections of the configuration file Conflicts: src/main/webapp/WEB-INF/config/StrolchConfiguration.xml
This commit is contained in:
parent
39027f7371
commit
a6341da79b
|
@ -7,6 +7,7 @@ import javax.servlet.ServletContextListener;
|
|||
import javax.servlet.annotation.WebListener;
|
||||
|
||||
import li.strolch.agent.api.StrolchAgent;
|
||||
import li.strolch.runtime.configuration.StrolchEnvironment;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
@ -23,9 +24,10 @@ public class StartupListener implements ServletContextListener {
|
|||
|
||||
String realPath = sce.getServletContext().getRealPath("/WEB-INF");
|
||||
File pathF = new File(realPath);
|
||||
String environment = StrolchEnvironment.getEnvironmentFromEnvProperties(pathF);
|
||||
logger.info("Starting Agent...");
|
||||
this.agent = new StrolchAgent();
|
||||
this.agent.setup(pathF);
|
||||
this.agent.setup(environment, pathF);
|
||||
this.agent.initialize();
|
||||
this.agent.start();
|
||||
logger.info("Agent started.");
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<StrolchConfiguration>
|
||||
<env id="dev">
|
||||
<Runtime>
|
||||
<applicationName>StrolchTutorialApp</applicationName>
|
||||
<Properties>
|
||||
|
@ -68,6 +69,8 @@
|
|||
<impl>li.strolch.rest.RestfulStrolchComponent</impl>
|
||||
<depends>SessionHandler</depends>
|
||||
<Properties>
|
||||
<corsEnabled>true</corsEnabled>
|
||||
<corsOrigin>http://localhost:8180</corsOrigin>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component>
|
||||
|
@ -79,4 +82,5 @@
|
|||
<rememberUser>true</rememberUser>
|
||||
</Properties>
|
||||
</Component>
|
||||
</env>
|
||||
</StrolchConfiguration>
|
||||
|
|
Loading…
Reference in New Issue