Uploaded image for project: 'Karaf'
  1. Karaf
  2. KARAF-2772

Separate command api and support classes from shell

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 3.0.0
    • Fix Version/s: None
    • Component/s: karaf
    • Labels:
      None

      Description

      Like discussed on irc we would like to make karaf commands more reusable outside karaf.

      The goal is to run karaf commands without the karaf shell.

      So we need to split the shell project in two parts:

      • command-api (proposed name)
        contains command API + supporting classes like AbstractCommand which are necessary to run Action classes
      • shell.console impls

      The command-api bundle should only depend on the OSGi APIs and gogo to make it lightweight. So projects implementing commands can do this while having minimal compile time dependencies to karaf.

      I already took a peek into the shell to see how difficult this is. I found very few problematic classes.

      One is ConsoleFactory which depends on jline and several exceptions which use jansi.
      -> I propose we move this to a new package console.factory. This package then needs to remain in shell.console

      The other is NamespaceHandler
      -> The blueprint NamespaceHandler can not go to the API bundle as it depends on aries. So for now we could move it to console.commands.blueprint.impl or similar and leave it in shell.console

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                chris@die-schneider.net Christian Schneider
                Reporter:
                chris@die-schneider.net Christian Schneider
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: