5 Replies Latest reply on Aug 18, 2011 9:44 PM by ffang

    bundle start order

    chandraprabha

      Hi All,

       

      I have have two application and each app has 4 bundles.

       

      model

      business

      se

      bc

       

      and they are dependent on each other e.g business is dependent on model

       

      and also one application is dependent on other business.

       

      Please let me know where  i can specify their order of start ?

       

      Thanks

        • 1. Re: bundle start order
          ffang

          Hi,

           

          Actually you can't specify start order for bundles, though you can specify start-level(lower value means start it early) for each bundle, start-level could help here but it

          can't guarantee that one bundle fully started before another. The only way I know can guarantee one bundle(A) fully started before another one(bundleB) is  that bundle A export an OSGi service and bundle B refer this OSGi service.

           

          And your logic depend on bundle start order isn't a good practice in OSGi world, you should avoid it.

           

          Freeman

          • 2. Re: bundle start order
            rogelio_sevilla1

            According to mr. Freeman on this thread,

             

            http://fusesource.com/forums/message.jspa?messageID=6820

             

            Requiring a start order of your bundles is bad practice on the OSGi world.

             

            Although with "start order" I don't know if you mean "initialization order" or "resolution order" with your question.

             

            If you meant resolution order, then,  i believe that using the <import-package> or the <required-bundle> tag within the org.apache.felix.maven-bundle-plugin could help you to ensure that the packages you need are resolved  before trying to resolve and start a bundle.

             

             

            Hope that helps.

            • 3. Re: bundle start order
              chandraprabha

              Thanks for response .

               

              Can you please tell me how i can set the start-level for the bundle.

              • 4. Re: bundle start order
                chandraprabha

                I got it thanks

                • 5. Re: bundle start order
                  ffang

                  Hi,

                   

                  Put your bundle in a feature, and you can specify start-level attribute for the feature or a certain  bundle there.

                   

                  Freeman