You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Oliver Lietz <ap...@oliverlietz.de> on 2016/10/01 09:20:43 UTC

Framework Properties [Re: Sling Launchpad and Sling Karaf features]

On Friday 30 September 2016 14:00:23 Carsten Ziegeler wrote:
> Stefan Seifert wrote
> 
> > discussed at the Sling Committer Round Table @ adaptTo() 2016
> > 
> > currently we have Slind launchpad with a quite monolithic configuration
> > [1] one big list of all sling bundles), and we have a karaf feature
> > repository [2] with nicely cut features for different aspects of sling,
> > allowing the deployer to choose which sling features are wanted and which
> > not, and which are the dependencies. oliver did today a talk on
> > karaf/sling [3].
> > 
> > the launchpad should be split up in separates features/provisioning
> > fragments to make it possible to easily build a "minimal launchpad" or
> > "minimal launchpad + X" by selection only some but not all features.
> > 
> > both launchpad features and karaf features should share a common source to
> > avoid maintaining both in parallel. one could be generated from the
> > other.
> Atm the provisioning model has a slightly larger function set as karaf
> features. We have support for framework properties and things like the
> repo init stuff.

I didn't find the statement in the OSGi spec (R6 core) you mentioned at 
adaptTo() which says framework properties can be set at runtime.

I'm quite sure I looked at Felix source and docs (e.g. [1]) when it was a 
topic last year and didn't find anything there also.

Can you point me to any significant source? (just to make sure it makes sense 
to have framework properties in features at all)

[1] http://felix.apache.org/documentation/subprojects/apache-felix-framework/apache-felix-framework-configuration-properties.html

Thanks,
O.

> The text based format is also easier to diff than XML.
> 
> The OSGi alliance defines a YAML format for configurations which I would
> like to directly support in the provisioning model (or whatever we use
> as the source).
> 
> And we have tooling like crankstart that can take a provisioning model
> directly and launch the instance.
> 
> This all leads me to the suggestion that we keep the provisioning model
> and generate the karaf features xml out of this. As the provisioning
> model supports features already we can directly create the features in
> the launchpad provisioning model as they are currently defined for karaf.
> 
> 
> 
> Regards
> 
> Carsten


Re: Framework Properties [Re: Sling Launchpad and Sling Karaf features]

Posted by Oliver Lietz <ap...@oliverlietz.de>.
On Saturday 01 October 2016 11:34:48 Carsten Ziegeler wrote:
> Oliver Lietz wrote
> 
> > On Friday 30 September 2016 14:00:23 Carsten Ziegeler wrote:
> >> Atm the provisioning model has a slightly larger function set as karaf
> >> features. We have support for framework properties and things like the
> >> repo init stuff.
> > 
> > I didn't find the statement in the OSGi spec (R6 core) you mentioned at
> > adaptTo() which says framework properties can be set at runtime.
> > 
> > I'm quite sure I looked at Felix source and docs (e.g. [1]) when it was a
> > topic last year and didn't find anything there also.
> > 
> > Can you point me to any significant source? (just to make sure it makes
> > sense to have framework properties in features at all)
> 
> It's true that you can't set framework properties at runtime, but you
> can set system properties at runtime. And the documentation of
> BundleContext#getProperty(String) says:
> "Returns the value of the specified property. If the key is not found in
> the Framework properties, the system properties are then searched".
> 
> And this is the back door to set framework properties at runtime. Which
> of course means that if a framework property is already set, setting it
> through a system property is not possible, deleting is also not
> possible. But I think all these cases are neglectable. As soon as two
> features are providing values for a single property it gets difficult
> anyway.
> 
> However, if the launcher does not use framework properties at all and
> relies on system properties completely this is dynamic as you can
> add/remove/delete these at runtime. But of course the code needs to be
> aware of this, usually bundles read the properties at
> startup/activation, changing the props after they are started has
> usually no effect. Changing the properties for the framework at runtime
> usually has no effect either. I think all of this is fine. So we just
> have to document the restrictions/behaviour clearly

Because of this difficulties (and portability between OSGi containers) I do 
prefer OSGi configurations where possible. And I agree that we have to much of 
them for getting Sling up and running (but that's an Oak issue).

Regards,
O.

>  Regards
> 
> Carsten


Re: Framework Properties [Re: Sling Launchpad and Sling Karaf features]

Posted by Carsten Ziegeler <cz...@apache.org>.
Oliver Lietz wrote
> On Friday 30 September 2016 14:00:23 Carsten Ziegeler wrote:

>> Atm the provisioning model has a slightly larger function set as karaf
>> features. We have support for framework properties and things like the
>> repo init stuff.
> 
> I didn't find the statement in the OSGi spec (R6 core) you mentioned at 
> adaptTo() which says framework properties can be set at runtime.
> 
> I'm quite sure I looked at Felix source and docs (e.g. [1]) when it was a 
> topic last year and didn't find anything there also.
> 
> Can you point me to any significant source? (just to make sure it makes sense 
> to have framework properties in features at all)
> 

It's true that you can't set framework properties at runtime, but you
can set system properties at runtime. And the documentation of
BundleContext#getProperty(String) says:
"Returns the value of the specified property. If the key is not found in
the Framework properties, the system properties are then searched".

And this is the back door to set framework properties at runtime. Which
of course means that if a framework property is already set, setting it
through a system property is not possible, deleting is also not
possible. But I think all these cases are neglectable. As soon as two
features are providing values for a single property it gets difficult
anyway.

However, if the launcher does not use framework properties at all and
relies on system properties completely this is dynamic as you can
add/remove/delete these at runtime. But of course the code needs to be
aware of this, usually bundles read the properties at
startup/activation, changing the props after they are started has
usually no effect. Changing the properties for the framework at runtime
usually has no effect either. I think all of this is fine. So we just
have to document the restrictions/behaviour clearly


 Regards

Carsten

-- 
Carsten Ziegeler
Adobe Research Switzerland
cziegeler@apache.org