On Mon, Jun 15, 2009 at 5:10 PM, Carsten Ziegeler<cziege...@apache.org> wrote:
> Now, this depends on how this is done. We're using the declarative
> services in Sling, so when DS is starting the sling main servlet it
> checks for a configuration to provide it to the service. If it is there,
> fine.
> However at this point of time, the ConfigAdmin service might not have
> been startet yet

Really? Other services are started albeit the presence of the
(non-started) ConfigAdmin? That means services are started and then
stopped again once the configadmin is running and they get restarted
with their configuration?

Isn't it possible to avoid that case with start levels? (we are
talking about the initial startup only, if the configadmin goes away
later, no problem, the system ready state should IMHO never switch
from true to false as it is only for the startup)

>, or if for example the configuration is "installed"
> using jcrinstall, jcr install might kick in later, pass the config to
> the config admin and then the servlet is restarted with the config.

Does jcr install re-set all the values on startup? I thought it would
behave like this:

1) system running, no system-ready config present
2) configure system-ready service via a config node in JCR
3) system-ready service is restarted, config is applied and config is
persisted by Apache Felix
3) this has no effect on the running system (system-ready is already
"true", needs a global state variable)
4) restart
5) SlingMainServlet / system-ready service are started with the
persisted config (here we have a list of deps to check), system-ready
= false
6) waits for the deps to be running
7) finally after some time, system-ready = true

> Therefore there might be a time, where the servlet is active without
> having the config you want it to have.
> Of course, you can handle this case by taking care of it - which is with
> DS a little bit difficult or...as soon as DS 1.1 is available (which
> should be very shortly), you have the possibility to require a service
> to have a configuration stored in ConfigAdmin.

Sounds like a good feature to me.

> So the sling main servlet
> would not start without it. However obviously this has another draw back
> as someone has to take care that the config is there.
>
> Therefore, the easiest thing for me seems to be the sling properties.
> They're guaranteed to be delivered to the sling main servlet as soon as
> the service can be started. And the props do not change over time.

Would be working as well, but they are not so easy to find, modify and deploy.

Regards,
Alex

-- 
Alexander Klimetschek
alexander.klimetsc...@day.com

Reply via email to