/** * Initialize the BeanFactory from the ResourceBundle, for the given locale. * Synchronized because of access by parallel threads. */ protected synchronized BeanFactory initFactory(Locale locale) throws MissingResourceException, BeansException { BeanFactory parsedBundle = isCache() ? (BeanFactory) this.cachedFactories.get(locale) : null; if (parsedBundle != null) { return parsedBundle; } DefaultListableBeanFactory factory = new DefaultListableBeanFactory(getApplicationContext()); PropertiesBeanDefinitionReader reader = new PropertiesBeanDefinitionReader(factory); reader.setDefaultParentBean(this.defaultParentView); for (Iterator i = baseNames.iterator(); i.hasNext();) { ResourceBundle bundle = ResourceBundle.getBundle((String) i.next(), locale, Thread.currentThread().getContextClassLoader()); reader.registerBeanDefinitions(bundle); } factory.registerCustomEditor(Resource.class, (new ResourceEditor(getApplicationContext())).getClass()); if (isCache()) { factory.preInstantiateSingletons(); this.cachedFactories.put(locale, factory); } return factory; }
context.addBeanFactoryPostProcessor(beanFactoryPostProcessor); beanFactory.registerCustomEditor(org.w3c.dom.Element.class, co.paralleluniverse.common.util.DOMElementProprtyEditor.class);
public MuleBeanDefinitionReader(BeanDefinitionRegistry beanDefinitionRegistry, int configCount) { super(beanDefinitionRegistry); setDocumentReaderClass(MuleBeanDefinitionDocumentReader.class); setResourceLoader(new MuleResourceLoader()); // use spring 2.x's capability to autodetect whether DTD or XSD is used in the config files setValidationMode(XmlValidationModeDetector.VALIDATION_AUTO); setEntityResolver(createEntityResolver()); this.configCount = configCount; // TransformerEditor is used to convert Transformer names into transformer Objects. ((DefaultListableBeanFactory)beanDefinitionRegistry).registerCustomEditor(UMOTransformer.class, new TransformerEditor()); }