Examples of JarFileClassLoader


Examples of org.apache.xbean.classloader.JarFileClassLoader

    public void testParentFirstResource() throws Exception {
        URLClassLoader pcl = (URLClassLoader) getClass().getClassLoader();
        URL url = getClass().getResource("jndi.properties");
        url = new File(url.toURI()).getParentFile().toURL();
        ClassLoader clsLoader = new JarFileClassLoader("", new URL[] {url }, pcl, false, new String[0], new String[0]);
        URL res1 = clsLoader.getResource("jndi.properties");
        URL res2 = pcl.getResource("jndi.properties");
        assertEquals(res2, res1);
    }
View Full Code Here

Examples of org.apache.xbean.classloader.JarFileClassLoader

    public void testSelfFirstResource() throws Exception {
        URLClassLoader pcl = (URLClassLoader) getClass().getClassLoader();
        URL url = getClass().getResource("jndi.properties");
        url = new File(url.toURI()).getParentFile().toURL();
        ClassLoader clsLoader = new JarFileClassLoader("", new URL[] {url }, pcl, true, new String[0], new String[0]);
        URL res1 = clsLoader.getResource("jndi.properties");
        URL res2 = pcl.getResource("jndi.properties");
        assertFalse(res2.equals(res1));
    }
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

                urls[iterator.previousIndex()] = url;
            }

            // create the classloader
            ClassLoader parentLoader = getClassLoader(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

  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

Examples of org.apache.xbean.classloader.JarFileClassLoader

   
    public void testParentFirstResource() throws Exception {
        URLClassLoader pcl = (URLClassLoader) getClass().getClassLoader();
        URL url = getClass().getResource("jndi.properties");
        url = new File(url.toURI()).getParentFile().toURL();
        ClassLoader clsLoader = new JarFileClassLoader("", new URL[] { url }, pcl, false, new String[0], new String[0]);
        URL res1 = clsLoader.getResource("jndi.properties");
        URL res2 = pcl.getResource("jndi.properties");
        assertEquals(res2, res1);
    }
View Full Code Here

Examples of org.apache.xbean.classloader.JarFileClassLoader

   
    public void testSelfFirstResource() throws Exception {
        URLClassLoader pcl = (URLClassLoader) getClass().getClassLoader();
        URL url = getClass().getResource("jndi.properties");
        url = new File(url.toURI()).getParentFile().toURL();
        ClassLoader clsLoader = new JarFileClassLoader("", new URL[] { url }, pcl, true, new String[0], new String[0]);
        URL res1 = clsLoader.getResource("jndi.properties");
        URL res2 = pcl.getResource("jndi.properties");
        assertFalse(res2.equals(res1));
    }
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(
                        getName(),
                        urls,
                        parent,
                        !parentFirst,
                        new String[0],
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.