[ 
https://issues.apache.org/jira/browse/SLING-5337?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15032044#comment-15032044
 ] 

Carsten Ziegeler commented on SLING-5337:
-----------------------------------------

This API could be used for any application / OSGi framework - and yes, it goes 
in the directing of the famous ready service.
With a Sling launchpad based application, this is easy as we use the help of 
start level. And I totally agree that this works only for Sling launchpad but 
does not in the general sense. (Just a side note: we don't need start levels in 
the Launchpad, it's just an optimization for the startup).
And the current launchpad api has two purposes:
a) when is the system ready?
b) what kind of start is it ? (First install, update, restart)
For a general API, we should maybe forget about b) (at least for now)

For a) we could define a service interface with some properties, maybe a name 
property which holds the name of the application. When that application is 
started, this service is registered and other parties can listen for this 
service with that application name property.
We don't have to define which conditions have to be met to register that 
service: for a launchpad based app we can still do the start level stuff, for 
any other app, I guess checking for certain services is the way to go. At least 
with subsystems you know that all bundles are installed and started, so simply 
adding a service based check does the trick. Maybe it's similar with Karaf?

> Extract Startup API from Launchpad API
> --------------------------------------
>
>                 Key: SLING-5337
>                 URL: https://issues.apache.org/jira/browse/SLING-5337
>             Project: Sling
>          Issue Type: Improvement
>          Components: Launchpad
>    Affects Versions: Launchpad API 1.2.0
>            Reporter: Oliver Lietz
>            Assignee: Oliver Lietz
>             Fix For: Launchpad API 1.3.0, Startup API 1.0.0
>
>
> {{StartupHandler}}, {{StartupListener}}, {{StartupMode}} and 
> {{StartupService}} in {{org.apache.sling.launchpad.api}} should be moved to 
> {{org.apache.sling.startup.api}} (keeping extending but deprecated classes 
> there for backward compatibility) to decouple Startup from Launchpad.
> A Startup implementation in Sling needs to be provided by every launcher 
> (Launchpad, Crankstart, Karaf)\[1\] whereas {{LaunchpadContentProvider}} is 
> only useful in contexts of Sling's own launcher Launchpad for installation 
> purpose.
> [~cziegeler], [~bdelacretaz]: anything from your POVs to consider?
> \[1\] We discussed to make Startup optional in {{Settings}} but that won't 
> work as we have modules which rely already on it (e.g. {{discovery}}).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to