On Mon, Jun 15, 2009 at 1:00 PM, Alexander Klimetschek<[email protected]> wrote:
> On Mon, Jun 15, 2009 at 11:31 AM, Bertrand
> Delacretaz<[email protected]> wrote:
>> 1. The goal is to return a 503 status until the system is ready to
>> process requests.
>>
>> 2. Defining readyness is hard due to the dynamic nature of OSGi and
>> especially Declarative Services. My idea is to use scripts found under
>> /system/sling/status in the JCR repository to let programmers define
>> what they require for their system to be ready.
>
> Why not put a list under /system/sling/status/requiredBundles and
> requiredServices with the names of the bundles and services that
> should be running in order to consider the system to be ready?

Good idea, and it would allow extensions for use cases that go beyond
just testing the presence of a given bundle or service: one could
create a service S that checks the required preconditions before
coming up (using code, scripts, whatever), and configure S as a
requiredService.

> ...That way it
> a) only depends on the OSGi Framework API
> b) could be implemented right inside the engine, introducing none of
> the chicken and egg problems.
> c) it also allows you to define more than just scripting engines as
> dependencies for your system ready state....

Correct, though my original proposal also allowed for more than
scripting engines. The idea was that readyness scripts would check for
bundles and services, and maybe run some test code.

But your proposal seems to cover all of that.

What do others think?

-Bertrand

Reply via email to