On Tue, Jun 16, 2009 at 8:02 AM, Felix Meschberger<fmesc...@gmail.com> wrote:
> ...Replying to this message, but my response applies to the complete thread.
>
> Let's step back a second and look at what we really need to know to be
> able to decide the system is ready or not. And who is responsible to
> provide this knowledge.
>
>
> (1) The most basic criterion for the system to be ready is the available
> of certain services.

ok

> (2) There must be away to specify which services are required.

ok

> Now, this is very simple and easy: As Alex Klimetschek proposes we are
> using ConfigurationAdmin for this. Each service can be described by a
> few properties:
>
>   (a) Service Name
>   (b) Service Filter
>   (c) Number of services...

And in some case (like script engines), additional properties. Use
case is "I want the JSP script engine to be ready" - can we express
that with a filter?

> ...The system status service itself :
>
>   * requires the ConfigAdmin service to be present
>   * registers as a ManagedService to receive the configuration
>
> Thats basically all. Very simple, very lean....

But how do you bootstrap that ConfigAdmin information for the first
startup of a Sling instance, where no OSGi state is stored?

Use case:
1) I create a variant of the launchpad app with my own set of bundles
2) I define a custom list of services (according to the above syntax)
that must be active for my system to be ready
3) I want my SystemStatus configuration to be available from the first
startup of the system

How can I put 2) in my custom executable jar?

Again, I think using sling.properties to define where this info comes
from is the most flexible way, going back to yesterday's example from
sling.properties:

  # Values like myServiceA uses the syntax proposed by Felix
  sling.readyness.check.1 = services:myServiceA, myServiceB

  # jcr: means look in the repository for additional definitions
  sling.readyness.check.2 = jcr:/system/sling/status

  # osgi:ConfigAdmin means use that service to get additional required
  # services definition. If not present, the ConfigAdmin service is not
  # required (for super-lean Sling instances)
  sling.readyness.check.3 = osgi:ConfigAdmin:nameOfTheConfigThatHoldsThisInfo

This is easy to implement, flexible, and implementing it is probably
faster than spending ages discussing exactly which options we allow
;-)

-Bertrand

Reply via email to