Alexander Klimetschek wrote:
> On Mon, Jun 15, 2009 at 5:10 PM, Carsten Ziegeler<[email protected]> 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?
Yes, I think so - although this is more theory; but it can happen, and I
guess it depends how the SCR is implemented; if it requires a config
admin, the config admin is of course started first. I think this is the
case for the Felix implementation.

> 
> 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
Yepp.

> 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
Yes, but this means that the whole thing doesn't work without
restarting. So on a first start the system pretents to be ready
immediately which is imho wrong. And if jcr install is not started for
whatever reason, the system remains ready regardless how often you
restart it.
As soon as we have a dependency between the service checking and the
configuration what to check, we might ran into problems. As soon as the
configuration is not available the system is ready.

>> 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.
Hmm I could argue that using a notepad to edit a properties file is as
easy as using some jcr explorer to find/edit nodes in the repository. In
the first case you have to know the location of the sling.properties
file in the second case you have to know the path in the repository. So
there is no difference about the required knowledge. And editing is well
a matter of taste although I still think that using notepad is more
comfortable than using one of the jcr explorers.

But again, storing the system check in the repository doesn't work in
the general case. If the repository is not available for whatever reason
the system check succeeds and that's plainly something you don't want.

Carsten
-- 
Carsten Ziegeler
[email protected]

Reply via email to