From 997faabe1e3175bd164c8ea31cce8dbccff2eec0 Mon Sep 17 00:00:00 2001 From: Luke Taylor Date: Mon, 3 Aug 2009 00:22:47 +0000 Subject: [PATCH] SEC-1196: Removed ConfigUtils (no longer used). --- .../config/authentication/ConfigUtils.java | 46 ------------------- 1 file changed, 46 deletions(-) delete mode 100644 config/src/main/java/org/springframework/security/config/authentication/ConfigUtils.java diff --git a/config/src/main/java/org/springframework/security/config/authentication/ConfigUtils.java b/config/src/main/java/org/springframework/security/config/authentication/ConfigUtils.java deleted file mode 100644 index a504498ce9..0000000000 --- a/config/src/main/java/org/springframework/security/config/authentication/ConfigUtils.java +++ /dev/null @@ -1,46 +0,0 @@ -package org.springframework.security.config.authentication; - -import java.util.ArrayList; - -import org.springframework.beans.factory.config.BeanDefinition; -import org.springframework.beans.factory.parsing.BeanComponentDefinition; -import org.springframework.beans.factory.support.RootBeanDefinition; -import org.springframework.beans.factory.xml.ParserContext; -import org.springframework.security.config.BeanIds; -import org.w3c.dom.Element; - -/** - * Utility methods used internally by the Spring Security namespace configuration code. - * - * @author Luke Taylor - * @author Ben Alex - * @version $Id: WebConfigUtils.java 3770 2009-07-15 23:09:47Z ltaylor $ - */ -public abstract class ConfigUtils { - - /** - * Creates and registers the bean definition for the default ProviderManager instance and returns - * the BeanDefinition for it. This method will typically be called when registering authentication providers - * using the <security:provider /> tag or by other beans which have a dependency on the - * authentication manager. - * @param element the source element under which this bean should be registered. - */ - public static void registerProviderManagerIfNecessary(ParserContext pc, Element element) { - if(pc.getRegistry().containsBeanDefinition(BeanIds.AUTHENTICATION_MANAGER)) { - return; - } - - RootBeanDefinition authManager = new RootBeanDefinition(NamespaceAuthenticationManager.class); - authManager.getPropertyValues().addPropertyValue("providerBeanNames", new ArrayList()); - authManager.setSource(pc.extractSource(element.getOwnerDocument().getFirstChild())); - pc.getRegistry().registerBeanDefinition(BeanIds.AUTHENTICATION_MANAGER, authManager); - pc.registerBeanComponent(new BeanComponentDefinition(authManager, BeanIds.AUTHENTICATION_MANAGER)); - } - - @SuppressWarnings("unchecked") - public static void addAuthenticationProvider(ParserContext parserContext, String beanName, Element element) { - registerProviderManagerIfNecessary(parserContext, element); - BeanDefinition authManager = parserContext.getRegistry().getBeanDefinition(BeanIds.AUTHENTICATION_MANAGER); - ((ArrayList) authManager.getPropertyValues().getPropertyValue("providerBeanNames").getValue()).add(beanName); - } -}