Interface Command

  • All Known Subinterfaces:
    CdCommand

    public interface Command
    This interface is used to define commands for the Felix impl service. Any bundle wishing to create commands for the impl service simply needs to create a service object that implements this interface and then register it with the OSGi framework. The impl service automatically includes any registered command services in its list of available commands.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void execute​(java.lang.String line, java.io.PrintStream out, java.io.PrintStream err)
      Executes the command using the supplied command line, output print stream, and error print stream.
      java.lang.String getName()
      Returns the name of the command that is implemented by the interface.
      java.lang.String getShortDescription()
      Returns a short description of the command; this description should be as short as possible.
      java.lang.String getUsage()
      Returns the usage string for the command.
    • Method Detail

      • getName

        java.lang.String getName()
        Returns the name of the command that is implemented by the interface. The command name should not contain whitespace and should also be unique.
        Returns:
        the name of the command.
      • getUsage

        java.lang.String getUsage()
        Returns the usage string for the command. The usage string is a short string that illustrates how to use the command on the command line. This information is used when generating command help information. An example usage string for the install command is:
             install  [ ...]
         
        Returns:
        the usage string for the command.
      • getShortDescription

        java.lang.String getShortDescription()
        Returns a short description of the command; this description should be as short as possible. This information is used when generating the command help information.
        Returns:
        a short description of the command.
      • execute

        void execute​(java.lang.String line,
                     java.io.PrintStream out,
                     java.io.PrintStream err)
        Executes the command using the supplied command line, output print stream, and error print stream.
        Parameters:
        line - the complete command line, including the command name.
        out - the print stream to use for standard output.
        err - the print stream to use for standard error.