Package com.alibaba.citrus.service.resource

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


        }
    }

    @Test
    public void service_withParentRef() throws Exception {
        ResourceLoadingService parentService = (ResourceLoadingService) parentFactory
                .getBean("myParentResourceLoadingService");

        // myResourceLoadingService指定了parentRef=myParentResourceLoadingService
        resourceLoadingService = (ResourceLoadingService) factory.getBean("myResourceLoadingService");
View Full Code Here


        assertResourceService("/default/test.txt", "test.txt", true);
    }

    @Test
    public void service_defaultParentRef() throws Exception {
        ResourceLoadingService parentService = (ResourceLoadingService) parentFactory
                .getBean("resourceLoadingService_1");

        // resourceLoadingService_1未指定parentRef,但是parent context中包含同名的service
        resourceLoadingService = (ResourceLoadingService) factory.getBean("resourceLoadingService_1");
View Full Code Here

        assertResourceService("/default/test.txt", "test.txt", true);
    }

    @Test
    public void resourceAlias_bySuperLoader() throws Exception {
        ResourceLoadingService parentService = (ResourceLoadingService) parentFactory
                .getBean("resourceLoadingService_2");

        // resourceLoadingService_2未指定parentRef,但是parent context中包含同名的service
        resourceLoadingService = (ResourceLoadingService) factory.getBean("resourceLoadingService_2");
View Full Code Here

    @Before
    public void init() throws Exception {
        resourceLoadingService = (ResourceLoadingService) factory.getBean("resourceLoadingService");

        ResourceLoadingService parentService = (ResourceLoadingService) parentFactory.getBean("resourceLoadingService");

        assertSame(parentService, resourceLoadingService.getParent());
    }
View Full Code Here

    @Before
    public void init() throws Exception {
        resourceLoadingService = (ResourceLoadingService) factory.getBean("resourceLoadingService");

        ResourceLoadingService parentService = (ResourceLoadingService) parentFactory.getBean("resourceLoadingService");

        assertSame(parentService, resourceLoadingService.getParent());
    }
View Full Code Here

        }
    }

    @Test
    public void service_withParentRef() throws Exception {
        ResourceLoadingService parentService = (ResourceLoadingService) parentFactory
                .getBean("myParentResourceLoadingService");

        // myResourceLoadingService指定了parentRef=myParentResourceLoadingService
        resourceLoadingService = (ResourceLoadingService) factory.getBean("myResourceLoadingService");
View Full Code Here

        assertResourceService("/default/test.txt", "test.txt", true);
    }

    @Test
    public void service_defaultParentRef() throws Exception {
        ResourceLoadingService parentService = (ResourceLoadingService) parentFactory
                .getBean("resourceLoadingService_1");

        // resourceLoadingService_1未指定parentRef,但是parent context中包含同名的service
        resourceLoadingService = (ResourceLoadingService) factory.getBean("resourceLoadingService_1");
View Full Code Here

        assertResourceService("/default/test.txt", "test.txt", true);
    }

    @Test
    public void resourceAlias_bySuperLoader() throws Exception {
        ResourceLoadingService parentService = (ResourceLoadingService) parentFactory
                .getBean("resourceLoadingService_2");

        // resourceLoadingService_2未指定parentRef,但是parent context中包含同名的service
        resourceLoadingService = (ResourceLoadingService) factory.getBean("resourceLoadingService_2");
View Full Code Here

     * <p>
     * 如果返回<code>null</code>表示使用原来的装载机制来取得资源。
     * </p>
     */
    public Resource getResourceByPath(String path) {
        ResourceLoadingService resourceLoadingService = getResourceLoadingService();

        if (resourceLoadingService == null) {
            // 如果resource loading service不存在,则返回null,调用原来的装载机制来取得资源。
            return null;
        }

        com.alibaba.citrus.service.resource.Resource resource;

        try {
            resource = resourceLoadingService.getResource(path, FOR_CREATE);
        } catch (IllegalStateException e) {
            // resourceLoadingService未准备好,有可能是在初始化resource loading service的过程中,
            // 某个loader或filter通过spring resource loader注入resource,从而产生递归调用。
            // 此时返回null,调用原来的装载机制来取得资源。
            return null;
View Full Code Here

     * <p>
     * 如果返回<code>null</code>表示使用原来的装载机制来取得资源。
     * </p>
     */
    public Resource getResourceByPath(String path) {
        ResourceLoadingService resourceLoadingService = getResourceLoadingService();

        if (resourceLoadingService == null) {
            // 如果resource loading service不存在,则返回null,调用原来的装载机制来取得资源。
            return null;
        }

        com.alibaba.citrus.service.resource.Resource resource;

        try {
            resource = resourceLoadingService.getResource(path, FOR_CREATE);
        } catch (IllegalStateException e) {
            // resourceLoadingService未准备好,有可能是在初始化resource loading service的过程中,
            // 某个loader或filter通过spring resource loader注入resource,从而产生递归调用。
            // 此时返回null,调用原来的装载机制来取得资源。
            return null;
View Full Code Here

TOP

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

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.