Package org.apache.servicemix.jbi.deployer.descriptor

Examples of org.apache.servicemix.jbi.deployer.descriptor.SharedLibraryDesc


        // Remove files
        FileUtil.deleteFile(installRoot);
    }

    protected ClassLoader createClassLoader() {
        SharedLibraryDesc library = descriptor.getSharedLibrary();
        // Make the current ClassLoader the parent
        ClassLoader parent = BundleDelegatingClassLoader.createBundleClassLoaderFor(bundle, getClass().getClassLoader());
        boolean parentFirst = library.isParentFirstClassLoaderDelegation();
        ClassPath cp = library.getSharedLibraryClassPath();
        String[] classPathNames = cp.getPathElements();
        List<URL> urls = new ArrayList<URL>();
        for (String classPathName : classPathNames) {
            File f = new File(installRoot, classPathName);
            if (!f.exists()) {
                LOGGER.warn("Shared library classpath entry not found: '" + classPathName + "'");
            }
            try {
                urls.add(f.getCanonicalFile().toURL());
            } catch (IOException e) {
                throw new IllegalArgumentException("Shared library classpath entry not found: '" + classPathName + "'");
            }
        }
        return new MultiParentClassLoader(
                library.getIdentification().getName(),
                urls.toArray(new URL[urls.size()]),
                parent,
                !parentFirst,
                new String[0],
                new String[]{"java.", "javax."});
View Full Code Here


        // Remove files
        FileUtil.deleteFile(installRoot);
    }

    protected ClassLoader createClassLoader() {
        SharedLibraryDesc library = descriptor.getSharedLibrary();
        // Make the current ClassLoader the parent
        ClassLoader parent = new BundleDelegatingClassLoader(bundle, getClass().getClassLoader());
        boolean parentFirst = library.isParentFirstClassLoaderDelegation();
        ClassPath cp = library.getSharedLibraryClassPath();
        String[] classPathNames = cp.getPathElements();
        List<URL> urls = new ArrayList<URL>();
        for (String classPathName : classPathNames) {
            File f = new File(installRoot, classPathName);
            if (!f.exists()) {
                LOGGER.warn("Shared library classpath entry not found: '" + classPathName + "'");
            }
            try {
                urls.add(f.getCanonicalFile().toURL());
            } catch (IOException e) {
                throw new IllegalArgumentException("Shared library classpath entry not found: '" + classPathName + "'");
            }
        }
        return new MultiParentClassLoader(
                library.getIdentification().getName(),
                urls.toArray(new URL[urls.size()]),
                parent,
                !parentFirst,
                new String[0],
                new String[]{"java.", "javax."});
View Full Code Here

TOP

Related Classes of org.apache.servicemix.jbi.deployer.descriptor.SharedLibraryDesc

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.