ConfigurationAdmin.createFactoryConfiguration should not persist Configuration
------------------------------------------------------------------------------

                 Key: FELIX-612
                 URL: https://issues.apache.org/jira/browse/FELIX-612
             Project: Felix
          Issue Type: Bug
          Components: Configuration Admin
    Affects Versions: configadmin-1.0.1, configadmin-1.0.0
            Reporter: Felix Meschberger
            Assignee: Felix Meschberger
             Fix For: configadmin-1.0.2


Currently the ConfigurationAdmin.createFactoryConfiguration methods immediately 
persist factory configurations upon creating them. This is not really incorrect 
as per the spec.

The problem comes with this opening the gate for potential garbage 
configuration to remain. Consider this sample method:

    public void createGarbage( String factoryPid )
    {
        getConfigurationAdmin().createFactoryConfiguration( factoryPid );
    }

This method creates a new factory configuration object on each call and 
immediately drops any reference to it. Because the configuration PID of the 
configurations returned is created randomly, there is no way to ever retrieve 
this configuration again. Why ? getConfiguration cannot be used because the PID 
is unkown and listConfigurations will not return it because the configuration 
has no properties yet.

So in the interest of not potentially producing garbage, the 
createFactoryConfiguration method should not immediately persist the 
configuration object.

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

Reply via email to