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

ConfigurationAdmin.createFactoryConfiguration should not persist Configuration

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • configadmin-1.0.0, configadmin-1.0.1
    • configadmin-1.0.4
    • Configuration Admin
    • None

    Description

      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.

      Attachments

        Activity

          People

            fmeschbe Felix Meschberger
            fmeschbe Felix Meschberger
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: