aboutsummaryrefslogtreecommitdiff
path: root/id/ConfigWebTool/src/main/java/at
diff options
context:
space:
mode:
authorThomas Lenz <tlenz@iaik.tugraz.at>2018-02-27 08:54:36 +0100
committerThomas Lenz <tlenz@iaik.tugraz.at>2018-02-27 08:54:36 +0100
commit9d01327960b0531da64ae3ffd1b39592830dd425 (patch)
tree06d67a5224ba7de9813e6803a5aedd4a30f35cc6 /id/ConfigWebTool/src/main/java/at
parent80ea041e0240eb3d9291eb0d699bb09c90aaa2a9 (diff)
downloadmoa-id-spss-9d01327960b0531da64ae3ffd1b39592830dd425.tar.gz
moa-id-spss-9d01327960b0531da64ae3ffd1b39592830dd425.tar.bz2
moa-id-spss-9d01327960b0531da64ae3ffd1b39592830dd425.zip
some more updates are required to support postgresql databases
Diffstat (limited to 'id/ConfigWebTool/src/main/java/at')
-rw-r--r--id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/config/ConfigurationProvider.java26
1 files changed, 16 insertions, 10 deletions
diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/config/ConfigurationProvider.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/config/ConfigurationProvider.java
index 8aab7ef06..abde2089d 100644
--- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/config/ConfigurationProvider.java
+++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/config/ConfigurationProvider.java
@@ -35,6 +35,7 @@ import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.cert.CertificateException;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Properties;
import java.util.Timer;
import java.util.jar.Attributes;
@@ -52,9 +53,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.config.AutowireCapableBeanFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
-import org.springframework.web.context.support.GenericWebApplicationContext;
+import org.springframework.context.support.GenericApplicationContext;
-import at.gv.egovernment.moa.id.commons.config.SpringProfileConstants;
import at.gv.egovernment.moa.id.commons.db.NewConfigurationDBRead;
import at.gv.egovernment.moa.id.commons.ex.MOAHttpProtocolSocketFactoryException;
import at.gv.egovernment.moa.id.commons.utils.MOAHttpProtocolSocketFactory;
@@ -91,7 +91,7 @@ public class ConfigurationProvider {
private boolean pvp2logininitialzied = false;
- private ApplicationContext context = null;
+ private ClassPathXmlApplicationContext context = null;
private MOAIDConfigurationModul configModule = null;
private NewConfigurationDBRead deprecatedDBRead = null;
private FileBasedUserConfiguration userManagement = null;
@@ -140,13 +140,15 @@ public class ConfigurationProvider {
fis.close();
//initialize generic SpringContext to set profiles
- GenericWebApplicationContext rootContext = new GenericWebApplicationContext();
- if (Boolean.valueOf(props.getProperty("configuration.database.byteBasedValues", "false")))
- activeProfiles.add(SpringProfileConstants.BYTEBASEDCONFIG);
-
- log.info("Activate SpingProfiles: " + activeProfiles.toString());
- for (String el: activeProfiles)
- rootContext.getEnvironment().addActiveProfile(el);
+ GenericApplicationContext rootContext = new GenericApplicationContext();
+
+// if (Boolean.valueOf(props.getProperty("configuration.database.byteBasedValues", "false")))
+// activeProfiles.add(SpringProfileConstants.BYTEBASEDCONFIG);
+// for (String el: activeProfiles)
+// rootContext.getEnvironment().addActiveProfile(el);
+
+ //refresh generic context
+ rootContext.refresh();
//initialize SpringContext
context = new ClassPathXmlApplicationContext(
@@ -155,6 +157,10 @@ public class ConfigurationProvider {
"moaid.migration.beans.xml",
"moaid.configurationtool.beans.xml"
}, rootContext);
+
+
+ log.info("Spring-context was initialized with active profiles: "
+ + Arrays.asList(context.getEnvironment().getActiveProfiles()));
//Autowire beans in these context
AutowireCapableBeanFactory acbFactory = context.getAutowireCapableBeanFactory();