Author: jfrederic.clere(a)jboss.com
Date: 2013-04-16 08:25:16 -0400 (Tue, 16 Apr 2013)
New Revision: 2185
Modified:
branches/7.2.x/src/main/java/org/apache/catalina/startup/ContextConfig.java
Log:
[BZ922180]: Port from Tomcat using a static initializer to init authenticators map.
Modified: branches/7.2.x/src/main/java/org/apache/catalina/startup/ContextConfig.java
===================================================================
--- branches/7.2.x/src/main/java/org/apache/catalina/startup/ContextConfig.java 2013-04-15
17:01:44 UTC (rev 2184)
+++ branches/7.2.x/src/main/java/org/apache/catalina/startup/ContextConfig.java 2013-04-16
12:25:16 UTC (rev 2185)
@@ -84,6 +84,20 @@
*/
protected static Properties authenticators = null;
+ static {
+ // Load our mapping properties
+ authenticators = new Properties();
+ try {
+ InputStream is =
ContextConfig.class.getClassLoader().getResourceAsStream("org/apache/catalina/startup/Authenticators.properties");
+ if (is != null) {
+ authenticators.load(is);
+ } else {
+ CatalinaLogger.STARTUP_LOGGER.cannotFindAuthenticatoMappings();
+ }
+ } catch (IOException e) {
+ CatalinaLogger.STARTUP_LOGGER.failedLoadingAuthenticatoMappings(e);
+ }
+ }
/**
* The Context we are associated with.
@@ -233,25 +247,6 @@
customAuthenticators.get(loginConfig.getAuthMethod());
}
if (authenticator == null) {
- // Load our mapping properties if necessary
- if (authenticators == null) {
- try {
- InputStream
is=this.getClass().getClassLoader().getResourceAsStream("org/apache/catalina/startup/Authenticators.properties");
- if( is!=null ) {
- authenticators = new Properties();
- authenticators.load(is);
- } else {
- CatalinaLogger.STARTUP_LOGGER.cannotFindAuthenticatoMappings();
- ok=false;
- return;
- }
- } catch (IOException e) {
- CatalinaLogger.STARTUP_LOGGER.failedLoadingAuthenticatoMappings(e);
- ok = false;
- return;
- }
- }
-
// Identify the class name of the Valve we should configure
String authenticatorName = null;
authenticatorName =
Show replies by date