Package org.apache.karaf.shell.api.console

Examples of org.apache.karaf.shell.api.console.Terminal


    private void run(final SessionFactory sessionFactory, String command, final InputStream in, final PrintStream out, final PrintStream err, ClassLoader cl) throws Exception {

        final TerminalFactory terminalFactory = new TerminalFactory();
        try {
            final Terminal terminal = new JLineTerminal(terminalFactory.getTerminal());
            Session session = createSession(sessionFactory, command.length() > 0 ? null : in, out, err, terminal);
            session.put("USER", user);
            session.put("APPLICATION", application);

            discoverCommands(session, cl, getDiscoveryResource());
View Full Code Here


        }
        return descriptions;
    }

    protected void printMethodList(Session session, PrintStream out, SortedMap<String, String> commands) {
        Terminal term = session.getTerminal();
        int termWidth = term != null ? term.getWidth() : 80;
        out.println(SimpleAnsi.INTENSITY_BOLD + "COMMANDS" + SimpleAnsi.INTENSITY_NORMAL);
        ShellTable table = new ShellTable().noHeaders().separator(" ").size(termWidth);
        table.column(new Col("Command").maxSize(64));
        table.column(new Col("Description"));
        for (Map.Entry<String,String> entry : commands.entrySet()) {
View Full Code Here

        public void start(final Environment env) throws IOException {
            try {
                final Subject subject = ShellImpl.this.session != null ? ShellImpl.this.session
                        .getAttribute(KarafJaasAuthenticator.SUBJECT_ATTRIBUTE_KEY) : null;
                final Terminal terminal = new SshTerminal(env);
                Runnable destroyCallback = new Runnable() {
                    public void run() {
                        destroy();
                    }
                };
View Full Code Here

        return null;
    }

    private int getTermWidth() {
        Terminal term = session.getTerminal();
        return term != null ? term.getWidth() : 80;
    }
View Full Code Here

TOP

Related Classes of org.apache.karaf.shell.api.console.Terminal

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.