latest discussion: use of startup handler (dev@)

 

After Sling 6 providing a StartupHandler is necessary to get a properly running Sling instance.

 

We should document here which components need a StartupHandler and why (e.g. start their work after Sling is up) and then

  • come up with a generic one which is not bound to Launchpad and can be used by other launchers/runtimes
  • or help to implement proper StartupHandlers for each launcher/runtime

Currently the dummy one from Launchpad Karaf is also used by Crankstart in DevOps/CI experiments and now also in integration testing.

We have to distinguish the startups of the OSGi framework and Sling itself as they are not necessarily happen simultaneous (installing Sling into an already running OSGi framework).

 

API:

  • org.apache.sling.launchpad.api.StartupHandler
  • org.apache.sling.launchpad.api.StartupListener
  •  org.apache.sling.launchpad.api.StartupMode (INSTALL, UPDATE, RESTART)
  • org.apache.sling.launchpad.api.StartupService

 

involved bundles:

  • org.apache.sling.launchpad.api
  • org.apache.sling.launchpad.base
  • org.apache.sling.launchpad.installer
  • org.apache.sling.launchpad.karaf
  • org.apache.sling.settings

 

workarounds in testing:

  • org.apache.sling.paxexam.util.SlingSetupTest
  • org.apache.sling.event.it.AbstractJobHandlingTest

 

related issues:

  • SLING-5338 Provide a configurable Startup API implementation
  • SLING-5337 Extract Startup API from Launchpad API
  • SLING-4851 Extract the launchpad startup logic in separate bundles
  • SLING-4823 Register a service when the system is ready
  • SLING-4197 Startup fails if StartupHandler throws an exception
  • SLING-3529 Move startup handling to a separate bundle
  • SLING-2789 deploying Sling 7-SNAPSHOT on Karaf fails
  • SLING-2700 Minor startup handling improvements
  • SLING-2675 Make startup mode available as a framework properties
  • SLING-2674 SlingSettingsServiceImpl should detect and handle upgrades
  • SLING-2552 Correctly handle register/unregister of OSGi installer
  • SLING-2405 Startup synchronization problems
  • SLING-2376 New Startup Features
  • SLING-2372 Detect startup mode
  • SLING-2174 Leverage Framework interface to better control framework startup
  • SLING-1886 Improve initial installation and startup
  • SLING-490 SlingStatusServlet - find out whether a Sling application is ready after startup


Use Cases

Controlling OSGi Start Levels

  • used by Installer to optimize startup and to prevent oscillating systems
  • not suitable for Karaf with Features (lifecycle of Features is managed bei Karaf itself)



  • No labels