Examples of GroovyClassLoader


Examples of groovy.lang.GroovyClassLoader

      classText.append("public class UpdateCheckerFormulaImpl extends UpdateCheckerFormula{\n");
      classText.append("\tpublic int mainCompare(String currentVersion,String latestVersion){\n");
      classText.append("\t\t").append(formulaDef).append('\n');
      classText.append("\t}\n");
      classText.append("}\n");
      GroovyClassLoader loader = new GroovyClassLoader(UpdateChecker.class.getClassLoader());
    try {
      Class groovyClass = loader.parseClass(classText.toString()); //TODO this his horribly slow (~500ms)  Can we parse all at once or can we do this lazily or initialize in another thread?
      return (UpdateCheckerFormula)groovyClass.newInstance();
    } catch (Exception e) {
      return new UpdateCheckerFormula();
    }
  }
View Full Code Here

Examples of groovy.lang.GroovyClassLoader

  protected final GroovyClassLoader gcl;

  public ScriptContext(ModifiableInputSource mis) { this(GroovyClassLoader.class.getClassLoader(), mis); }
  public ScriptContext(ClassLoader cl, ModifiableInputSource mis) {
    this.mis = mis;
    this.gcl = new GroovyClassLoader(cl);
  }
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.