Package org.apache.karaf.shell.console

Examples of org.apache.karaf.shell.console.Console


                out = new PipedInputStream();
                PrintStream pipedOut = new PrintStream(new PipedOutputStream(out), true);

                final Subject subject = new Subject();
                subject.getPrincipals().add(new UserPrincipal("karaf"));
                Console console = consoleFactory.create(commandProcessor,
                        threadIO,
                        new PipedInputStream(in),
                        pipedOut,
                        pipedOut,
                        new WebTerminal(TERM_WIDTH, TERM_HEIGHT),
View Full Code Here


                };
                String encoding = env.getEnv().get("LC_CTYPE");
                if (encoding != null && encoding.indexOf('.') > 0) {
                    encoding = encoding.substring(encoding.indexOf('.') + 1);
                }
                Console console = consoleFactory.create(commandProcessor, threadIO, in,
                        lfToCrLfPrintStream(out), lfToCrLfPrintStream(err), terminal, encoding, destroyCallback);
                final CommandSession session = console.getSession();
                for (Map.Entry<String, String> e : env.getEnv().entrySet()) {
                    session.put(e.getKey(), e.getValue());
                }
                consoleFactory.startConsoleAs(console, subject, "ssh");
            } catch (Exception e) {
View Full Code Here

                PrintStream pipedOut = new PrintStream(new PipedOutputStream(out), true);

                AccessControlContext acc = AccessController.getContext();
                final Subject subject = Subject.getSubject(acc);
               
                Console console = consoleFactory.create(commandProcessor,
                        threadIO,
                        new PipedInputStream(in),
                        pipedOut,
                        pipedOut,
                        new WebTerminal(TERM_WIDTH, TERM_HEIGHT),
View Full Code Here

                };
                String encoding = env.getEnv().get("LC_CTYPE");
                if (encoding != null && encoding.indexOf('.') > 0) {
                    encoding = encoding.substring(encoding.indexOf('.') + 1);
                }
                Console console = consoleFactory.create(commandProcessor, in,
                        lfToCrLfPrintStream(out), lfToCrLfPrintStream(err), terminal, encoding, destroyCallback);
                final CommandSession session = console.getSession();
                for (Map.Entry<String, String> e : env.getEnv().entrySet()) {
                    session.put(e.getKey(), e.getValue());
                }
                consoleFactory.startConsoleAs(console, subject, "ssh");
            } catch (Exception e) {
View Full Code Here

                out = new PipedInputStream();
                PrintStream pipedOut = new PrintStream(new PipedOutputStream(out), true);
               
                final Subject subject = new Subject();
                subject.getPrincipals().add(new UserPrincipal("karaf"));
                Console console = consoleFactory.create(commandProcessor,
                                      new PipedInputStream(in),
                                      pipedOut,
                                      pipedOut,
                                      new WebTerminal(TERM_WIDTH, TERM_HEIGHT),
                                      null,
View Full Code Here

        LOG.debug("Using Karaf 3.x Console API");
        ServiceReference ref = bundleContext.getServiceReference(KARAF3_CONSOLE_FACTORY);
        if (ref != null) {
            ConsoleFactory factory = (ConsoleFactory) bundleContext.getService(ref);
            Console console = factory.create(commandProcessor, threadIO, in, pipedOut, pipedOut, new WebTerminal(TERM_WIDTH, TERM_HEIGHT), null, null);
            return console;
        }

        return null;
    }
View Full Code Here

TOP

Related Classes of org.apache.karaf.shell.console.Console

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.