On Wednesday 18 April 2018 18:00:53 Christian Schneider wrote:
> We have a component that requires an array of strings. See the code below
> for the config declaration.
>
>
> public @interface Config {
>
>
> @AttributeDefinition(name = "Services list")
>
> String[] services_list();
>
>
> }
>
> This works if we set the config attribute to be an array. It does not seem
> to work though
> when I configure the config using a .cfg file in karaf.
>
> As far as I know there I can only use plain strings. So our list can be
> represented as Service1,Service2 but this is not automatically converted to
> an array.
>
> I already asked this in osgi-dev and Neil answered that this will not work
> out of the box.
> So I wonder if we could tweak the handling of .cfg files in felix
> fileinstall (I hope this is the correct project) so it already parses the
> values and returns a String[].
>
> Possible syntaxes could be:
> String1,String2
> [String1,String2]
>
> I guess the second syntax would be safer as it is unlikely that this is
> used in a config already.
>
> What do you think?
Works fine when using .config-files, see related issues in Karaf's JIRA and
Sling's configurations for Karaf, e.g.
https://github.com/apache/sling-org-apache-sling-karaf-configs/blob/master/src/main/resources/org.apache.sling.jcr.base.internal.LoginAdminWhitelist.fragment-sling.config
Regards,
O.
> Christian
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]