private CommandResolution resolveCommand(org.crsh.lang.spi.Compiler manager, String name, Resource script) throws CommandException { TimestampedObject<CommandResolution> ref = commandCache.get(name); if (ref != null) { if (script.getTimestamp() != ref.getTimestamp()) { ref = null; } } CommandResolution command; if (ref == null) { command = manager.compileCommand(name, script.getContent()); if (command != null) { commandCache.put(name, new TimestampedObject<CommandResolution>(script.getTimestamp(), command)); } } else { command = ref.getObject(); } return command; }
if (script.getTimestamp() != providerRef.getTimestamp()) { providerRef = null; providerRef = new TimestampedObject<Class<? extends T>>(script.getTimestamp(), clazz); 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; } }
if (script.getTimestamp() != providerRef.getTimestamp()) { providerRef = null; providerRef = new TimestampedObject<Class<? extends T>>(script.getTimestamp(), clazz); 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; } }
private CommandResolution resolveCommand(org.crsh.lang.spi.Compiler manager, String name, Resource script) throws CommandException { TimestampedObject<CommandResolution> ref = commandCache.get(name); if (ref != null) { if (script.getTimestamp() != ref.getTimestamp()) { ref = null; } } CommandResolution command; if (ref == null) { command = manager.compileCommand(name, script.getContent()); if (command != null) { commandCache.put(name, new TimestampedObject<CommandResolution>(script.getTimestamp(), command)); } } else { command = ref.getObject(); } return command; }
if (script.getTimestamp() != providerRef.getTimestamp()) { providerRef = null; providerRef = new TimestampedObject<Class<? extends T>>(script.getTimestamp(), clazz); 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; } }
private CommandResolution resolveCommand(org.crsh.lang.spi.Compiler manager, String name, Resource script) throws CommandException { TimestampedObject<CommandResolution> ref = commandCache.get(name); if (ref != null) { if (script.getTimestamp() != ref.getTimestamp()) { ref = null; } } CommandResolution command; if (ref == null) { command = manager.compileCommand(name, script.getContent()); if (command != null) { commandCache.put(name, new TimestampedObject<CommandResolution>(script.getTimestamp(), command)); } } else { command = ref.getObject(); } return command; }
if (script.getTimestamp() != providerRef.getTimestamp()) { providerRef = null; providerRef = new TimestampedObject<Class<? extends T>>(script.getTimestamp(), providerClass); saveClass(name, providerRef); } else { return providerRef.getObject();