Examples of JarFileClassLoader


Examples of org.apache.xbean.classloader.JarFileClassLoader

                        file, file.getAbsolutePath());
            }
            urls.add(file.toURL());
        }

        ClassLoader cl = new JarFileClassLoader(
                        "Component ClassLoader",
                        (URL[]) urls.toArray(new URL[urls.size()]),
                        parents,
                        !parentFirst,
                        new String[0],
View Full Code Here

Examples of org.apache.xbean.classloader.JarFileClassLoader

                }
            } else {
                try {
                    URL[] urls = getDefaultLocations();
                    ClassLoader parentLoader = getParentClassLoader(applicationContext);
                    classLoader = new JarFileClassLoader(applicationContext.getDisplayName(), urls, parentLoader);
                    // assign the class loader to the xml reader and the
                    // application context
                } catch (Exception e) {
                    throw new FatalBeanException("Unable to create default classloader for SU", e);
                }
View Full Code Here

Examples of org.apache.xbean.classloader.JarFileClassLoader

            }

            // create the classloader
            List<ClassLoader> parents = new ArrayList<ClassLoader>();
            parents.add(getParentClassLoader(applicationContext));
            classLoader = new JarFileClassLoader(applicationContext.getDisplayName(),
                                                 urls,
                                                 parents.toArray(new ClassLoader[parents.size()]),
                                                 inverse,
                                                 hidden.toArray(new String[hidden.size()]),
                                                 nonOverridable.toArray(new String[nonOverridable.size()]));
View Full Code Here

Examples of org.apache.xbean.classloader.JarFileClassLoader

                        + file.getAbsolutePath());
            }
            urls.add(file.toURL());
        }

        ClassLoader cl = new JarFileClassLoader(
                        "Component ClassLoader",
                        (URL[]) urls.toArray(new URL[urls.size()]),
                        parents,
                        !parentFirst,
                        new String[0],
View Full Code Here

Examples of org.apache.xbean.classloader.JarFileClassLoader

                }
            } else {
                try {
                    URL[] urls = getDefaultLocations();
                    ClassLoader parentLoader = getParentClassLoader(applicationContext);
                    classLoader = new JarFileClassLoader(applicationContext.getDisplayName(), urls, parentLoader);
                    // assign the class loader to the xml reader and the
                    // application context
                } catch (Exception e) {
                    throw new FatalBeanException("Unable to create default classloader for SU", e);
                }
View Full Code Here

Examples of org.apache.xbean.classloader.JarFileClassLoader

                urls = getDefaultLocations();
            }

            // create the classloader
            ClassLoader parentLoader = getParentClassLoader(applicationContext);
            classLoader = new JarFileClassLoader(applicationContext.getDisplayName(),
                                                 urls,
                                                 parentLoader,
                                                 inverse,
                                                 (String[]) hidden.toArray(new String[hidden.size()]),
                                                 (String[]) nonOverridable.toArray(new String[nonOverridable.size()]));
View Full Code Here

Examples of org.apache.xbean.classloader.JarFileClassLoader

                urls[i] = file.toURL();
            } catch (MalformedURLException e) {
                throw new IllegalArgumentException(classPathNames[i], e);
            }
        }
        return new JarFileClassLoader(
                        library.getIdentification().getName(),
                        urls,
                        parent,
                        !parentFirst,
                        new String[0],
View Full Code Here

Examples of org.apache.xbean.classloader.JarFileClassLoader

                        + file.getAbsolutePath());
            }
            urls.add(file.toURL());
        }

        ClassLoader cl = new JarFileClassLoader(
                        "Component ClassLoader",
                        (URL[]) urls.toArray(new URL[urls.size()]),
                        parents,
                        !parentFirst,
                        new String[0],
View Full Code Here

Examples of org.apache.xbean.classloader.JarFileClassLoader

    public static class TestClass {
    }

    public void testParentFirstClassLoader() throws Exception {
        URLClassLoader pcl = (URLClassLoader) getClass().getClassLoader();
        ClassLoader clsLoader = new JarFileClassLoader("", pcl.getURLs(), pcl, false, new String[0], new String[0]);
        Class clazz = clsLoader.loadClass(TestClass.class.getName());
        assertSame(TestClass.class, clazz);
    }
View Full Code Here

Examples of org.apache.xbean.classloader.JarFileClassLoader

        assertSame(TestClass.class, clazz);
    }

    public void testSelfFirstClassLoader() throws Exception {
        URLClassLoader pcl = (URLClassLoader) getClass().getClassLoader();
        ClassLoader clsLoader = new JarFileClassLoader("", pcl.getURLs(), pcl, true, new String[0], new String[0]);
        Class clazz = clsLoader.loadClass(TestClass.class.getName());
        assertNotSame(TestClass.class, clazz);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.