Package com.alibaba.citrus.springext

Examples of com.alibaba.citrus.springext.ConfigurationPointException


        log.trace("Trying to load contributions at {}", contribLocation);

        try {
            mappings = PropertiesLoaderUtils.loadAllProperties(contribLocation, settings.classLoader);
        } catch (IOException e) {
            throw new ConfigurationPointException("Unable to load Contributions from " + contribLocation, e);
        }

        Map<String, String> sortedMappings = createTreeMap();

        for (Entry<Object, Object> entry : mappings.entrySet()) {
            String contribName = trimToNull((String) entry.getKey());
            String contribClassName = trimToNull((String) entry.getValue());

            if (getDefaultElementName() != null && isEquals(contribName, getDefaultElementName())) {
                throw new FatalBeanException(
                        "Contribution has a same name as the default element name for configuration point: contributionType="
                        + contribType + ", contribuitionClass=" + contribClassName + ", contributionName="
                        + contribName + ", configurationPoint=" + getName() + ", namespaceUri="
                        + getNamespaceUri());
            }

            sortedMappings.put(contribName, contribClassName);

            ContributionImpl contrib = new ContributionImpl(this, settings, contribType, contribName, contribClassName);
            Contribution existContrib = contributions.get(contrib.getKey());

            if (existContrib != null) {
                throw new ConfigurationPointException("Duplicated contributions from locations: " + contribLocation
                                                      + "\n" + "     " + existContrib + "\n and " + contrib);
            }

            register(contrib);
View Full Code Here


                                                                            getConfigurationPoint())));
                } else {
                    i.remove();
                }
            } else {
                throw new ConfigurationPointException("Invalid schema name: " + url);
            }
        }

        if (!resources.isEmpty() && log.isDebugEnabled()) {
            ToStringBuilder buf = new ToStringBuilder();
View Full Code Here

            return readDocument(source.getInputStream(), name, true);
        } catch (DocumentException e) {
            log.warn("Not a valid XML doc: {}, source={},\n{}", new Object[] { name, source, e.getMessage() });
            return null;
        } catch (IOException e) {
            throw new ConfigurationPointException("Failed to read text of schema file: " + name + ", source=" + source,
                                                  e);
        }
    }
View Full Code Here

        try {
            content = SchemaUtil.getDocumentText(doc, charset);
        } catch (IOException e) {
            throw e;
        } catch (Exception e) {
            throw new ConfigurationPointException("Failed to read text of schema file: " + name + ", source=" + source,
                                                  e);
        }

        return content;
    }
View Full Code Here

        log.trace("Trying to load configuration points at {}", configurationPointsLocation);

        try {
            mappings = PropertiesLoaderUtils.loadAllProperties(configurationPointsLocation, settings.classLoader);
        } catch (IOException e) {
            throw new ConfigurationPointException("Unable to load Configuration Points from "
                    + configurationPointsLocation, e);
        }

        for (Entry<Object, Object> entry : mappings.entrySet()) {
            String name = normalizeConfigurationPointName((String) entry.getKey());
            Map<String, String> params = parseNamespaceUriAndParams((String) entry.getValue());
            String namespaceUri = assertNotNull(params.get(NAMESPACE_URI_KEY), "namespaceUri");

            if (!namespaceUri.endsWith(name)) {
                throw new ConfigurationPointException("Naming Convention Violation: namespace URI [" + namespaceUri
                        + "] of configuration point should end with its name [" + name
                        + "].  This configuration point is located at " + configurationPointsLocation + ".");
            }

            String defaultElementName = params.get(DEFAULT_ELEMENT_KEY);
View Full Code Here

        log.trace("Trying to load contributions at {}", contribLocation);

        try {
            mappings = PropertiesLoaderUtils.loadAllProperties(contribLocation, settings.classLoader);
        } catch (IOException e) {
            throw new ConfigurationPointException("Unable to load Contributions from " + contribLocation, e);
        }

        Map<String, String> sortedMappings = createTreeMap();

        for (Entry<Object, Object> entry : mappings.entrySet()) {
            String contribName = trimToNull((String) entry.getKey());
            String contribClassName = trimToNull((String) entry.getValue());

            if (getDefaultElementName() != null && isEquals(contribName, getDefaultElementName())) {
                throw new FatalBeanException(
                        "Contribution has a same name as the default element name for configuration point: contributionType="
                                + contribType + ", contribuitionClass=" + contribClassName + ", contributionName="
                                + contribName + ", configurationPoint=" + getName() + ", namespaceUri="
                                + getNamespaceUri());
            }

            sortedMappings.put(contribName, contribClassName);

            ContributionImpl contrib = new ContributionImpl(this, settings, contribType, contribName, contribClassName);
            Contribution existContrib = contributions.get(contrib.getKey());

            if (existContrib != null) {
                throw new ConfigurationPointException("Duplicated contributions from locations: " + contribLocation
                        + "\n" + "     " + existContrib + "\n and " + contrib);
            }

            register(contrib);
View Full Code Here

                                    getConfigurationPoint())));
                } else {
                    i.remove();
                }
            } else {
                throw new ConfigurationPointException("Invalid schema name: " + url);
            }
        }

        if (!resources.isEmpty() && log.isDebugEnabled()) {
            ToStringBuilder buf = new ToStringBuilder();
View Full Code Here

    public static byte[] getConfigurationPointSchemaContent(ConfigurationPoint configurationPoint, String version) {
        try {
            return getDocumentContent(createConfigurationPointSchema(configurationPoint, version), null);
        } catch (Exception e) {
            throw new ConfigurationPointException("Could not generate XML Schema for configuration point "
                    + configurationPoint.getName(), e);
        }
    }
View Full Code Here

            return readDocument(source.getInputStream(), name, true);
        } catch (DocumentException e) {
            log.warn("Not a valid XML doc: {}, source={},\n{}", new Object[] { name, source, e.getMessage() });
            return null;
        } catch (IOException e) {
            throw new ConfigurationPointException("Failed to read text of schema file: " + name + ", source=" + source,
                    e);
        }
    }
View Full Code Here

        try {
            content = SchemaUtil.getDocumentText(doc, charset);
        } catch (IOException e) {
            throw e;
        } catch (Exception e) {
            throw new ConfigurationPointException("Failed to read text of schema file: " + name + ", source=" + source,
                    e);
        }

        return content;
    }
View Full Code Here

TOP

Related Classes of com.alibaba.citrus.springext.ConfigurationPointException

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.