Hi all,
I posted this question earlier on the user@karaf,apache.org mailing list
[1] but it did not seem to get much attention so I thought I'd ask it here
instead, since it is a very generic OSGi question.
Anyway, sorry for cross-posting.
To my question:
I have a ManagedFactoryService that creates service instances and I have
another (client) bundle that creates instances by registering new
configurations with the factory.
What I currently find difficult is to propagate errors (such as a required
configuration property missing) from the ManagedFactoryService to the
client.
When the client uses an invalid configuration dictionary to instantiate a
new service instance as follows
// instantiate new service with serviceConfig as instantiation
parameters
Configuration config =
configurationAdmin.createFactoryConfiguration(factoryPid, null);
config.update(serviceConfig);
no exception is raised despite the ManagedFactoryService throwing a
ConfigurationException.
I guess this is expected since configuration updates are handled on a
separate thread of execution.
But this is problematic since, from the client bundle's perspective, the
configuration update appears to have been successful.
So what I really need to know is if there is a best practice for
propagating the configuration error from the ManagedFactoryService to the
client?
Any suggestions would be appreciated.
best regards, Peter
[1] -
http://karaf.922171.n3.nabble.com/Best-practice-on-propagating-configuration-errors-from-ManagedFactoryService-to-client-tp3699427p3699427.html