Add component definition registration for tooling.

This commit is contained in:
Luke Taylor 2009-06-08 22:27:55 +00:00
parent a838cf15be
commit bfa2806034
1 changed files with 18 additions and 15 deletions

View File

@ -4,6 +4,7 @@ import org.springframework.beans.factory.xml.BeanDefinitionParser;
import org.springframework.beans.factory.xml.ParserContext;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.config.RuntimeBeanReference;
import org.springframework.beans.factory.parsing.BeanComponentDefinition;
import org.springframework.beans.factory.support.AbstractBeanDefinition;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.support.RootBeanDefinition;
@ -36,6 +37,7 @@ public abstract class AbstractUserDetailsServiceBeanDefinitionParser implements
String beanId = resolveId(element, userService, parserContext);
parserContext.getRegistry().registerBeanDefinition(beanId, userService);
parserContext.registerBeanComponent(new BeanComponentDefinition(userService, beanId));
String cacheRef = element.getAttribute(CACHE_REF);
@ -47,6 +49,7 @@ public abstract class AbstractUserDetailsServiceBeanDefinitionParser implements
cachingUSBuilder.addPropertyValue("userCache", new RuntimeBeanReference(cacheRef));
BeanDefinition cachingUserService = cachingUSBuilder.getBeanDefinition();
parserContext.getRegistry().registerBeanDefinition(beanId + CACHING_SUFFIX, cachingUserService);
parserContext.registerBeanComponent(new BeanComponentDefinition(cachingUserService, beanId + CACHING_SUFFIX));
}
id = beanId;