Examples of AntClassLoader


Examples of org.apache.tools.ant.AntClassLoader

        }
        forkedPathChecked = true;
        if (!cmd.haveClasspath()) {
            return;
        }
        AntClassLoader loader = null;
        try {
            loader =
                AntClassLoader.newAntClassLoader(null, getProject(),
                                                 cmd.createClasspath(getProject()),
                                                 true);
            String projectResourceName =
                LoaderUtils.classNameToResource(Project.class.getName());
            URL previous = null;
            try {
                for (Enumeration e = loader.getResources(projectResourceName);
                     e.hasMoreElements();) {
                    URL current = (URL) e.nextElement();
                    if (previous != null && !urlEquals(current, previous)) {
                        log("WARNING: multiple versions of ant detected "
                            + "in path for junit "
                            + LINE_SEP + "         " + previous
                            + LINE_SEP + "     and " + current,
                            Project.MSG_WARN);
                        return;
                    }
                    previous = current;
                }
            } catch (Exception ex) {
                // Ignore exception
            }
        } finally {
            if (loader != null) {
                loader.cleanup();
            }
        }
    }
View Full Code Here

Examples of org.apache.tools.ant.AntClassLoader

            {
                log("Loading " + driver
                        + " using AntClassLoader with classpath " + classpath,
                        Project.MSG_VERBOSE);

                loader = new AntClassLoader(project, classpath);
                dc = loader.loadClass(driver);
            }
            else
            {
                log("Loading " + driver + " using system loader.",
View Full Code Here

Examples of org.apache.tools.ant.AntClassLoader

                //
                // I think there is no real need for creating an additional
                // AntClassLoader
                // CocoonTask was already loaded via an AntClassLoader by Ant
                //
                AntClassLoader antClassLoader = new AntClassLoader(this.project, this.cocoonClasspath, false);

                log("Using Class Loader having classpath " + String.valueOf(this.cocoonClasspath), Project.MSG_INFO);
                classLoader = antClassLoader;
            } else {
                classLoader = this.getClass().getClassLoader();
View Full Code Here

Examples of org.apache.tools.ant.AntClassLoader

    protected ClassLoader getClassLoader() {
        if (_cl != null)
            return _cl;

        if (classpath != null)
            _cl = new AntClassLoader(getProject(), classpath, useParent);
        else
            _cl = new AntClassLoader(getProject().getCoreLoader(), getProject(),
                new Path(getProject()), useParent);
        _cl.setIsolated(isolate);

        return _cl;
    }
View Full Code Here

Examples of org.apache.tools.ant.AntClassLoader

          + srcdir.getAbsolutePath());
    }

    try {
      // create a specialized classloader
      AntClassLoader loader = getClassLoader();

      // create a package builder configured to use the given classloader
      PackageBuilder builder = getPackageBuilder(loader);

      // get the list of files to be added to the rulebase
View Full Code Here

Examples of org.apache.tools.ant.AntClassLoader

   * @return
   */
  private AntClassLoader getClassLoader() {
    // defining a new specialized classloader and setting it as the thread
    // context classloader
    AntClassLoader loader = null;
    if (classpath != null) {
      loader = new AntClassLoader(PackageBuilder.class.getClassLoader(),
          getProject(), classpath, false);
    } else {
      loader = new AntClassLoader(PackageBuilder.class.getClassLoader(),
          false);
    }
    loader.setThreadContextLoader();
    return loader;
  }
View Full Code Here

Examples of org.apache.tools.ant.AntClassLoader

            for (int i = 0; i < urls.length; i++) {
                URL urL = urls[i];
                getLog().info("URL " + i + ":" + urL);
            }
        } else if (classLoader instanceof AntClassLoader) {
            AntClassLoader cl = (AntClassLoader) XFireConfigLoader.class
                    .getClassLoader();
            String[] urls = cl.getClasspath().split(File.pathSeparator);
            for (int i = 0; i < urls.length; i++) {
                String url = urls[i];
                getLog().info("URL " + i + ":" + url);
            }
        } else {
View Full Code Here

Examples of org.apache.tools.ant.AntClassLoader

            }

            ClassLoader loader = null;
            if ( classPath != null && !classPath.isEmpty() )
            {
                AntClassLoader childFirstLoader = new AntClassLoader( getClass().getClassLoader(), false );
                for ( Iterator it = classPath.iterator(); it.hasNext(); )
                {
                    String path = (String) it.next();
                    childFirstLoader.addPathComponent( new File( path ) );
                }
                loader = childFirstLoader;
            }

            Binding binding = new Binding( globalVariables );
View Full Code Here

Examples of org.apache.tools.ant.AntClassLoader

            {
                log("Loading " + driver
                        + " using AntClassLoader with classpath " + classpath,
                        Project.MSG_VERBOSE);

                loader = new AntClassLoader(getProject(), classpath);
                dc = loader.loadClass(driver);
            }
            else
            {
                log("Loading " + driver + " using system loader.",
View Full Code Here

Examples of org.apache.tools.ant.AntClassLoader

                        try {
                            Class clazz = null;
                            if (classpath == null) {
                                clazz = Class.forName(className);
                            } else {
                                AntClassLoader al
                                    = pro.createClassLoader(classpath);
                                clazz = Class.forName(className, true, al);
                            }
                            if (clazz != null) {
                                if (!FilterReader.class.isAssignableFrom(clazz)) {
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.