Leverage Framework interface to better control framework startup
----------------------------------------------------------------

                 Key: SLING-2174
                 URL: https://issues.apache.org/jira/browse/SLING-2174
             Project: Sling
          Issue Type: Improvement
          Components: Launchpad
    Affects Versions: Launchpad Base 2.3.0
            Reporter: Felix Meschberger
             Fix For: Launchpad Base 2.3.2


During startup the bootstrap installer may install, update or uninstall system 
extension fragments which require the framework to be restarted for the action 
to properly complete.

The current implementation solves the problem like this:

  - initialize the framework (Framework.init())
  - start the framework into startlevel 1 (Framework.start())
  - call bootstrap installer for install, update, uninstall
  - check whether a restart is required:
      - if yes: restart
      - otherwise: set start level to originally requested start level

This is clumsy and dilutes the startup. Particularly the FRAMEWORK_STARTED 
event is fired without the framework startup to actually have completed.

To fix this we can solve this easily using the Framework interface like this:

           Framework tmpFramework = createFramework(notifiable, logger, props);
            init(tmpFramework);
            if (new BootstrapInstaller(tmpFramework.getBundleContext(), logger, 
resourceProvider).install()) {
                init(tmpFramework);
            }
            tmpFramework.start();
            this.framework = tmpFramework;

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to