ClassLoader setCRaSHLoader() { Thread thread = Thread.currentThread(); ClassLoader previous = thread.getContextClassLoader(); thread.setContextClassLoader(crash.context.getLoader()); return previous; }
public GroovyCompiler(PluginContext context) { this.objectGroovyClassFactory = new GroovyClassFactory<Object>(context.getLoader(), Object.class, GroovyScriptCommand.class); }
@Override public void init() { compiler = new JavaCompiler(getContext().getLoader()); }
public GroovyLanguage(PluginContext context) { compiler = new GroovyCompiler(context); repl = new GroovyRepl(this); scriptCache = new ClassCache<GroovyScript>(context, new GroovyClassFactory<GroovyScript>(context.getLoader(), GroovyScript.class, GroovyScript.class), ResourceKind.LIFECYCLE); }
/** * The underlying groovu shell used for the REPL. * * @return a groovy shell operating on the session attributes */ public static GroovyShell getGroovyShell(ShellSession session) { GroovyShell shell = (GroovyShell)session.get("shell"); if (shell == null) { CompilerConfiguration config = new CompilerConfiguration(); config.setRecompileGroovySource(true); ShellBinding binding = new ShellBinding(session, session); shell = new GroovyShell(session.getContext().getLoader(), binding, config); session.put("shell", shell); } return shell; }
ClassLoader setCRaSHLoader() { Thread thread = Thread.currentThread(); ClassLoader previous = thread.getContextClassLoader(); thread.setContextClassLoader(crash.context.getLoader()); return previous; }
ClassLoader setCRaSHLoader() { Thread thread = Thread.currentThread(); ClassLoader previous = thread.getContextClassLoader(); thread.setContextClassLoader(crash.context.getLoader()); return previous; }
ClassLoader setCRaSHLoader() { Thread thread = Thread.currentThread(); ClassLoader previous = thread.getContextClassLoader(); thread.setContextClassLoader(crash.context.getLoader()); return previous; }
public GroovyCompiler(PluginContext context) { this.objectGroovyClassFactory = new GroovyClassFactory<Object>(context.getLoader(), Object.class, GroovyScriptCommand.class); }
public GroovyCompiler(PluginContext context) { this.objectGroovyClassFactory = new GroovyClassFactory<Object>(context.getLoader(), Object.class, GroovyScriptCommand.class); }
/** * Used for testing purposes. * * @return a groovy shell operating on the session attributes */ public GroovyShell getGroovyShell() { if (groovyShell == null) { CompilerConfiguration config = new CompilerConfiguration(); config.setRecompileGroovySource(true); config.setScriptBaseClass(GroovyScriptCommand.class.getName()); groovyShell = new GroovyShell(crash.context.getLoader(), new Binding(this), config); } return groovyShell; }
@Override public void init() { compiler = new JavaCompiler(getContext().getLoader()); }
@Override public void init() { compiler = new JavaCompiler(getContext().getLoader()); }
public GroovyLanguage(PluginContext context) { compiler = new GroovyCompiler(context); repl = new GroovyRepl(this); scriptCache = new ClassCache<GroovyScript>(context, new GroovyClassFactory<GroovyScript>(context.getLoader(), GroovyScript.class, GroovyScript.class), ResourceKind.LIFECYCLE); }
public GroovyLanguage(PluginContext context) { compiler = new GroovyCompiler(context); repl = new GroovyRepl(this); scriptCache = new ClassCache<GroovyScript>(context, new GroovyClassFactory<GroovyScript>(context.getLoader(), GroovyScript.class, GroovyScript.class), ResourceKind.LIFECYCLE); }
/** * The underlying groovu shell used for the REPL. * * @return a groovy shell operating on the session attributes */ public static GroovyShell getGroovyShell(ShellSession session) { GroovyShell shell = (GroovyShell)session.get("shell"); if (shell == null) { CompilerConfiguration config = new CompilerConfiguration(); config.setRecompileGroovySource(true); ShellBinding binding = new ShellBinding(session, session); shell = new GroovyShell(session.getContext().getLoader(), binding, config); session.put("shell", shell); } return shell; }
/** * The underlying groovu shell used for the REPL. * * @return a groovy shell operating on the session attributes */ public static GroovyShell getGroovyShell(ShellSession session) { GroovyShell shell = (GroovyShell)session.get("shell"); if (shell == null) { CompilerConfiguration config = new CompilerConfiguration(); config.setRecompileGroovySource(true); ShellBinding binding = new ShellBinding(session, session); shell = new GroovyShell(session.getContext().getLoader(), binding, config); session.put("shell", shell); } return shell; }
try { GroovyCodeSource gcs = new GroovyCodeSource(source, name, "/groovy/shell"); GroovyClassLoader gcl = new GroovyClassLoader(context.getLoader(), config); clazz = gcl.parseClass(gcs, false);