felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pierre De Rop (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (FELIX-5406) DM lambda fluent service properties don't support dots
Date Thu, 10 Nov 2016 22:44:58 GMT

     [ https://issues.apache.org/jira/browse/FELIX-5406?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

Pierre De Rop resolved FELIX-5406.
       Resolution: Fixed
    Fix Version/s: org.apache.felix.dependencymanager-r9

Committed in revision 1769219 a fix which allows to encode fluent service property names using
if the property name contains an underscore, then it can be encoded with a double underscore.

test case: org.apache.felix.dependencymanager.lambda.itest/src/org/apache/felix/dm/lambda/itest/FELIX5406_FluentPropertyWithDotTest.java

> DM lambda fluent service properties don't support dots
> ------------------------------------------------------
>                 Key: FELIX-5406
>                 URL: https://issues.apache.org/jira/browse/FELIX-5406
>             Project: Felix
>          Issue Type: Improvement
>            Reporter: Pierre De Rop
>            Assignee: Pierre De Rop
>            Priority: Minor
>             Fix For: org.apache.felix.dependencymanager-r9
> With dm-lambda, you can't define service properties with dots when you use fluent service
properties using lambda expressions.
> For example, you can declare this component which provides a service using the "foo=bar"
service property:
> {code}
> component(comp ->comp
>     .impl(ServiceImpl.class)
>     .provides(Service.class, foo -> "bar"))          
> {code}
> but you can't use dots in the service property name (like "foo.bar=zoo"):
> {code}
> component(comp -> comp
>     .impl(ServiceImpl.class)
>     .provides(Service.class, foo.bar -> "zoo"))  
> {code}
> Indeed, a lambda parameter name can't contain any dots. A convention can be used like
in OSGi metatype, where underscore can be used to convert dots, and a double underscore is
then converted to a single underscore, like this:
> {code}
> component(comp -> comp
>     .impl(ServiceImpl.class)
>     .provides(Service.class, foo_bar -> "zoo", foo__bar -> "zoo2"));
> {code}
> In the above example, foo_bar is then mapped to "foo.bar" service property name and foo__bar
is then mapped to foo_bar property name.

This message was sent by Atlassian JIRA

View raw message