public Object execute(CharSequence commandline,
InputStream in,
PrintStream out,
PrintStream err) {
ThreadIO tio = (ThreadIO)cp.tioTracker.getService();
if(tio == null) {
throw new RuntimeException("No ThreadIO service available");
}
try {
tio.setStreams(in, out, err);
Program p = new Program(null, cp.commandProviders);
p.getVarMap().putAll(sessionVars);
Object r = p.exec(commandline);
sessionVars.putAll(p.getVarMap());
return r;
} finally {
tio.close();
}
}