Uploaded image for project: 'Felix'
  1. Felix
  2. FELIX-5406

DM lambda fluent service properties don't support dots

    XMLWordPrintableJSON

Details

    Description

      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:

      component(comp ->comp
          .impl(ServiceImpl.class)
          .provides(Service.class, foo -> "bar"))          
      

      but you can't use dots in the service property name (like "foo.bar=zoo"):

      component(comp -> comp
          .impl(ServiceImpl.class)
          .provides(Service.class, foo.bar -> "zoo"))  
      

      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:

      component(comp -> comp
          .impl(ServiceImpl.class)
          .provides(Service.class, foo_bar -> "zoo", foo__bar -> "zoo2"));
      

      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.

      Attachments

        Activity

          People

            pderop Pierre De Rop
            pderop Pierre De Rop
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: