OK, thank you!
BR
Ewgenij Sokolovski
Gesendet: Sonntag, 01. September 2013 um 04:49 Uhr
Von: "BJ Hargrave" <hargr...@us.ibm.com>
An: "OSGi Developer Mail List" <osgi-dev@mail.osgi.org>
Betreff: Re: [osgi-dev] Declarative services: setting a non string property
Von: "BJ Hargrave" <hargr...@us.ibm.com>
An: "OSGi Developer Mail List" <osgi-dev@mail.osgi.org>
Betreff: Re: [osgi-dev] Declarative services: setting a non string property
It is not possible with DS. You cannot set property values to arbitrary types.
It is also not a good idea to put arbitrary typed values in service properties since observers wont necessarily have access to those types or the correct version of those types.
--
Hello, community. I work with Declarative Services and stumbled across the following problem recently. I want to register a service providing component with properties. According to Declarative Services concept I have to provide an XML file defining these properties. Now, the problem is that my properties are not strings. They are objects returned by a "create" method of another class. This was not a problem with
bc.registerService(MyClass.class.getName(), this, props);
because props could contain any kind of entries. But how can I manage this with Declarative Services? Is that possible at all?
BR Ewgenij
_______________________________________________
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev
It is also not a good idea to put arbitrary typed values in service properties since observers wont necessarily have access to those types or the correct version of those types.
--
BJ Hargrave Senior Technical Staff Member, IBM OSGi Fellow and CTO of the OSGi Alliance hargr...@us.ibm.com |
office: +1 386 848 1781 mobile: +1 386 848 3788 |
From: "Ewgenij Sokolovski" <ewgenij...@gmx.de>
To: osgi-dev@mail.osgi.org
Date: 2013/08/31 15:55
Subject: [osgi-dev] Declarative services: setting a non string property
Sent by: osgi-dev-boun...@mail.osgi.org
Hello, community. I work with Declarative Services and stumbled across the following problem recently. I want to register a service providing component with properties. According to Declarative Services concept I have to provide an XML file defining these properties. Now, the problem is that my properties are not strings. They are objects returned by a "create" method of another class. This was not a problem with
bc.registerService(MyClass.class.getName(), this, props);
because props could contain any kind of entries. But how can I manage this with Declarative Services? Is that possible at all?
BR Ewgenij
_______________________________________________
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev
_______________________________________________ OSGi Developer Mail List osgi-dev@mail.osgi.org https://mail.osgi.org/mailman/listinfo/osgi-dev