EARContext moduleContext = module.getEarContext();
LoginConfigType[] loginConfigArray = webApp.getLoginConfigArray();
if (loginConfigArray.length > 1) {
throw new DeploymentException("Web app " + module.getName() + " cannot have more than one login-config element. Currently has " + loginConfigArray.length + " login-config elements.");
}
JettyAuthenticationType authType = jettyWebApp.getAuthentication();
if (loginConfigArray.length == 1 || authType != null || jettyWebApp.isSetSecurityRealmName()) {
AbstractName factoryName = moduleContext.getNaming().createChildName(module.getModuleName(), "securityHandlerFactory", GBeanInfoBuilder.DEFAULT_J2EE_TYPE);
webModuleData.setReferencePattern("SecurityHandlerFactory", factoryName);