Package com.alibaba.citrus.service.resource

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


     * <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�Ĺ����У�
            // ij��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�Ĺ����У�
            // ij��loader��filterͨ��spring resource loaderע��resource���Ӷ������ݹ���á�
            // ��ʱ����null������ԭ����װ�ػ�����ȡ����Դ��
            return null;
View Full Code Here

        @Override
        @SuppressWarnings("unchecked")
        protected Set<Resource> doFindPathMatchingFileResources(Resource rootDirResource, String subPattern)
                throws IOException {
            ResourceLoadingService resourceLoadingService = getResourceLoadingService();

            // ���resource loading service�����ڣ�����resource���Ǵ�resource loading serviceȡ�õģ�
            // �����ԭ����װ�ػ�����ȡ����Դ��
            if (resourceLoadingService == null || !(rootDirResource instanceof ResourceAdapter)) {
                return super.doFindPathMatchingFileResources(rootDirResource, subPattern);
View Full Code Here

        @Override
        @SuppressWarnings("unchecked")
        protected Set<Resource> doFindPathMatchingFileResources(Resource rootDirResource, String subPattern)
                throws IOException {
            ResourceLoadingService resourceLoadingService = getResourceLoadingService();

            // ���resource loading service�����ڣ�����resource���Ǵ�resource loading serviceȡ�õģ�
            // �����ԭ����װ�ػ�����ȡ����Դ��
            if (resourceLoadingService == null || !(rootDirResource instanceof ResourceAdapter)) {
                return super.doFindPathMatchingFileResources(rootDirResource, subPattern);
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

    @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

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.