Package org.apache.felix.shell

Examples of org.apache.felix.shell.ShellService.executeCommand()


                if (shellService != null)
                {
                    ByteArrayOutputStream baosOut = new ByteArrayOutputStream();
                    ByteArrayOutputStream baosErr = new ByteArrayOutputStream();

                    shellService.executeCommand(command, new PrintStream(baosOut, true),
                        new PrintStream(baosErr, true));
                    if (baosOut.size() > 0)
                    {
                        pw.print(WebConsoleUtil.escapeHtml(new String(
                            baosOut.toByteArray())));
View Full Code Here


        // Print the command line in the output window.
        m_out.println("-> " + line);

        try {
            shell.executeCommand(line, m_out, m_out);
        } catch (Exception ex) {
            m_out.println(ex.toString());
            ex.printStackTrace(m_out);
        }
View Full Code Here

                    return;
                } else if("asadmin-osgi-shell".equals(cmdName)) {
                    out.println("felix");
                } else {
                    ShellService s = (ShellService) shell;
                    s.executeCommand(cmd, out, err);
                }
            } else {
                // try with gogo...

                // GLASSFISH-19126 - prepare fake input stream...
View Full Code Here

                    return;
                } else if("asadmin-osgi-shell".equals(cmdName)) {
                    out.println("felix");
                } else {
                    ShellService s = (ShellService) shell;
                    s.executeCommand(cmd, out, err);
                }
            } else {
                // try with gogo...

                // GLASSFISH-19126 - prepare fake input stream...
View Full Code Here

    }

    public void executeCommand(String commandLine, PrintStream out, PrintStream err) throws Exception {
        ShellService shellService = getShellService();
        if (shellService != null)
            shellService.executeCommand(commandLine, out, err);
        else
            err.println("Apache Felix Shell service is not installed");
    }

    private ShellService getShellService() {
View Full Code Here

            ShellService shs = (ShellService)
                m_owner.getServices().getShellService(ServiceMediator.NO_WAIT);
            try
            {
                lock.acquire();
                shs.executeCommand(line, m_out, m_out);
            }
            catch (Exception ex)
            {
                m_owner.getServices().error("Shell::run()", ex);
            }
View Full Code Here

                    return;
                } else if("asadmin-osgi-shell".equals(cmdName)) {
                    out.println("felix");
                } else {
                    ShellService s = (ShellService) shell;
                    s.executeCommand(cmd, out, err);
                }
            } else {
                // try with gogo...

                // GLASSFISH-19126 - prepare fake input stream...
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.