Examples of ConfigurationPoint


Examples of com.alibaba.citrus.springext.ConfigurationPoint

                }
            }
        }

        private boolean isContributionElement(String uri, String name) {
            ConfigurationPoint cp = schemas.getConfigurationPoints().getConfigurationPointByNamespaceUri(uri);

            if (cp != null) {
                return name.equals(cp.getDefaultElementName()) // default element
                       || cp.getContribution(name, ContributionType.BEAN_DEFINITION_PARSER) != null // contribution
                       || cp.getContribution(name, ContributionType.BEAN_DEFINITION_DECORATOR) != null; // contribution
            }

            return false;
        }
View Full Code Here

Examples of com.alibaba.citrus.springext.ConfigurationPoint

            int index = 0;

            for (Element subElement : elements) {
                if (subElement.getQName().equals(XSD_ANY) && subElement.attribute("namespace") != null) {
                    String ns = subElement.attribute("namespace").getValue();
                    ConfigurationPoint cp = cps.getConfigurationPointByNamespaceUri(ns);

                    if (cp != null) {
                        indexes.add(index);
                        importings.put(ns, cp);
                    }
View Full Code Here

Examples of com.alibaba.citrus.springext.ConfigurationPoint

        }

        private void visitAnyElement(List<Element> elements, int index) {
            Element anyElement = elements.get(index);
            String ns = anyElement.attribute("namespace").getValue();
            ConfigurationPoint cp = cps.getConfigurationPointByNamespaceUri(ns);

            if (cp != null) {
                Element choiceElement = DocumentHelper.createElement(XSD_CHOICE);
                String nsPrefix = getNamespacePrefix(cp.getPreferredNsPrefix(), ns);

                // <xsd:schema xmlns:prefix="ns">
                // 注意:必须将ns定义加在顶层element,否则低版本的xerces会报错。
                root.addNamespace(nsPrefix, ns);

                // <xsd:choice minOccurs="?" maxOccurs="?" />
                if (anyElement.attribute("minOccurs") != null) {
                    choiceElement.addAttribute("minOccurs", anyElement.attribute("minOccurs").getValue());
                }

                if (anyElement.attribute("maxOccurs") != null) {
                    choiceElement.addAttribute("maxOccurs", anyElement.attribute("maxOccurs").getValue());
                }

                // <xsd:element ref="prefix:contrib" />
                for (Contribution contrib : cp.getContributions()) {
                    Element elementElement = DocumentHelper.createElement(XSD_ELEMENT);
                    elementElement.addAttribute("ref", nsPrefix + ":" + contrib.getName());
                    choiceElement.add(elementElement);
                }

                // <xsd:element ref="prefix:defaultName" />
                if (cp.getDefaultElementName() != null) {
                    Element elementElement = DocumentHelper.createElement(XSD_ELEMENT);
                    elementElement.addAttribute("ref", nsPrefix + ":" + cp.getDefaultElementName());
                    choiceElement.add(elementElement);
                }

                // 用choice取代any
                elements.set(index, choiceElement);
View Full Code Here

Examples of com.alibaba.citrus.springext.ConfigurationPoint

        return list;
    }

    private String[] getParentConfigurationPoints(String cpName) {
        ConfigurationPoint cp = schemas.getConfigurationPoints().getConfigurationPointByName(cpName);
        List<String> depList = createLinkedList();

        for (Contribution contribution : cp.getDependingContributions()) {
            depList.add(contribution.getConfigurationPoint().getName());
        }

        return depList.toArray(new String[0]);
    }
View Full Code Here

Examples of com.alibaba.citrus.springext.ConfigurationPoint

        // services/s2 includes included-schema.xsd
        // services/s3 no includes
        schemas = new SpringExtSchemaSet("TEST-INF/test15/cps");

        // 测试interceptors是否被s1和s2依赖
        ConfigurationPoint interceptors = schemas.getConfigurationPoints().getConfigurationPointByName("interceptors");
        Collection<Contribution> contributions = interceptors.getDependingContributions();

        assertEquals(2, contributions.size());

        for (Contribution contribution : contributions) {
            assertEquals("services", contribution.getConfigurationPoint().getName());
View Full Code Here

Examples of org.apache.hivemind.internal.ConfigurationPoint

    public ConfigurationPoint getConfigurationPoint(String configurationId)
    {
        checkShutdown();

        ConfigurationPoint result = (ConfigurationPoint) _configurationPoints.get(configurationId);

        if (result == null)
            throw new ApplicationRuntimeException(
                ImplMessages.noSuchConfiguration(configurationId));
View Full Code Here

Examples of org.apache.hivemind.internal.ConfigurationPoint

        return result;
    }

    public List getConfiguration(String configurationId)
    {
        ConfigurationPoint point = getConfigurationPoint(configurationId);

        return point.getElements();
    }
View Full Code Here

Examples of org.apache.hivemind.internal.ConfigurationPoint

    public ConfigurationPoint getConfigurationPoint(String configurationId, Module module)
    {
        checkShutdown();

        ConfigurationPoint result = (ConfigurationPoint) _configurationPoints.get(configurationId);

        if (result == null)
            throw new ApplicationRuntimeException(ImplMessages.noSuchConfiguration(configurationId));

        if (!result.visibleToModule(module))
            throw new ApplicationRuntimeException(ImplMessages.configurationNotVisible(
                    configurationId,
                    module));

        return result;
View Full Code Here

Examples of org.apache.hivemind.internal.ConfigurationPoint

        return result;
    }

    public Object getConfiguration(String configurationId, Module module)
    {
        ConfigurationPoint point = getConfigurationPoint(configurationId, module);

        return point.getConfiguration();
    }
View Full Code Here

Examples of org.apache.hivemind.internal.ConfigurationPoint

        List configurationPoints = (List) _configurationPointsByTypeName.get(key);

        if (configurationPoints == null)
            configurationPoints = Collections.EMPTY_LIST;

        ConfigurationPoint point = null;
        int count = 0;

        Iterator i = configurationPoints.iterator();
        while (i.hasNext())
        {
            ConfigurationPoint cp = (ConfigurationPoint) i.next();

            if (!cp.visibleToModule(module))
                continue;

            point = cp;

            count++;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.