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 GroovyScript getLifeCycle(ShellSession session, String name) throws CommandException, NullPointerException { TimestampedObject<Class<? extends GroovyScript>> ref = scriptCache.getClass(name); if (ref != null) { Class<? extends GroovyScript> scriptClass = ref.getObject(); GroovyScript script = (GroovyScript)InvokerHelper.createScript(scriptClass, new Binding(session)); script.setBinding(new Binding(session)); return script; } else { return null; } }
TimestampedObject<Class<? extends T>> providerRef = loadClass(name); Resource script = getResource(name); saveClass(name, providerRef);
TimestampedObject<Class<? extends T>> providerRef = loadClass(name); Resource script = getResource(name); saveClass(name, providerRef);
public GroovyScript getLifeCycle(ShellSession session, String name) throws CommandException, NullPointerException { TimestampedObject<Class<? extends GroovyScript>> ref = scriptCache.getClass(name); if (ref != null) { Class<? extends GroovyScript> scriptClass = ref.getObject(); GroovyScript script = (GroovyScript)InvokerHelper.createScript(scriptClass, new Binding(session)); script.setBinding(new Binding(session)); return script; } else { return null; } }
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); }
TimestampedObject<Class<? extends T>> providerRef = loadClass(name); Resource script = getResource(name); saveClass(name, providerRef);
public GroovyScript getLifeCycle(ShellSession session, String name) throws CommandException, NullPointerException { TimestampedObject<Class<? extends GroovyScript>> ref = scriptCache.getClass(name); if (ref != null) { Class<? extends GroovyScript> scriptClass = ref.getObject(); GroovyScript script = (GroovyScript)InvokerHelper.createScript(scriptClass, new Binding(session)); script.setBinding(new Binding(session)); return script; } else { return null; } }
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); }