Pierre De Rop created FELIX-5355:

             Summary: Allow to use properties having dots with configuration 
                 Key: FELIX-5355
                 URL: https://issues.apache.org/jira/browse/FELIX-5355
             Project: Felix
          Issue Type: Improvement
          Components: Dependency Manager
    Affects Versions: org.apache.felix.dependencymanager-r8
            Reporter: Pierre De Rop
            Assignee: Pierre De Rop
            Priority: Minor
             Fix For: org.apache.felix.dependencymanager-r9

Recently, a new feature has been introduced in DM to allow injecting type-safe 
configuration proxies when a ConfigurationDependency is used (see FELIX-5177).

The principle is to deduce the name of a given property from a corresponding 
method name of the configuration proxy interface.

However, in some cases, you have some component depending on some configuration 
with properties having some dots ("."), and this character can't be used in 
java methods. Of course, the properties can be renamed to new names without 
dots, but in some cases, when you want to use configuration proxies on some 
legacy components, you often can't modify the existing configuration properties.

So, I would like to propose the attached patch which allows the support of dots 
in properties. the patch does the same done by DS: it maps the "\_" charater to 
".". And if the property contains "\_\_" character, then you can use a double 
"__" underscore:

For example, assuming you have the two properties in the configuration:


then you can use the following method names:

    public interface MyConfig {
        public String getFoo_param1(); // maps to "foo.param1"
        public String getFoo__param2(); // maps to "foo_param2"

Is there any objections if I commit the attached patch ?


This message was sent by Atlassian JIRA

Reply via email to