About OSGiNews and EventsMarkets and SolutionsSpecificationsWork GroupsUsers' ForumsLinksJoin
Easier Configuration Admin2010-08-31
We are likely to introduce a new service that makes Configuration Admin significantly easier to use. How? By using the Java type machine. Though properties are nice and flexible, they tend to cause cluttered code because of the required checks and conversions. The new model therefore defines configuration types with interfaces. For example, this is how a simple configuration type for a web service would look like:
package com.acme.webconf;The PID is defined by the interface name, in this example it is com.acme.webconf.WebConf. This "record" has a port (an integer) and a host name (a String). A bundle that wants to receive this information, only has to register a Configurable<WebConf> service. For example: @ComponentNo more type error prone type conversions, no more spelling errors in property names or PIDs! And you're not restricted to a single PID, you can extend the interfaces with other interfaces and each extended interface name will automatically be used as PID, merging all underlying configuration records. Annotations in this specification will also make data validation easier. It is also possible to use factories. In that case, register a ConfigurableFactory public interface ConfigurableFactory<WebConf> {This specification will make Configuration Admin significantly easier to use.Peter Kriens P.S. Did you already register for the community event? P.S. And did you look at the Masterclass On OSGi (with certificate) in Girona? Comments |
Registration OpenMarch 26 to 29 in Reston, VA, USARead the OSGi Blog ...
|
|||
|
Home | Trademark Policy | Privacy Policy Copyright © 2012 OSGi™ Alliance. Comments about the site? Send them to: OSGi Alliance WebMaster. |
Was just experimenting with migrating away from ManagedServiceFactory(s) to Declarative Services and it's little know feature of providing similar interaction with ConfigAdmin. Hat tip to Neil's
http://njbartlett.name/2010/07/19/factory-components-in-ds.html
Now I just bundle my components with both a component.xml and a metatype.xml (allowing UIs to present dynamic configuration forms.)
Besides the changes to ConfigAdmin you mentioned will there also be changes to DS schema or the DS type based activation methods?
I wanted to create a JFace UI for ConfigAdmin but had no time so far.
I do like your approach, though, and I can see ways it would provide for backwards compatibility with the existing Configuration Admin service.
'lacks a grouping feature', - AFAIK (Peter correct me if this is wrong) the schema for metatype is extensible - if you wanted to, you could add the grouping elements in your metatype documents and use these as you please in your presentation.
BTW - There are some real gems in the OSGi Compendium, and I think metatype is one of them. I also use it to extend my EMF business domain model elements/UIs and as config spec and data in (autoconf.xml) documents within OSGi Deployment Admin scenarios.
@Steve: I have not done performance testing, what do you mean by overhead?
Thanks!