shellIn = new ChannelPipedOutputStream((ChannelPipedInputStream) in);
shellIn = new LoggingFilterOutputStream(shellIn, "IN: ", log);
command.setInputStream(in);
command.setOutputStream(out);
command.setErrorStream(err);
command.setExitCallback(new ExitCallback() {
public void onExit(int exitValue) {
try {
closeShell(exitValue);
} catch (IOException e) {
log.info("Error closing shell", e);