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

Config commands do not support the use of Managed Service Factories

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.1.3
    • 2.2.0
    • karaf
    • None

    Description

      Below is a sample usage of a managed service factoriy with factory-pid = "rg.apache.karaf.someservice"

      <osgix:managed-service-factory factory-pid="org.apache.karaf.someservice" update-strategy="container-managed" auto-export="all-classes">
      <bean class="org.apache.karaf.SomeService"/>
      </osgix:managed-service-factory>

      From the karaf shell I use the config command to create a new instance of that service say "instance1":

      karaf@root> config:edit org.apache.karaf.someservice-instance1
      karaf@root> config:propset somekey somevalue
      karaf@root> config:update

      As a result a new instance of the service is created and the configuration is persisted in the file etc/org.apache.karaf.someservice-instance1.cfg
      The problem is that its assigned a random service.pid of the form org.apache.karaf.someservice.b95c9421-77e8-474d-8083-7665a0cfcedf and when I try to update the configuration

      karaf@root> config:edit org.apache.karaf.someservice-instance1

      It doesn't work. Instead I have to use the assigned pid (which requires me to perform a config:list and then use correlate):

      karaf@root> config:edit org.apache.karaf.someservice.b95c9421-77e8-474d-8083-7665a0cfcedf

      We need to change the config commands in a manner that will either:
      a) Enforce the use of a PID: org.apache.karaf.someservice-instance1 or
      b) Provide a flag so that when editing existing configuration the filename can be used.

      If you can think of other alternatives please discuss.

      Attachments

        Activity

          People

            iocanel Ioannis Canellos
            iocanel Ioannis Canellos
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: