Author: jfrederic.clere(a)jboss.com
Date: 2013-04-16 08:27:22 -0400 (Tue, 16 Apr 2013)
New Revision: 2186
Modified:
branches/7.0.x/java/org/apache/catalina/startup/ContextConfig.java
Log:
[BZ922180]: Port from Tomcat using a static initializer to init authenticators map.
Modified: branches/7.0.x/java/org/apache/catalina/startup/ContextConfig.java
===================================================================
--- branches/7.0.x/java/org/apache/catalina/startup/ContextConfig.java 2013-04-16 12:25:16
UTC (rev 2185)
+++ branches/7.0.x/java/org/apache/catalina/startup/ContextConfig.java 2013-04-16 12:27:22
UTC (rev 2186)
@@ -115,7 +115,6 @@
*/
protected static Properties authenticators = null;
-
/**
* The Context we are associated with.
*/
@@ -144,7 +143,22 @@
protected static final LoginConfig DUMMY_LOGIN_CONFIG =
new LoginConfig("NONE", null, null, 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 {
+
log.error(sm.getString("contextConfig.authenticatorResources"));
+ }
+ } catch (IOException e) {
+ log.error(sm.getString("contextConfig.authenticatorResources"),
e);
+ }
+ }
+
// ------------------------------------------------------------- Properties
@@ -276,26 +290,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 {
- log.error(sm.getString(
- "contextConfig.authenticatorResources"));
- ok=false;
- return;
- }
- } catch (IOException e) {
- log.error(sm.getString(
- "contextConfig.authenticatorResources"), e);
- ok = false;
- return;
- }
- }
// Identify the class name of the Valve we should configure
String authenticatorName = null;
Show replies by date