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;
}
}