>> Is there a way to get a list of configurations for a single factory
>> PID if the properties have not been set for the configuration? > >Not that I am aware of. > >> If >> not, is there a reason why you cannot do so? > >Because there is no real different between the lack of a Configuration for >a PID and a Configuration for a PID that has no properties. Neither will >be delivered to the ManagedService and neither are visible in >listConfiguration. > >In fact, a ConfigurationAdmin implementation does not even really need to >persists a Configuration with no properties. > >> >> ConfigurationAdmin.listConfigurations will return an array of >> Configuration objects but only those objects which have non-null >> properties. Therefore, if you use >> ConfigurationAdmin.createFactoryConfiguration to create >> configurations, you have to make sure you keep track of the returned >> configurations or at least the PID. This works okay if there is a >> single consumer of the API, but not if you have multiple consumers >> of the API. For instance, if you have one consumer that creates the >> configuration and another that wants to actually set the properties >> of the configuration, the latter consumer has no way of knowing >> about the already created configurations. > >There is no need for this division, since creating an empty configuration >is essentially a no-op. > If creating a configuration and then not setting any properties is a no op, then maybe my assumptions above our incorrect. So does the following not really work: ConfigurationAdmin ca = ... String factoryPid = ... String pid = ca.createFactoryConfiguration(factoryPid).getPid(); ... // now try to change the config, but will this return a new config that isn't associated with the factory Configuration config = ca.getConfigurtion(pid); config.getFactoryPid(); // is this going to be null? config.update(props); Are you saying I must use the Configuration object returned from "createFactoryConfiguration" and can't call "getConfiguration"? Does a configuration object not exist (exist as defined by the description of "getConfiguration") until properties are set? >> >> This is in regards to 4.3 version of the spec, but if anything is >> changing in a newer version I would like to know as well. Thanks, Dave Humeniuk Software Engineer Sensor System Division (SSD) University of Dayton Research Institute
_______________________________________________ OSGi Developer Mail List osgi-dev@mail.osgi.org https://mail.osgi.org/mailman/listinfo/osgi-dev