Uploaded image for project: 'Felix'
  1. Felix
  2. FELIX-5951

Automatically add ConfigurationAdmin service as a shell command

    XMLWordPrintableJSON

Details

    Description

      I'd like to propose adding the service properties:
      osgi.command.scope = 'cm' and
      {{osgi.command.function = ConfigurationAdmin.class.getDeclaredMethods() }} to the ConfigurationAdmin service.

      Here are some examples that this would enable:

      # store a pid for reuse
      g! pid = "foo"
      ## CM - get configurations
      g! cm:listconfigurations "(service.pid=$pid)"
      ## CM - get single configuration
      g! config = (cm:listconfigurations "(service.pid=$pid)") 0
      ## CM - create configuration
      g! config = cm:getconfiguration $pid "?"
      ## CM - delete configuration
      g! $config delete
      ## CM - list configuration properties
      g! $config properties
      ## CM - update configuration from existing properties
      g! props = ($config properties)
      g! $props put "foo" 20
      g! $config update $props
      ## CM - update configuration with new properties
      g! props = (new java.util.Hashtable)
      g! $props put "foo" 20
      g! $config update $props
      

      Attachments

        Activity

          People

            rotty3000 Raymond Augé
            rotty3000 Raymond Augé
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: