Package org.apache.xbean.classloader

Examples of org.apache.xbean.classloader.ResourceLocation


        List<ResourceLocation> resourceLocations = new ArrayList<ResourceLocation>();

        for (String element : currentStore.getBundleClassPath())
        {
            ResourceLocation resourceLocation = currentStore.registerClassPathElement(element);
            if (resourceLocation == null)
            {
                for (FragmentGeneration fragment : bundle.getFragments())
                {
                    resourceLocation = fragment.getArchiveStore().registerClassPathElement(element);

                    if (resourceLocation != null) break;
                }
            }
            if (resourceLocation != null) resourceLocations.add(resourceLocation);
        }

        for (FragmentGeneration fragment : bundle.getFragments())
        {
            ArchiveStore archiveStore = fragment.getArchiveStore();

            for (String element : archiveStore.getBundleClassPath())
            {
                ResourceLocation resourceLocation = archiveStore.registerClassPathElement(element);
                if (resourceLocation != null) resourceLocations.add(resourceLocation);
            }
        }

        /**
 
View Full Code Here


        List<ResourceLocation> resourceLocations = new ArrayList<ResourceLocation>();

        for (String element : currentStore.getBundleClassPath())
        {
            ResourceLocation resourceLocation = currentStore.registerClassPathElement(element);
            if (resourceLocation == null)
            {
                for (FragmentGeneration fragment : solution.getFragments())
                {
                    resourceLocation = fragment.getArchiveStore().registerClassPathElement(element);

                    if (resourceLocation != null) break;
                }
            }
            if (resourceLocation != null) resourceLocations.add(resourceLocation);
        }

        for (FragmentGeneration fragment : solution.getFragments())
        {
            ArchiveStore archiveStore = fragment.getArchiveStore();

            for (String element : archiveStore.getBundleClassPath())
            {
                ResourceLocation resourceLocation = archiveStore.registerClassPathElement(element);
                if (resourceLocation != null) resourceLocations.add(resourceLocation);
            }

            fragment.setHost(bundleGeneration);
            bundleGeneration.getFragments().add(fragment);
View Full Code Here

    public ResourceLocation registerClassPathElement(String path) throws BundleException
    {
        if (path2locations.containsKey(path)) return path2locations.get(path);

        ResourceLocation result = null;
        if (".".equals(path.trim()))
        {
            result = new BundleDirectoryResourceLocation("", resourceLocations.size());
            resourceLocations.add(result);
            path2locations.put(path, result);
View Full Code Here

    public InputStream getInputStreamForResource(int location, String path) throws IOException
    {
        if (location < 0 || location >= resourceLocations.size()) throw new IOException("Resource location index is out of bounds");

        ResourceLocation resourceLocation = resourceLocations.get(location);
        ResourceHandle handle = resourceLocation.getResourceHandle(path);

        if (handle == null) throw new IOException("Path does not correspond to a resource");

        return handle.getInputStream();
    }
View Full Code Here

    public ResourceLocation registerClassPathElement(String path) throws BundleException
    {
        if (path2locations.containsKey(path)) return path2locations.get(path);

        ResourceLocation result = null;
        if (".".equals(path.trim()))
        {
            result = new BundleDirectoryResourceLocation("", resourceLocations.size());
            resourceLocations.add(result);
            path2locations.put(path, result);
View Full Code Here

    public InputStream getInputStreamForResource(int location, String path) throws IOException
    {
        if (location < 0 || location >= resourceLocations.size()) throw new IOException("Resource location index is out of bounds");

        ResourceLocation resourceLocation = resourceLocations.get(location);
        ResourceHandle handle = resourceLocation.getResourceHandle(path);

        if (handle == null) throw new IOException("Path does not correspond to a resource");

        return handle.getInputStream();
    }
View Full Code Here

TOP

Related Classes of org.apache.xbean.classloader.ResourceLocation

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.