+ authMethod.substring(1).toLowerCase()
+ "AuthenticationHandler";
try {
// Build the realm
Class realmClass = Class.forName(realmClassName, true, parentClassLoader);
Constructor realmConstr = realmClass.getConstructor(
new Class[] {Set.class, Map.class });
this.authenticationRealm = (AuthenticationRealm) realmConstr.newInstance(
new Object[] { rolesAllowed, startupArgs });
// Build the authentication handler
Class authClass = Class.forName(authClassName);
Constructor authConstr = authClass
.getConstructor(new Class[] { Node.class, List.class,
Set.class, AuthenticationRealm.class });
this.authenticationHandler = (AuthenticationHandler) authConstr
.newInstance(new Object[] { loginConfigNode,
constraintNodes, rolesAllowed,
authenticationRealm });
} catch (ClassNotFoundException err) {
Logger.log(Logger.DEBUG, Launcher.RESOURCES,
"WebAppConfig.AuthDisabled", authMethod);
} catch (Throwable err) {
Logger.log(Logger.ERROR, Launcher.RESOURCES,
"WebAppConfig.AuthError", new String[] { authClassName,
realmClassName }, err);
}
} else if (!stringArg(startupArgs, "realmClassName", "").trim().equals("")) {
Logger.log(Logger.DEBUG, Launcher.RESOURCES, "WebAppConfig.NoWebXMLSecurityDefs");
}
// Instantiate the JNDI manager
String jndiMgrClassName = stringArg(startupArgs, "webappJndiClassName",
DEFAULT_JNDI_MGR_CLASS).trim();
if (useJNDI) {
try {
// Build the realm
Class jndiMgrClass = Class.forName(jndiMgrClassName, true, parentClassLoader);
Constructor jndiMgrConstr = jndiMgrClass.getConstructor(new Class[] {
Map.class, List.class, ClassLoader.class });
this.jndiManager = (JNDIManager) jndiMgrConstr.newInstance(new Object[] {
null, envEntryNodes, this.loader });
if (this.jndiManager != null)
this.jndiManager.setup();
} catch (ClassNotFoundException err) {
Logger.log(Logger.DEBUG, Launcher.RESOURCES,
"WebAppConfig.JNDIDisabled");
} catch (Throwable err) {
Logger.log(Logger.ERROR, Launcher.RESOURCES,
"WebAppConfig.JNDIError", jndiMgrClassName, err);
}
}
String loggerClassName = stringArg(startupArgs, "accessLoggerClassName", "").trim();
if (!loggerClassName.equals("")) {
try {
// Build the realm
Class loggerClass = Class.forName(loggerClassName, true, parentClassLoader);
Constructor loggerConstr = loggerClass.getConstructor(new Class[] {
WebAppConfiguration.class, Map.class });
this.accessLogger = (AccessLogger) loggerConstr.newInstance(new Object[] {
this, startupArgs});
} catch (Throwable err) {
Logger.log(Logger.ERROR, Launcher.RESOURCES,
"WebAppConfig.LoggerError", loggerClassName, err);
}