public CommandShell(TextConsole cons) throws ShellException { try { this.console = cons; this.out = this.console.getOut(); this.err = this.console.getErr(); this.currentLine = new Line(console, this, out);   this.console.addKeyboardListener(this); defaultCommandInvoker = new DefaultCommandInvoker(this); threadCommandInvoker = new ThreadCommandInvoker(this); this.commandInvoker = threadCommandInvoker;  aliasMgr = ((AliasManager) InitialNaming.lookup(AliasManager.NAME)) .createAliasManager(); AccessController.doPrivileged(new SetPropertyAction( PROMPT_PROPERTY_NAME, DEFAULT_PROMPT));  } catch (NameNotFoundException ex) { throw new ShellException("Cannot find required resource", ex); }
public CommandShell() throws NameNotFoundException, ShellException { this((TextConsole) ((ConsoleManager) InitialNaming .lookup(ConsoleManager.NAME)).getFocus());
    public CommandShell(TextConsole cons) throws ShellException {        try {            this.console = cons;            this.out = this.console.getOut();            this.err = this.console.getErr();            this.currentLine = new Line(console, this, out);            // listen to the keyboard            this.console.addKeyboardListener(this);            defaultCommandInvoker = new DefaultCommandInvoker(this);            threadCommandInvoker = new ThreadCommandInvoker(this);            this.commandInvoker = threadCommandInvoker; // default to separate            // threads for commands.            aliasMgr = ((AliasManager) InitialNaming.lookup(AliasManager.NAME))                    .createAliasManager();            AccessController.doPrivileged(new SetPropertyAction(                    PROMPT_PROPERTY_NAME, DEFAULT_PROMPT));            // ShellUtils.getShellManager().registerShell(this);        } catch (NameNotFoundException ex) {            throw new ShellException("Cannot find required resource", ex);        }    }