Package java.net

Examples of java.net.URLClassLoader$URLJarHandler


            + "' has no 'Preparator-Classes' attribute");
      }
      String[] classNameArr = RegainToolkit.splitString(classNameCsv, ";", true);
     
      // Load the classes if they are not disabled
      URLClassLoader loader = null;
      for (int i = 0; i < classNameArr.length; i++) {
        // Get the class name
        String className = classNameArr[i];
        if (className.startsWith(".")) {
          className = PreparatorSettings.DEFAULT_PREPARATOR_PACKAGE + className;
        }
       
        if (isPreparatorEnabled(className, preparatorSettingsArr)) {
          // Create the class loader if nessesary
          if (loader == null) {
            loader = new URLClassLoader(new URL[] { file.toURI().toURL() });
          }
         
          // Load the preparator and add it to the preparatorHash
          Preparator prep = (Preparator) RegainToolkit.createClassInstance(className, Preparator.class, loader);
          preparatorHash.put(className, prep);
View Full Code Here


                }
            }
        }

        if (outputCL == null) {
            outputCL = new URLClassLoader(jarURLs, parentClassLoader);
        }

        Logger.log(Logger.MAX, Launcher.RESOURCES, "WebAppConfig.WebInfClassLoader", outputCL.toString());
        return outputCL;
    }
View Full Code Here

                            children[n].getName());
                }
        } else {
            Logger.log(Logger.DEBUG, RESOURCES, "Launcher.NoCommonLib");
        }
        ClassLoader commonLibCL = new URLClassLoader((URL[]) jars.toArray(new URL[jars.size()]),
                getClass().getClassLoader());
       
        Logger.log(Logger.MAX, RESOURCES, "Launcher.CLClassLoader",
                commonLibCL.toString());
        Logger.log(Logger.MAX, RESOURCES, "Launcher.CLClassLoader",
                commonLibCLPaths.toString());
                                       
        this.objectPool = new ObjectPool(args);
View Full Code Here

        });
    }

    public static synchronized URLClassLoader getClassLoader(ClassLoader parent) {
        URL[] urls = ProcessorUtil.pathToURLs(getClassPath());
        return new URLClassLoader(urls, parent);
    }
View Full Code Here

    }

    public static synchronized Class loadClass(String className, ClassLoader parent) {
        Class clazz = null;
        URL[] urls = ProcessorUtil.pathToURLs(getClassPath());
        URLClassLoader classLoader = new URLClassLoader(urls, parent);
        try {
            clazz = classLoader.loadClass(className);
        } catch (Exception e) {
            Message msg = new Message("FAIL_TO_LOAD_CLASS", LOG, className);
            throw new ToolException(msg, e);
        }
        return clazz;
View Full Code Here

    private static String getClassPath() {
        ClassLoader loader = AnnotationUtil.class.getClassLoader();
        StringBuffer classpath = new StringBuffer(System.getProperty("java.class.path"));
        if (loader instanceof URLClassLoader) {
            URLClassLoader urlloader = (URLClassLoader)loader;
            for (URL url : urlloader.getURLs()) {
                classpath.append(File.pathSeparatorChar);
                classpath.append(url.getFile());
            }
        }
        return classpath.toString();
View Full Code Here

    }
   
    public static String getClassPath(ClassLoader loader) {
        StringBuffer classPath = new StringBuffer();
        if (loader instanceof URLClassLoader) {
            URLClassLoader urlLoader = (URLClassLoader)loader;
            for (URL url : urlLoader.getURLs()) {
                String file = url.getFile();
                if (file.indexOf("junit") == -1) {
                    classPath.append(url.getFile());
                    classPath.append(System.getProperty("path.separator"));
                }
View Full Code Here

        cmd.add("-classpath");
       
        ClassLoader loader = this.getClass().getClassLoader();
        StringBuffer classpath = new StringBuffer(System.getProperty("java.class.path"));
        if (loader instanceof URLClassLoader) {
            URLClassLoader urlloader = (URLClassLoader)loader;
            for (URL url : urlloader.getURLs()) {
                classpath.append(File.pathSeparatorChar);
                classpath.append(url.getFile());
            }
        }
        cmd.add(classpath.toString());
View Full Code Here

            } catch (MalformedURLException e) {
                //ignore
            }
        }
       
        URLClassLoader loader = new URLClassLoader((URL[])urlList.toArray(new URL[urlList.size()]),
                                                   this.getClass().getClassLoader());
       
        if (list.size() > 2) {
            SecurityManager oldSm = System.getSecurityManager();
            try {
View Full Code Here

            throw new DeployerException("Cannot get the URL for the deployable '" + earDeployable + "'.", e);
        }

        // Create a Root classloader for this EAR
        // Empty classloader
        URLClassLoader earClassLoader = (URLClassLoader) newInstance(this.jClassLoaderConstructor, earURL.toExternalForm(), new URL[0],
                Thread.currentThread().getContextClassLoader());

        // Get the URLs of EJB, WEB and Clients
        List<URL> urlsEJB = new ArrayList<URL>();
        for (EJBDeployable ejb : earDeployable.getEJBDeployables()) {
View Full Code Here

TOP

Related Classes of java.net.URLClassLoader$URLJarHandler

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.