Hi all,
In a private communication we have been discussion, the correct outcome
of the following code:
Configuration c =
configurationAdmin.createFactoryConfiguration(factoryPid);
c.update();
In the Apache Felix implementation the call to the parameterless
Configuration.update() method throws IOException because the
createFactoryConfiguration does not yet persist any configuration data
for the newly created configuration.
This contrasts to the following code:
Configuration c = configurationAdmin.getConfiguration(pidid);
c.update();
which does not throw an IOException because the getConfiguration method
persist the (still empty) configuration data.
Now, the Configuration.update() method states an IllegalStateException
is to be thrown if the configuration has been deleted and that an
IOException must be thrown if the configuration properties cannot be
read from persistence.
But what happens for newly created configurations where
Configuration.getProperties() would return null ?
I see two options :
(a) Throw an IllegalStateException because there is nothing yet
to be updated, pushed through plugins and provided to
ManagedService[Factory] services
(b) Update with nothing (empty Dictionary), push through plugins
and update services.
Thanks for any help and/or guidance.
Regards
Felix
_______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev