## org.apache.felix.shell
Interface ShellService

    public interface ShellService

This interface defines the Felix impl service. The impl service is an extensible, user interface neutral impl for controlling and interacting with the framework. In general, the impl service assumes that it is operating in a command line fashion, i.e., it receives a complete command line, parses it, and executes the corresponding command, but graphical interfaces are also possible.

All commands in the impl service are actually implemented as OSGi services; these services implement the `Command` service interface. Any bundle can implement custom commands by creating command services and registering them with the OSGi framework.

Method Summary
`void` `executeCommand(java.lang.String commandLine, java.io.PrintStream out, java.io.PrintStream err)` This method executes the supplied command line using the supplied output and error print stream.
`java.lang.String` `getCommandDescription(java.lang.String name)` Returns the description associated with the specified command name.
`org.osgi.framework.ServiceReference` `getCommandReference(java.lang.String name)` Returns the service reference associated with the specified command name.
`java.lang.String[]` `getCommands()` Returns an array of command names available in the impl service.
`java.lang.String` `getCommandUsage(java.lang.String name)` Returns the usage string associated with the specified command name.

Method Detail

### getCommands

    java.lang.String[] getCommands()

  Returns an array of command names available in the impl service.

  Returns:
    an array of available command names or an empty array.

### getCommandUsage

    java.lang.String getCommandUsage(java.lang.String name)

  Returns the usage string associated with the specified command name.

  Parameters:
    `name` - the name of the target command.
  Returns:
    the usage string of the specified command or null.

### getCommandDescription

    java.lang.String getCommandDescription(java.lang.String name)

  Returns the description associated with the specified command name.

  Parameters:
    `name` - the name of the target command.
  Returns:
    the description of the specified command or null.

### getCommandReference

    org.osgi.framework.ServiceReference getCommandReference(java.lang.String name)

  Returns the service reference associated with the specified command name.

  Parameters:
    `name` - the name of the target command.
  Returns:
    the description of the specified command or null.

### executeCommand

    void executeCommand(java.lang.String commandLine,
                        java.io.PrintStream out,
                        java.io.PrintStream err)
                        throws java.lang.Exception

  This method executes the supplied command line using the supplied output and error print stream. The assumption of this method is that a command line will be typed by the user (or perhaps constructed by a GUI) and passed into it for execution. The command line is interpretted in a very simplistic fashion; it takes the leading string of characters terminated by a space character (not including it) and assumes that this leading token is the command name. For an example, consider the following command line:

           update 3 http://www.foo.com/bar.jar

  This is interpretted as an `update` command; as a result, the entire command line (include command name) is passed into the `execute()` method of the command service with the name `update` if one exists. If the corresponding command service is not found, then an error message is printed to the error print stream.

  Parameters:
    `commandLine` - the command line to execute.
    `out` - the standard output print stream.
    `err` - the standard error print stream.
  Throws:
    `java.lang.Exception`

Copyright © 2006-2012 The Apache Software Foundation. All Rights Reserved.