Package com.alibaba.citrus.service.resource

Examples of com.alibaba.citrus.service.resource.ResourceNotFoundException


        } catch (ResourceNotFoundException e) {
            xsltRes = null;
        }

        if (xsltRes == null && failIfNotFound) {
            throw new ResourceNotFoundException("Could not find XSLT file for " + this + ", resourceName="
                    + filterMatchResult.getResourceName());
        }

        Resource resource = chain.doFilter(filterMatchResult, options);
View Full Code Here


            transformer.transform(source, result);

            return new ByteArrayResource(baos.toByteArray());
        } catch (Exception e) {
            throw new ResourceNotFoundException("Could not apply XSLT \"" + xsltResName + "\" to resource \""
                    + xmlResName + "\"", e);
        }
    }
View Full Code Here

        options = newOptions;

        log.trace("Looking for resource: name={}", resourceName);

        R resource = null;
        ResourceNotFoundException chainingException = null;

        if (visitedMappings == null) {
            visitedMappings = createLinkedList();
        }

        if (findBestMatch()) {
            // findBestMatch() ���1. �ҵ�alias����û���ҵ����յ�resource mapping
            if (lastMatchedPattern instanceof ResourceAlias) {
                if (parent != null) {
                    log.trace("Resource \"{}\" not found.  Trying to find it in super ResourceLoadingService",
                            resourceName);

                    try {
                        resource = loadParentResource(resourceName, options);
                    } catch (ResourceNotFoundException e) {
                        // alias���ı�resourceName���ʱ����쳣��Ϊcaused by�쳣
                        chainingException = e;
                    }
                }
            } else {
                // findBestMatch() ���2, 3. �ҵ�resource mapping
                ResourceLoaderMapping mapping = (ResourceLoaderMapping) lastMatchedPattern;

                resource = loadMappedResource(mapping, options);

                if (resource == null) {
                    // ����resourceName���ı䣬�򱣴��쳣��Ϊcaused by�쳣
                    if (!isEquals(resourceName, originalResourceName)) {
                        logResourceNotFound(resourceName);
                        chainingException = new ResourceNotFoundException(String.format(
                                "Could not find resource \"%s\"", resourceName));
                    }
                }
            }
        }

        // findBestMatch() ���4. ʲôҲû�ҵ�
        else {
            if (parent != null) {
                log.trace("Resource \"{}\" not found.  " + "Trying to find it in super ResourceLoadingService",
                        resourceName);

                // ֱ���׳��쳣����Ϊ�͸�parent��resourceName��δ�ı䣬û��Ҫ�����ظ����쳣��Ϣ
                resource = loadParentResource(resourceName, options);
            }
        }

        if (resource == null) {
            logResourceNotFound(originalResourceName);
            throw new ResourceNotFoundException(String.format("Could not find resource \"%s\"", originalResourceName),
                    chainingException);
        }

        log.debug("Found resource \"{}\": {}", originalResourceName, resource);
View Full Code Here

TOP

Related Classes of com.alibaba.citrus.service.resource.ResourceNotFoundException

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.