Examples of VFSClassLoader


Examples of org.apache.commons.vfs2.impl.VFSClassLoader

        files = AccumuloVFSClassLoader.resolve(vfs, uris);

        log.debug("Rebuilding dynamic classloader using files- " + stringify(files));

        if (preDelegate)
          cl = new VFSClassLoader(files, vfs, parent.getClassLoader());
        else
          cl = new PostDelegatingVFSClassLoader(files, vfs, parent.getClassLoader());

      } catch (FileSystemException fse) {
        throw new RuntimeException(fse);
View Full Code Here

Examples of org.apache.commons.vfs2.impl.VFSClassLoader

   
    ArrayList<FileObject> pathsToMonitor = new ArrayList<FileObject>();
    files = AccumuloVFSClassLoader.resolve(vfs, uris, pathsToMonitor);

    if (preDelegate)
      cl = new VFSClassLoader(files, vfs, parent.getClassLoader());
    else
      cl = new PostDelegatingVFSClassLoader(files, vfs, parent.getClassLoader());
   
    monitor = new DefaultFileMonitor(this);
    monitor.setDelay(monitorDelay);
View Full Code Here

Examples of org.apache.commons.vfs2.impl.VFSClassLoader

    Whitebox.setInternalState(AccumuloClassLoader.class, "SITE_CONF", conf.toURI().toURL().toString());
    Whitebox.setInternalState(AccumuloVFSClassLoader.class, "lock", new Object());
    ClassLoader acl = AccumuloVFSClassLoader.getClassLoader();
    Assert.assertTrue((acl instanceof VFSClassLoader));
    Assert.assertTrue((acl.getParent() instanceof VFSClassLoader));
    VFSClassLoader arvcl = (VFSClassLoader) acl.getParent();
    Assert.assertEquals(1, arvcl.getFileObjects().length);
    // We can't be sure what the authority/host will be due to FQDN mappings, so just check the path
    Assert.assertTrue(arvcl.getFileObjects()[0].getURL().toString().contains("HelloWorld.jar"));
    Class<?> clazz1 = arvcl.loadClass("test.HelloWorld");
    Object o1 = clazz1.newInstance();
    Assert.assertEquals("Hello World!", o1.toString());
    Whitebox.setInternalState(AccumuloVFSClassLoader.class, "loader", (AccumuloReloadingVFSClassLoader) null);
  }
View Full Code Here

Examples of org.apache.commons.vfs2.impl.VFSClassLoader

    cm.removeUnusedContexts(new HashSet<String>());
  }
 
  @Test
  public void testPostDelegation() throws Exception {
    final VFSClassLoader parent = new VFSClassLoader(new FileObject[] {vfs.resolveFile(uri1.toString())}, vfs);
   
    Class<?> pclass = parent.loadClass("test.HelloWorld");
   
    ContextManager cm = new ContextManager(vfs, new ReloadingClassLoader() {
      @Override
      public ClassLoader getClassLoader() {
        return parent;
View Full Code Here

Examples of org.apache.commons.vfs2.impl.VFSClassLoader

      public ClassLoader getClassLoader() {
        return ClassLoader.getSystemClassLoader();
      }
    }, true);
   
    VFSClassLoader cl = (VFSClassLoader) arvcl.getClassLoader();
   
    FileObject[] files = cl.getFileObjects();
    Assert.assertArrayEquals(createFileSystems(dirContents), files);
   
    arvcl.close();
  }
View Full Code Here

Examples of org.apache.commons.vfs2.impl.VFSClassLoader

   
    FileObject testDir = vfs.resolveFile(TEST_DIR.toUri().toString());
    FileObject[] dirContents = testDir.getChildren();

    //Point the VFSClassLoader to all of the objects in TEST_DIR
    this.cl = new VFSClassLoader(dirContents, vfs);
  }
View Full Code Here

Examples of org.apache.commons.vfs2.impl.VFSClassLoader

            loader = localLoader;
            return localLoader.getClassLoader();
          }

          // Create the Accumulo Context ClassLoader using the DEFAULT_CONTEXT
          localLoader = createDynamicClassloader(new VFSClassLoader(vfsCP, vfs, parent));
          loader = localLoader;

          //An HDFS FileSystem and Configuration object were created for each unique HDFS namespace in the call to resolve above.
          //The HDFS Client did us a favor and cached these objects so that the next time someone calls FileSystem.get(uri), they
          //get the cached object. However, these objects were created not with the system VFS classloader, but the classloader above
View Full Code Here

Examples of org.apache.commons.vfs2.impl.VFSClassLoader

            out.print("\t" + u.toExternalForm());
          }

        } else if (classLoader instanceof VFSClassLoader) {
          out.print("Level " + classLoaderDescription + " VFS classpaths items are:");
          VFSClassLoader vcl = (VFSClassLoader) classLoader;
          for (FileObject f : vcl.getFileObjects()) {
            out.print("\t" + f.getURL().toExternalForm());
          }
        } else {
          out.print("Unknown classloader configuration " + classLoader.getClass());
        }
View Full Code Here

Examples of org.apache.commons.vfs2.impl.VFSClassLoader

        files = AccumuloVFSClassLoader.resolve(vfs, uris);

        log.debug("Rebuilding dynamic classloader using files- " + stringify(files));

        if (preDelegate)
          cl = new VFSClassLoader(files, vfs, parent.getClassLoader());
        else
          cl = new PostDelegatingVFSClassLoader(files, vfs, parent.getClassLoader());

      } catch (FileSystemException fse) {
        throw new RuntimeException(fse);
View Full Code Here

Examples of org.apache.commons.vfs2.impl.VFSClassLoader

   
    ArrayList<FileObject> pathsToMonitor = new ArrayList<FileObject>();
    files = AccumuloVFSClassLoader.resolve(vfs, uris, pathsToMonitor);

    if (preDelegate)
      cl = new VFSClassLoader(files, vfs, parent.getClassLoader());
    else
      cl = new PostDelegatingVFSClassLoader(files, vfs, parent.getClassLoader());
   
    monitor = new DefaultFileMonitor(this);
    monitor.setDelay(monitorDelay);
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.