Package org.springframework.beans.factory.support

Examples of org.springframework.beans.factory.support.ManagedMap


        private ManagedMap jobTrackerManagedMap;

        public SpringXmlConfigBuilder(ParserContext parserContext) {
            this.parserContext = parserContext;
            this.configBuilder = BeanDefinitionBuilder.rootBeanDefinition(Config.class);
            this.mapConfigManagedMap = new ManagedMap();
            this.queueManagedMap = new ManagedMap();
            this.listManagedMap = new ManagedMap();
            this.setManagedMap = new ManagedMap();
            this.topicManagedMap = new ManagedMap();
            this.multiMapManagedMap = new ManagedMap();
            this.executorManagedMap = new ManagedMap();
            this.wanReplicationManagedMap = new ManagedMap();
            this.jobTrackerManagedMap = new ManagedMap();
            this.configBuilder.addPropertyValue("mapConfigs", mapConfigManagedMap);
            this.configBuilder.addPropertyValue("queueConfigs", queueManagedMap);
            this.configBuilder.addPropertyValue("listConfigs", listManagedMap);
            this.configBuilder.addPropertyValue("setConfigs", setManagedMap);
            this.configBuilder.addPropertyValue("topicConfigs", topicManagedMap);
View Full Code Here


        }
    }

    protected ManagedMap parseMap(Element element, String childElementName, AbstractDefinitionParser.ParseDelegate parserDelegate)
    {
        ManagedMap managedMap = new ManagedMap();
        List<Element> childDomElements = DomUtils.getChildElementsByTagName(element, childElementName);
        if (childDomElements.size() == 0)
        {
            childDomElements = DomUtils.getChildElements(element);
        }
        for (Element childDomElement : childDomElements)
        {
            Object key = null;
            if (hasAttribute(childDomElement, "key-ref"))
            {
                key = new RuntimeBeanReference(childDomElement.getAttribute("key-ref"));
            }
            else
            {
                if (hasAttribute(childDomElement, "key"))
                {
                    key = childDomElement.getAttribute("key");
                }
                else
                {
                    key = childDomElement.getTagName();
                }
            }
            if (hasAttribute(childDomElement, "value-ref"))
            {
                if (!isMuleExpression(childDomElement.getAttribute("value-ref")))
                {
                    managedMap.put(key, new RuntimeBeanReference(childDomElement.getAttribute("value-ref")));
                }
                else
                {
                    managedMap.put(key, childDomElement.getAttribute("value-ref"));
                }
            }
            else
            {
                managedMap.put(key, parserDelegate.parse(childDomElement));
            }
        }
        return managedMap;
    }
View Full Code Here

            {
                setRef(builder, fieldName, domElement.getAttribute("ref"));
            }
            else
            {
                ManagedMap managedMap = parseMap(domElement, childElementName, parserDelegate);
                builder.addPropertyValue(fieldName, managedMap);
            }
        }
    }
View Full Code Here

                containsRuntimeRefs = true;
            }
        }
    if(containsRuntimeRefs) {
//      return new ManagedMap(map);
            ManagedMap m = new ManagedMap();
            m.putAll(value);
            return m;
        }
    return value;
  }
View Full Code Here

                filterChainMap.put(matcher, filterChain);
            }
        }

        ManagedMap map = new ManagedMap(filterChainMap.size());
        map.putAll(filterChainMap);

        filterChainProxy.getPropertyValues().addPropertyValue("filterChainMap", map);

        return holder;
    }
View Full Code Here

            List<Element> mappingElts = DomUtils.getChildElementsByTagName(element, Elements.PORT_MAPPING);
            if(mappingElts.isEmpty()) {
                parserContext.getReaderContext().error("No port-mapping child elements specified", element);
            }

            Map mappings = new ManagedMap();

            for (Element elt : mappingElts) {
                String httpPort = elt.getAttribute(ATT_HTTP_PORT);
                String httpsPort = elt.getAttribute(ATT_HTTPS_PORT);

                if (!StringUtils.hasText(httpPort)) {
                    parserContext.getReaderContext().error("No http port supplied in port mapping", elt);
                }

                if (!StringUtils.hasText(httpsPort)) {
                    parserContext.getReaderContext().error("No https port supplied in port mapping", elt);
                }

                mappings.put(httpPort, httpsPort);
            }

            portMapper.getPropertyValues().addPropertyValue("portMappings", mappings);
        }
View Full Code Here

    someSet.add("na${age}me");
    someSet.add(new RuntimeBeanReference("${ref}"));
    someSet.add(new TypedStringValue("${age}", Integer.class));
    pvs.addPropertyValue("someSet", someSet);

    Map someMap = new ManagedMap();
    someMap.put(new TypedStringValue("key${age}"), new TypedStringValue("${age}"));
    someMap.put(new TypedStringValue("key${age}ref"), new RuntimeBeanReference("${ref}"));
    someMap.put("key1", new RuntimeBeanReference("${ref}"));
    someMap.put("key2", "${age}name");
    MutablePropertyValues innerPvs = new MutablePropertyValues();
    innerPvs.addPropertyValue("touchy", "${os.name}");
    someMap.put("key3", new RootBeanDefinition(TestBean.class, innerPvs));
    MutablePropertyValues innerPvs2 = new MutablePropertyValues(innerPvs);
    someMap.put("${key4}", new BeanDefinitionHolder(new ChildBeanDefinition("tb1", innerPvs2), "child"));
    pvs.addPropertyValue("someMap", someMap);

    RootBeanDefinition bd = new RootBeanDefinition(TestBean.class, cas, pvs);
    ac.getDefaultListableBeanFactory().registerBeanDefinition("tb2", bd);
View Full Code Here

    /**
     * {@inheritDoc}
     */
    @Override
    protected void doParse(final Element element, final ParserContext parserContext, final BeanDefinitionBuilder builder) {
        ManagedMap commands = new ManagedMap();
       
        List<Element> childs = SpringUtil.getChildElements(element);

        for(Element commandElm : childs) {
            String name = commandElm.getAttribute("name");
            Object bean = SpringUtil.parseSpringChildElement(commandElm, parserContext, builder);
            commands.put(name, bean);
        }
       
        builder.addPropertyValue("commandMap", commands);
       
        if(StringUtils.hasText(element.getAttribute("use-default"))) {
View Full Code Here

    /**
     * Parse the "ftplets" element
     */
    private Map parseFtplets(final Element childElm, final ParserContext parserContext, final BeanDefinitionBuilder builder) {
        ManagedMap ftplets = new ManagedMap();

        List<Element> childs = SpringUtil.getChildElements(childElm);

        for(Element ftpletElm : childs) {           
            ftplets.put(ftpletElm.getAttribute("name"),
                    SpringUtil.parseSpringChildElement(ftpletElm, parserContext, builder));
        }
       
        return ftplets;
    }
View Full Code Here

    /**
     * Parse listeners elements
     */
    @SuppressWarnings("unchecked")
    private Map parseListeners(final Element listenersElm, final ParserContext parserContext, final BeanDefinitionBuilder builder) {
        ManagedMap listeners = new ManagedMap();

        List<Element> childs = SpringUtil.getChildElements(listenersElm);

        for(Element listenerElm : childs) {
            Object listener = null;
            String ln = listenerElm.getLocalName();
            if("nio-listener".equals(ln)) {
                listener = parserContext.getDelegate().parseCustomElement(listenerElm, builder.getBeanDefinition());
            } else if ("listener".equals(ln)) {
                listener = SpringUtil.parseSpringChildElement(listenerElm, parserContext, builder);
            } else {
                throw new FtpServerConfigurationException("Unknown listener element " + ln);
            }
           
            String name = listenerElm.getAttribute("name");

            listeners.put(name, listener);
        }
       
        return listeners;
    }
View Full Code Here

TOP

Related Classes of org.springframework.beans.factory.support.ManagedMap

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.