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

Allow for multi-stage boot features installation

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.5, 2.2.0
    • Fix Version/s: 3.0.0
    • Component/s: karaf-feature
    • Labels:
      None

      Description

      Currently, all boot features specified are installed in a single go: all the bundles get installed, resolved and then afterwards get started. This works fine for most features, but there are a few scenarios where it would be nice to allow installing the boot features in a few independent batches.

      One example is ServiceMix' use of OBR in the features. You can install OBR support through a feature, but it needs to be installed before resolving the other features to allow the Features' OBR Resolver support to kick in. We have now worked around this in ServiceMix by adding the OBR feature's bundle to the startup.properties file, but it would be nice to have a simpler solution.
      Another example is a feature that include a war: url for adding web applications. That requires the war feature to be installed and started before attempting the installation of the web application feature.

      We could e.g. allow adding parentheses to group parts of the boot features that need to be installed in a single batch. Something like (obr,war),activemq,cxf,camel,jbi could install the 'war' and 'obr' feature in a first batch and the do the rest as usual.

        Issue Links

          Activity

          Hide
          chris@die-schneider.net Christian Schneider added a comment -

          Only implemented on trunk till now

          Show
          chris@die-schneider.net Christian Schneider added a comment - Only implemented on trunk till now
          Hide
          chris@die-schneider.net Christian Schneider added a comment -

          I thought a lot about a way to achieve the desired behaviour without staged boot features but found no working till now. So I will implement it like described.

          The problem are the obr and the url handlers. Both are already needed when loading the bundles. So I think the easiest way to make sure both are loaded before bundles that need them is to load these features as a first stage. I am still not sure this is really the best solution but I found no better till now. Any ideas?

          Show
          chris@die-schneider.net Christian Schneider added a comment - I thought a lot about a way to achieve the desired behaviour without staged boot features but found no working till now. So I will implement it like described. The problem are the obr and the url handlers. Both are already needed when loading the bundles. So I think the easiest way to make sure both are loaded before bundles that need them is to load these features as a first stage. I am still not sure this is really the best solution but I found no better till now. Any ideas?
          Hide
          chris@die-schneider.net Christian Schneider added a comment -

          Moving to 3.1. Feel free to move back if you think this is essential for 3.0

          Show
          chris@die-schneider.net Christian Schneider added a comment - Moving to 3.1. Feel free to move back if you think this is essential for 3.0
          Hide
          jbonofre Jean-Baptiste Onofré added a comment -

          As it's a new feature/enhancement, I move it to Karaf 2.3.0 (2.2.7 is now only bug fixes release).

          Show
          jbonofre Jean-Baptiste Onofré added a comment - As it's a new feature/enhancement, I move it to Karaf 2.3.0 (2.2.7 is now only bug fixes release).
          Hide
          achim_nierbeck Achim Nierbeck added a comment -

          I think since it's an improvement and we really should get a 2.2.6 out we should bump it to a 2.2.7.

          Show
          achim_nierbeck Achim Nierbeck added a comment - I think since it's an improvement and we really should get a 2.2.6 out we should bump it to a 2.2.7.
          Hide
          tuomas_kiviaho Tuomas Kiviaho added a comment -

          I hope that URL protocol issue solution mentioned in KARAF-918 would also make it possible to get rid of CustomBundleURLStreamHandlerFactory that is used in the maven plugin. Currently the maven plugin registers this one to make feature service's url resolution work. Problem is that there is no proper way to unset it and it will be delivered across maven plugins from then on (a.k.a. leaking the classloader). If I understood correctly the idea is to use URL stream handler service instead. I think this solution could be mimicked on maven plugin side as well by inspecting Pax URL manifests for exported services for instance. Making use of ServiceLoader would be cleaner and simpler approach but I don't think that Pax URL currently supports this.

          Show
          tuomas_kiviaho Tuomas Kiviaho added a comment - I hope that URL protocol issue solution mentioned in KARAF-918 would also make it possible to get rid of CustomBundleURLStreamHandlerFactory that is used in the maven plugin. Currently the maven plugin registers this one to make feature service's url resolution work. Problem is that there is no proper way to unset it and it will be delivered across maven plugins from then on (a.k.a. leaking the classloader). If I understood correctly the idea is to use URL stream handler service instead. I think this solution could be mimicked on maven plugin side as well by inspecting Pax URL manifests for exported services for instance. Making use of ServiceLoader would be cleaner and simpler approach but I don't think that Pax URL currently supports this.
          Hide
          jbonofre Jean-Baptiste Onofré added a comment -

          I would like to address this issue in Karaf 2.2.6. If it's the only pending one, I will move it

          Show
          jbonofre Jean-Baptiste Onofré added a comment - I would like to address this issue in Karaf 2.2.6. If it's the only pending one, I will move it
          Hide
          jgoodyear Jamie goodyear added a comment -

          Bumping out to 2.2.7

          Show
          jgoodyear Jamie goodyear added a comment - Bumping out to 2.2.7
          Hide
          jgoodyear Jamie goodyear added a comment -

          Bumping out to 2.2.6.

          Show
          jgoodyear Jamie goodyear added a comment - Bumping out to 2.2.6.
          Hide
          jgoodyear Jamie goodyear added a comment -

          Bumping out to 2.2.5.

          Show
          jgoodyear Jamie goodyear added a comment - Bumping out to 2.2.5.
          Hide
          jgoodyear Jamie goodyear added a comment -

          Bumping out to 2.2.4.

          Show
          jgoodyear Jamie goodyear added a comment - Bumping out to 2.2.4.
          Hide
          jgoodyear Jamie goodyear added a comment -

          Removing the 2.1.6 fix version – the 2.1.x line is coming to EOL.

          Show
          jgoodyear Jamie goodyear added a comment - Removing the 2.1.6 fix version – the 2.1.x line is coming to EOL.
          Hide
          jgoodyear Jamie goodyear added a comment -

          Changed fix version.

          Show
          jgoodyear Jamie goodyear added a comment - Changed fix version.
          Hide
          gertvanthienen Gert Vanthienen added a comment -

          Since we're going to base ServiceMix 4.4.0 on Karaf 2.2.x, I don't mind putting in some extra effort myself to backport that change to the karaf-2.2.x branch since that will make our lives a bit easier on the ServiceMix end.

          Show
          gertvanthienen Gert Vanthienen added a comment - Since we're going to base ServiceMix 4.4.0 on Karaf 2.2.x, I don't mind putting in some extra effort myself to backport that change to the karaf-2.2.x branch since that will make our lives a bit easier on the ServiceMix end.
          Hide
          jbonofre Jean-Baptiste Onofré added a comment -

          It could be interesting indeed, but I think it should be done only on 3.0.0. If it's not painful, we can see to merge that on 2.2.2.

          Show
          jbonofre Jean-Baptiste Onofré added a comment - It could be interesting indeed, but I think it should be done only on 3.0.0. If it's not painful, we can see to merge that on 2.2.2.

            People

            • Assignee:
              chris@die-schneider.net Christian Schneider
              Reporter:
              gertvanthienen Gert Vanthienen
            • Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development