Why, don't you use a lookup that after the call to the factory check if the registration was successful ? If lookup fail you thrown a ServiceUnavailableException.
--Filippo Il 30 gennaio 2012 09:24, Peter Gardfjäll <[email protected]> ha scritto: > Hi all, > > thought I'd ask this general OSGi question on this list full of > OSGi-knowledgeable people. > Please tell me if it belongs better on a more OSGi-standard specific forum > (such as Felix/Equinox perhaps). > > So 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
