felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Felix Meschberger (JIRA)" <j...@apache.org>
Subject [jira] Commented: (FELIX-1603) Allow configuration dictionary complex values
Date Wed, 08 Sep 2010 12:12:34 GMT

    [ https://issues.apache.org/jira/browse/FELIX-1603?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12907183#action_12907183
] 

Felix Meschberger commented on FELIX-1603:
------------------------------------------

It looks like there are quite some changes ahead with respect to Configuration Admin in future
OSGi specifications [1]. So I think we should put this on hold until then.

[1] http://www.osgi.org/blog/2010/08/easier-configuration-admin.html

> Allow configuration dictionary complex values
> ---------------------------------------------
>
>                 Key: FELIX-1603
>                 URL: https://issues.apache.org/jira/browse/FELIX-1603
>             Project: Felix
>          Issue Type: Wish
>          Components: Configuration Admin
>            Reporter: Bulat Nigmatullin
>            Priority: Minor
>
> We need some extended features in ConfigurationAdmin: submaps in configuration dictionaries,
which will be read by my PersistenceManager. I have idea, how to do it:
> Create an interface:
> interface ConfigurationDictionary extends Dictionary {
>    public ConfigurationDictionary copy(boolean deepCopy);
> }
> Lets CaseInsenstiveDictionary implements it:
>    public ConfigurationDictionary copy(boolean deepCopy) {
>        return new CaseInsensitveDictionary(this, deepCopy);
>    }
> And rewrite some members ConfigurationImpl:
>    private volatile ConfigurationDictionary properties;
>    ...
>    public Dictionary getProperties( boolean deepCopy )
>    {
>        // no properties yet
>        if ( properties == null )
>        {
>            return null;
>        }
>        ConfigurationDictionary props = properties.copy( deepCopy );
>        // fix special properties (pid, factory PID, bundle location)
>        setAutoProperties( props, false );
>        return props;
>    }
>    ...
>    private void configure( final Dictionary properties )
>    {
>        final ConfigurationDictionary newProperties;
>        if ( properties == null )
>        {
>            newProperties = null;
>        }
>        else
>        {
>            // remove predefined properties
>            clearAutoProperties( properties );
>            // ensure ConfigurationDictionary
>            if ( properties instanceof ConfigurationDictionary )
>            {
>                newProperties = ( ConfigurationDictionary ) properties;
>            }
>            else
>            {
>                newProperties = new CaseInsensitiveDictionary( properties );
>            }
>        }
>        synchronized ( this )
>        {
>            this.properties = newProperties;
>            this.lastModificationTime = System.currentTimeMillis();
>        }
>    }
> After this changes we will have possibility to create complex structures of properties.
For example, nested maps or somesing else - depends on developer's wishes.
> Or, if it is not possible, just add nested maps in CaseInsensitiveDictionary implementation.
But it will involve much more code changes.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message