Class Main


  • public class Main
    extends Object
    • Constructor Detail

      • Main

        public Main()
    • Method Detail

      • run

        public void run​(String[] args)
                 throws Exception
        Use this method when the shell is being executed as a top level shell.
        Parameters:
        args - the arguments.
        Throws:
        Exception - in case of a failure.
      • createSession

        protected Session createSession​(SessionFactory sessionFactory,
                                        InputStream in,
                                        PrintStream out,
                                        PrintStream err,
                                        Terminal terminal)
                                 throws Exception
        Allow sub classes of main to change the ConsoleImpl implementation used.
        Parameters:
        sessionFactory - the session factory.
        in - the input stream (console std in).
        out - the output stream (console std out).
        err - the error stream (console std err).
        terminal - the terminal.
        Returns:
        the created session.
        Throws:
        Exception - if something goes wrong during session creation.
      • createSessionFactory

        protected SessionFactory createSessionFactory​(org.apache.felix.service.threadio.ThreadIO threadio)
      • getDiscoveryResource

        public String getDiscoveryResource()
        Sub classes can override so that their registered commands do not conflict with the default shell implementation.
        Returns:
        the location of the discovery resource.
      • getApplication

        public String getApplication()
      • setApplication

        public void setApplication​(String application)
      • getUser

        public String getUser()
      • setUser

        public void setUser​(String user)
      • isMultiScopeMode

        public boolean isMultiScopeMode()

        Returns whether or not we are in multi-scope mode.

        The default mode is multi-scoped where we prefix commands by their scope. If we are in single scoped mode then we don't use scope prefixes when registering or tab completing commands.

        Returns:
        true if the console is multi-scope, false else.