if (status != Shell.EXIT_FLAG) {
// throw new ExitException(status);
// I didn't figure out How can catch the ExitException in shell main.
// So, I just Re-launching the shell.
Shell shell = new Shell();
List<String> argList = new ArrayList<String>();
argList.add(String.valueOf(Shell.RELAUNCH_FLAG));
if(Shell.HTML_OPTION != null)
argList.add(Shell.HTML_OPTION);
if(Shell.MASTER_ADDRESS != null)
argList.add(Shell.MASTER_ADDRESS);
try {
shell.main(argList.toArray(new String[] {}));
} catch (IOException e) {
e.printStackTrace();
}
}
}