Package org.impalaframework.classloader

Examples of org.impalaframework.classloader.ClassRetriever


    GraphClassLoader classLoader = classLoaderRegistry.getClassLoader(moduleName);
    if (classLoader != null) {
      return classLoader;
    }
   
    ClassRetriever resourceLoader = newResourceLoader(moduleDefinition);
    List<ModuleDefinition> dependencies = dependencyManager.getOrderedModuleDependencies(moduleDefinition.getName());
   
    List<GraphClassLoader> classLoaders = new ArrayList<GraphClassLoader>();
    for (ModuleDefinition dependency : dependencies) {
      if (dependency.getName().equals(moduleDefinition.getName())) continue;
View Full Code Here


    GraphClassLoader classLoader = classLoaderRegistry.getClassLoader(moduleName);
    if (classLoader != null) {
      return classLoader;
    }
   
    ClassRetriever resourceLoader = newResourceLoader(moduleDefinition);
    List<ModuleDefinition> dependencies = dependencyManager.getOrderedModuleDependencies(moduleDefinition.getName());
   
    List<GraphClassLoader> classLoaders = new ArrayList<GraphClassLoader>();
    for (ModuleDefinition dependency : dependencies) {
      if (dependency.getName().equals(moduleDefinition.getName())) continue;
View Full Code Here

        GraphClassLoader classLoader = classLoaderRegistry.getClassLoader(moduleName);
        if (classLoader != null) {
            return classLoader;
        }
       
        ClassRetriever resourceLoader = newResourceLoader(moduleDefinition);
        List<ModuleDefinition> dependencies = dependencyManager.getOrderedModuleDependencies(moduleDefinition.getName());
       
        List<GraphClassLoader> classLoaders = new ArrayList<GraphClassLoader>();
        for (ModuleDefinition dependency : dependencies) {
            if (dependency.getName().equals(moduleDefinition.getName())) continue;
View Full Code Here

public class LibraryAwareGraphClassLoaderTest extends TestCase {
   
    private boolean internalLoad = false;
   
    public void testMaybeLoadExternalClassNull() {
        ClassRetriever moduleResourceRetriever = null;
        LibraryAwareGraphClassLoader cl = newClassLoader(moduleResourceRetriever, true);
        cl.maybeFindLibraryClassLocally("myclass", internalLoad);
    }
View Full Code Here

        LibraryAwareGraphClassLoader cl = newClassLoader(moduleResourceRetriever, true);
        cl.maybeFindLibraryClassLocally("myclass", internalLoad);
    }
   
    public void testMaybeLoadExternalClassNonEmpty() {
        ClassRetriever moduleResourceRetriever = createMock(ClassRetriever.class);
        expect(moduleResourceRetriever.getClassBytes("myclass")).andReturn(null);
       
        replay(moduleResourceRetriever);
        LibraryAwareGraphClassLoader cl = newClassLoader(moduleResourceRetriever, true);
        cl.maybeFindLibraryClassLocally("myclass", internalLoad);
        verify(moduleResourceRetriever);
View Full Code Here

            boolean loadLibraryResources) {
        ClassLoader defaultClassLoader = ClassUtils.getDefaultClassLoader();
        ModuleDefinition definition = null;
        ClassLoaderOptions loadParentFirst = new ClassLoaderOptions(true, true, true, true);
        DelegateClassLoader delegateClassLoader = null;
        ClassRetriever moduleResourceRetriever = new URLClassRetriever(new File[0]);
        LibraryAwareGraphClassLoader cl = new LibraryAwareGraphClassLoader(defaultClassLoader, delegateClassLoader, moduleResourceRetriever, moduleLibraryRetriever, definition, loadParentFirst);
        return cl;
    }
View Full Code Here

        LibraryAwareGraphClassLoader cl = new LibraryAwareGraphClassLoader(defaultClassLoader, delegateClassLoader, moduleResourceRetriever, moduleLibraryRetriever, definition, loadParentFirst);
        return cl;
    }
   
    public void testFindLibraryResources() throws Exception {
        ClassRetriever libraryRetriever = new URLClassRetriever(new File[]{new File("../sample-module3/lib/ant-launcher-1.7.0.jar")});
        LibraryAwareGraphClassLoader cl = newClassLoader(libraryRetriever, true);
        assertNotNull(cl.getLocalResource("org/apache/tools/ant/launch/Locator.class"));
    }
View Full Code Here

        LibraryAwareGraphClassLoader cl = newClassLoader(libraryRetriever, true);
        assertNotNull(cl.getLocalResource("org/apache/tools/ant/launch/Locator.class"));
    }
   
    public void testNotFindResources() throws Exception {
        ClassRetriever libraryRetriever = new URLClassRetriever(new File[]{new File("../sample-module3/lib/ant-launcher-1.7.0.jar")});
        LibraryAwareGraphClassLoader cl = newClassLoader(libraryRetriever, false);
        assertNotNull(cl.getLocalResource("org/apache/tools/ant/launch/Locator.class"));
    }
View Full Code Here

        List<Resource> resources = Arrays.asList((Resource)new FileSystemResource(new File("f1")));
        expect(moduleLocationResolver.getApplicationModuleClassLocations("m1")).andReturn(resources);
       
        replay(moduleLocationResolver);
       
        final ClassRetriever retriever = factory.newModuleClassResourceRetriever(new SimpleModuleDefinition("m1"));
        assertNotNull(retriever);
       
        verify(moduleLocationResolver);
    }
View Full Code Here

        List<Resource> resources = Arrays.asList((Resource)new FileSystemResource(new File("f1")));
        expect(moduleLocationResolver.getApplicationModuleLibraryLocations("m1")).andReturn(resources);
       
        replay(moduleLocationResolver);
       
        final ClassRetriever retriever = factory.newModuleLibraryResourceRetriever(new SimpleModuleDefinition("m1"));
        assertNotNull(retriever);
       
        verify(moduleLocationResolver);
    }
View Full Code Here

TOP

Related Classes of org.impalaframework.classloader.ClassRetriever

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.