Пример #1
0
  /**
   * Create a class loader based on the SimpleLoader
   *
   * @param parent parent class loader
   * @param path traditional classpath
   * @return the new ClassLoader
   */
  public static DynamicClassLoader create(ClassLoader parent, Path path) {
    DynamicClassLoader loader = new DynamicClassLoader(parent, false);

    loader.addLoader(new SimpleLoader(loader, path));

    loader.init();

    return loader;
  }
Пример #2
0
  /**
   * Create a class loader based on the SimpleLoader
   *
   * @param parent parent class loader
   * @param path traditional classpath
   * @param prefix the class prefix restriction
   * @return the new ClassLoader
   */
  public static DynamicClassLoader create(ClassLoader parent, Path path, String prefix) {
    DynamicClassLoader loader = new DynamicClassLoader(parent, false);

    SimpleLoader simpleLoader = new SimpleLoader(loader, path, prefix);
    simpleLoader.init();

    loader.addLoader(simpleLoader);

    loader.init();

    return loader;
  }