Another use for configuration support in launchpad is in the generation of the 
Karaf / ServiceMix feature file. This could allow custom <config /> blocks to 
be inserted into the feature file.

-- Mike


On Jun 14, 2010, at 8:24 AM, Justin Edelson wrote:

> On 6/14/10 11:06 AM, Carsten Ziegeler wrote:
>> Hi,
>> 
>> I'm currently investigating how to add support for configurations to the
>> launchpad. Currently it is only possible to provision bundles, but I
>> have the need for configurations as well.
>> 
>> My first approach was to replace our code with FileInstall from the
>> Felix project. But it seems that we would hit several problems with that
>> (it really only supports the file system, has no start level support etc.)
>> 
>> So, my basic idea is to search for "*.cfg" files in the same dirs as we
>> are searching for bundles in, and then add the found configs to the
>> config admin. The question is how/if to update. I think adding the
>> configs on the first start only and then forget about them is fine for
>> my use cases (maybe we could add a force install option) This would not
>> cover the case of updating a config or even removing a config through
>> this way.
>> 
>> WDYT?
>> 
>> Regards
>> Carsten
> 
> Other than configuring the embedded Jackrabbit server, couldn't you use
> jcrinstall for this?
> 
> I agree that updating is tricky, but there might be a way of handling
> this with a ConfigurationListener, i.e. if you could remember which
> configuration had been modified/removed by something else, you could
> modify how to handle the embedded files.
> 
> <boot>
> 1) load com.foo.cfg from launchpad archive and create a Configuration
> object based upon it.
> 2) someone modifies PID com.foo via webconsole
> 3) ConfigurationEvent fired with type = CM_UPDATED, PID=com.foo
> 4) Launchpad stores this PID in a list somewhere
> 
> <boot>
> 4) when com.foo.cfg is loaded, its PID is compared against the list of
> updated PIDs. It is contained in that list, so it is ignored.
> 
> In other words, once someone else modifies/removes the configuration,
> the "launchpad configuration loader" will ignore that file going forward.
> 
> I have no idea on how you could support removing a configuration. Then
> again, it isn't like launchpad supports removing bundles :)
> 
> Justin

Reply via email to