stanbol-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rupert Westenthaler <rwes...@apache.org>
Subject Re: Default OSGi configs (was: Redesigning the Entityhub Configuration)
Date Thu, 03 Mar 2011 08:16:37 GMT
On Wed, Mar 2, 2011 at 3:59 PM, Bertrand Delacretaz
<bdelacretaz@apache.org> wrote:
> Hi,
>
> On Tue, Mar 1, 2011 at 6:48 PM, Rupert Westenthaler <rwesten@apache.org> wrote:
>> On Tue, Mar 1, 2011 at 5:45 PM, Olivier Grisel <olivier.grisel@ensta.org> wrote:
>>>>> ...One potential solution would be to make the sling launcher deploy
some
>>>>> default OSGi config files into the initial sling/config/ folder
>>>>> created at the first start of the launcher. I don't know how to do
>>>>> that though....
>
> Using Sling's org.apache.sling.launchpad.installer bundle, configs
> included as text files in the runnable jar, under resources/config,
> are installed at startup. The filename must match the PID of the
> desired configuration, and configs can then be edited in the OSGi
> console.
>
> Let me know if you want me to enable that, should only be a matter of
> adding the required sling bundles to our launchers.
>
+1 This would be the preferred solution to provide the configuration of the
core components for the Entityhub because such configurations are anyway
dependent on the bundles included within the sling launcher
(e.g. Yard Implementations)

>> ...I was thinking of adding the default configuration as property file to
>> the bundle so that I can load it and than parse it to the ConfigAdmin
>> Service. (this is basically also what FileInstall does when you copy a
>> *.cfg file into the directory. (see [1] for details)...
>
> The above solution requires placing the configs in the launcher's jar,
> so they would be defined in the enhancer/launchers/full source code
> for example (unless we do some copying at build time).
>
> If you want to define the initial configs in the bundles where the
> configured services are implemented, you can also use a bundle
> Activator to check if a config exists, and if not create it based on
> hardcoded values or on a resource stored in the bundle. There's an
> example at [1], and we could easily create a utility class that does
> that.
>
I think this is the way to go for the configuration of ReferencedSites
because if we want to have the possibility of downloadable archives
that contain everything one needs to setup a ReferencedSite, we can
not use the first option.
> So there are two options: define default configs in the launchers, or
> in the individual bundles, which one do people need?
>
> -Bertrand
>
> [1] http://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/jackrabbit-server/src/main/java/org/apache/sling/jcr/jackrabbit/server/impl/Activator.java
> See verifyConfiguration method
>
This is very similar to what I expected it to look like. Thx for the example!

best
Rupert


-- 
| Rupert Westenthaler                            rwesten@apache.org
| Bodenlehenstraße 11                             ++43-699-11108907
| A-5500 Bischofshofen

Mime
View raw message