[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
This commit is contained in:
Robert von Burg 2014-08-13 16:06:09 +02:00
parent cd15808bde
commit 0b68acc803
3 changed files with 107 additions and 101 deletions

View File

@ -1,35 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<StrolchConfiguration> <StrolchConfiguration>
<Runtime> <env id="dev">
<applicationName>StrolchPersistenceTest</applicationName> <Runtime>
<Properties> <applicationName>StrolchPersistenceTest</applicationName>
<verbose>true</verbose> <Properties>
</Properties> <verbose>true</verbose>
</Runtime> </Properties>
<Component> </Runtime>
<name>RealmHandler</name> <Component>
<api>li.strolch.agent.api.RealmHandler</api> <name>RealmHandler</name>
<impl>li.strolch.agent.impl.DefaultRealmHandler</impl> <api>li.strolch.agent.api.RealmHandler</api>
<depends>PersistenceHandler</depends> <impl>li.strolch.agent.impl.DefaultRealmHandler</impl>
<Properties> <depends>PersistenceHandler</depends>
<dataStoreMode>TRANSACTIONAL</dataStoreMode> <Properties>
</Properties> <dataStoreMode>TRANSACTIONAL</dataStoreMode>
</Component> </Properties>
<Component> </Component>
<name>PersistenceHandler</name> <Component>
<api>li.strolch.persistence.api.PersistenceHandler</api> <name>PersistenceHandler</name>
<impl>li.strolch.persistence.postgresql.PostgreSqlPersistenceHandler</impl> <api>li.strolch.persistence.api.PersistenceHandler</api>
<Properties> <impl>li.strolch.persistence.postgresql.PostgreSqlPersistenceHandler</impl>
<allowSchemaCreation>true</allowSchemaCreation> <Properties>
<allowSchemaDrop>true</allowSchemaDrop> <allowSchemaCreation>true</allowSchemaCreation>
<db.url>jdbc:postgresql://localhost/testdb</db.url> <allowSchemaDrop>true</allowSchemaDrop>
<db.username>testuser</db.username> <db.url>jdbc:postgresql://localhost/testdb</db.url>
<db.password>test</db.password> <db.username>testuser</db.username>
</Properties> <db.password>test</db.password>
</Component> </Properties>
<Component> </Component>
<name>ObserverHandler</name> <Component>
<api>li.strolch.runtime.observer.ObserverHandler</api> <name>ObserverHandler</name>
<impl>li.strolch.runtime.observer.DefaultObserverHandler</impl> <api>li.strolch.runtime.observer.ObserverHandler</api>
</Component> <impl>li.strolch.runtime.observer.DefaultObserverHandler</impl>
</Component>
</env>
</StrolchConfiguration> </StrolchConfiguration>

View File

@ -1,42 +1,44 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<StrolchConfiguration> <StrolchConfiguration>
<Runtime> <env id="dev">
<applicationName>StrolchPersistenceTest</applicationName> <Runtime>
<Properties> <applicationName>StrolchPersistenceTest</applicationName>
<verbose>true</verbose> <Properties>
</Properties> <verbose>true</verbose>
</Runtime> </Properties>
<Component> </Runtime>
<name>RealmHandler</name> <Component>
<api>li.strolch.agent.api.RealmHandler</api> <name>RealmHandler</name>
<impl>li.strolch.agent.impl.DefaultRealmHandler</impl> <api>li.strolch.agent.api.RealmHandler</api>
<depends>PersistenceHandler</depends> <impl>li.strolch.agent.impl.DefaultRealmHandler</impl>
<Properties> <depends>PersistenceHandler</depends>
<realms>first, second</realms> <Properties>
<dataStoreMode.first>TRANSACTIONAL</dataStoreMode.first> <realms>first, second</realms>
<dataStoreMode.second>TRANSACTIONAL</dataStoreMode.second> <dataStoreMode.first>TRANSACTIONAL</dataStoreMode.first>
</Properties> <dataStoreMode.second>TRANSACTIONAL</dataStoreMode.second>
</Component> </Properties>
<Component> </Component>
<name>PersistenceHandler</name> <Component>
<api>li.strolch.persistence.api.PersistenceHandler</api> <name>PersistenceHandler</name>
<impl>li.strolch.persistence.postgresql.PostgreSqlPersistenceHandler</impl> <api>li.strolch.persistence.api.PersistenceHandler</api>
<Properties> <impl>li.strolch.persistence.postgresql.PostgreSqlPersistenceHandler</impl>
<allowSchemaCreation>true</allowSchemaCreation> <Properties>
<allowSchemaDrop>true</allowSchemaDrop> <allowSchemaCreation>true</allowSchemaCreation>
<allowSchemaDrop>true</allowSchemaDrop>
<db.url.first>jdbc:postgresql://localhost/testdb1</db.url.first> <db.url.first>jdbc:postgresql://localhost/testdb1</db.url.first>
<db.username.first>testuser1</db.username.first> <db.username.first>testuser1</db.username.first>
<db.password.first>test</db.password.first> <db.password.first>test</db.password.first>
<db.url.second>jdbc:postgresql://localhost/testdb2</db.url.second> <db.url.second>jdbc:postgresql://localhost/testdb2</db.url.second>
<db.username.second>testuser2</db.username.second> <db.username.second>testuser2</db.username.second>
<db.password.second>test</db.password.second> <db.password.second>test</db.password.second>
</Properties> </Properties>
</Component> </Component>
<Component> <Component>
<name>ObserverHandler</name> <name>ObserverHandler</name>
<api>li.strolch.runtime.observer.ObserverHandler</api> <api>li.strolch.runtime.observer.ObserverHandler</api>
<impl>li.strolch.runtime.observer.DefaultObserverHandler</impl> <impl>li.strolch.runtime.observer.DefaultObserverHandler</impl>
</Component> </Component>
</env>
</StrolchConfiguration> </StrolchConfiguration>

View File

@ -1,35 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<StrolchConfiguration> <StrolchConfiguration>
<Runtime> <env id="dev">
<applicationName>StrolchPersistenceTest</applicationName> <Runtime>
<Properties> <applicationName>StrolchPersistenceTest</applicationName>
<verbose>true</verbose> <Properties>
</Properties> <verbose>true</verbose>
</Runtime> </Properties>
<Component> </Runtime>
<name>RealmHandler</name> <Component>
<api>li.strolch.agent.api.RealmHandler</api> <name>RealmHandler</name>
<impl>li.strolch.agent.impl.DefaultRealmHandler</impl> <api>li.strolch.agent.api.RealmHandler</api>
<depends>PersistenceHandler</depends> <impl>li.strolch.agent.impl.DefaultRealmHandler</impl>
<Properties> <depends>PersistenceHandler</depends>
<dataStoreMode>TRANSACTIONAL</dataStoreMode> <Properties>
</Properties> <dataStoreMode>TRANSACTIONAL</dataStoreMode>
</Component> </Properties>
<Component> </Component>
<name>PersistenceHandler</name> <Component>
<api>li.strolch.persistence.api.PersistenceHandler</api> <name>PersistenceHandler</name>
<impl>li.strolch.persistence.postgresql.PostgreSqlPersistenceHandler</impl> <api>li.strolch.persistence.api.PersistenceHandler</api>
<Properties> <impl>li.strolch.persistence.postgresql.PostgreSqlPersistenceHandler</impl>
<allowSchemaCreation>true</allowSchemaCreation> <Properties>
<allowSchemaDrop>true</allowSchemaDrop> <allowSchemaCreation>true</allowSchemaCreation>
<db.url>jdbc:postgresql://localhost/testdb</db.url> <allowSchemaDrop>true</allowSchemaDrop>
<db.username>testuser</db.username> <db.url>jdbc:postgresql://localhost/testdb</db.url>
<db.password>test</db.password> <db.username>testuser</db.username>
</Properties> <db.password>test</db.password>
</Component> </Properties>
<Component> </Component>
<name>ObserverHandler</name> <Component>
<api>li.strolch.runtime.observer.ObserverHandler</api> <name>ObserverHandler</name>
<impl>li.strolch.runtime.observer.DefaultObserverHandler</impl> <api>li.strolch.runtime.observer.ObserverHandler</api>
</Component> <impl>li.strolch.runtime.observer.DefaultObserverHandler</impl>
</Component>
</env>
</StrolchConfiguration> </StrolchConfiguration>