Hi list!
I'm writing an application that uses Configuration Admin to be configured at
runtime. Now, for one of my DS components I have a more complex configuration
requirement. Assume e.g. I want to configure the component to create a set of
TCP connections. Using XML configuration I would use something like this
snippet:
<connections>
<connection>
<host>somehost.com</host>
<port>1234</port>
</connection>
<connection>
<host>someotherhost.com</host>
<port>4321</port>
</connection>
</connections>
My question now is if there's an elegant way to map such a set of complex
configuration objects to Configuration Admins properties file format? Maybe I
don't see the wood for the trees but I can't think of a nice way (so that I
could also use the Metatype Service specification), except this suboptimal one:
connection.host = {somehost.com,someotherhost.com}
connection.port = {1234,4321}
where each entry of the string array of the property 'connection.host' key must
have an according entry 'connection.port' with the same index. However, that
solution will make editing the configuration files very error prone and
unintuitive.
I can think of another alternative, which is using a component factory that
creates one instance of my service per connection configuration. But I have
other use cases for which this approach would not be feasible.
If there's no elegant way my next question is the following: are there any
activities towards an XML based counterpart to Configuration Admin Service and
Metatype Service?
Kind regards,
Daniel Bimschas
_______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev