aboutsummaryrefslogtreecommitdiff
path: root/id/ConfigWebTool/src/main/java/at/gv
diff options
context:
space:
mode:
Diffstat (limited to 'id/ConfigWebTool/src/main/java/at/gv')
-rw-r--r--id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/config/ConfigurationProvider.java15
-rw-r--r--id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/exception/ConfigurationException.java6
-rw-r--r--id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/filter/AuthenticationFilter.java23
3 files changed, 20 insertions, 24 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 e176e5141..bea6220ff 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
@@ -85,19 +85,14 @@ public class ConfigurationProvider {
public static ConfigurationProvider getInstance() throws ConfigurationException {
if (instance == null) {
- synchronized (ConfigurationProvider.class) {
- instance = new ConfigurationProvider();
- }
+ instance = new ConfigurationProvider();
+ instance.inizialize();
}
return instance;
}
-
- private ConfigurationProvider() throws ConfigurationException {
- inizialize();
- }
-
+
private void inizialize() throws ConfigurationException {
configFileName = System.getProperty(SYSTEM_PROP_CONFIG);
@@ -143,10 +138,10 @@ public class ConfigurationProvider {
} catch (FileNotFoundException e) {
- throw new ConfigurationException("config.01", e);
+ throw new ConfigurationException("config.01", new Object[]{configFileName}, e);
} catch (IOException e) {
- throw new ConfigurationException("config.02", e);
+ throw new ConfigurationException("config.02", new Object[]{configFileName}, e);
} catch (MOADatabaseException e) {
throw new ConfigurationException("config.03", e);
diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/exception/ConfigurationException.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/exception/ConfigurationException.java
index ebabd600d..3aa3910cc 100644
--- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/exception/ConfigurationException.java
+++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/exception/ConfigurationException.java
@@ -35,7 +35,11 @@ public class ConfigurationException extends Exception {
public ConfigurationException(String errorname, Throwable e) {
super(LanguageHelper.getErrorString(errorname, null), e);
}
-
+
+ public ConfigurationException(String errorname, Object[] params, Throwable e) {
+ super(LanguageHelper.getErrorString(errorname, params, null), e);
+ }
+
public ConfigurationException(Throwable e) {
super(e);
}
diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/filter/AuthenticationFilter.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/filter/AuthenticationFilter.java
index 9ca1d08cc..1f631afea 100644
--- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/filter/AuthenticationFilter.java
+++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/filter/AuthenticationFilter.java
@@ -75,17 +75,6 @@ public class AuthenticationFilter implements Filter{
private static String[] excludedPages = null;
private static Pattern excludedRegEx = null;
-
-
- public AuthenticationFilter() throws ServletException {
- try {
- config = ConfigurationProvider.getInstance();
-
- } catch (ConfigurationException e) {
- throw new ServletException(AuthenticationFilter.class + ": Configuration can not be loaded!", e);
- }
- }
-
public static String getErrorPage() {
return errorPage;
}
@@ -224,9 +213,17 @@ public class AuthenticationFilter implements Filter{
}
}
- public void init(FilterConfig filterConfig) throws ServletException {
+ public void init(FilterConfig filterConfig) throws ServletException {
log.debug("Starting init of " + this.getClass().getName() + ".");
-
+
+ try {
+ config = ConfigurationProvider.getInstance();
+
+ } catch (ConfigurationException e) {
+ throw new ServletException(e.getMessage(), e);
+
+ }
+
// login page
loginPage = StringUtils.trim(filterConfig.getInitParameter(WEB_XML_INIT_PARAM_LOGIN_PAGE));
if (MiscUtil.isEmpty(loginPage)) {