Re: [osgi-dev] Retrieving service configuration implementation in reference method

2018-09-03 Thread Alain Picard via osgi-dev
On Mon, Sep 3, 2018 at 9:27 AM Tim Ward wrote: > > > On 3 Sep 2018, at 12:46, Alain Picard wrote: > > Tim, > > Regarding point 1, I feel like I dropped the ball and it makes sense. > > > Not really, there genuinely is a bug in bnd 4.0, and it was only fixed in > the 4.1 development stream recent

Re: [osgi-dev] Retrieving service configuration implementation in reference method

2018-09-03 Thread Tim Ward via osgi-dev
> On 3 Sep 2018, at 12:46, Alain Picard wrote: > > Tim, > > Regarding point 1, I feel like I dropped the ball and it makes sense. Not really, there genuinely is a bug in bnd 4.0, and it was only fixed in the 4.1 development stream recently (within the last week). > > Regarding point 2, I

Re: [osgi-dev] Retrieving service configuration implementation in reference method

2018-09-03 Thread Alain Picard via osgi-dev
Tim, Regarding point 1, I feel like I dropped the ball and it makes sense. Regarding point 2, I learned something about the use of converters to manage component property types (and not to use them anywhere). So I read in chapter 707 to find out how to do it and now I have an issue with my Class

Re: [osgi-dev] Retrieving service configuration implementation in reference method

2018-09-03 Thread Tim Ward via osgi-dev
Problem 1: The Relevant bitts of the specification are: How component properties override each other at runtime: https://osgi.org/specification/osgi.cmpn/7.0.0/service.component.html#service.component-component.properties

Re: [osgi-dev] Retrieving service configuration implementation in reference method

2018-08-25 Thread Alain Picard via osgi-dev
I had an idea to try using @ComponentPropertyType and searched and found that while not specifically covered by the documentation, in the cpmn there is at least one case of a Class property in ExportedService and that the code seems to support it (ComponentPropertyTypeDataCollector#valueToProperty)

Re: [osgi-dev] Retrieving service configuration implementation in reference method

2018-08-24 Thread Alain Picard via osgi-dev
Tim, I didn't do this here since has you might have noticed this is a factory and the evaluation (your getRendereFor) is to determine which renderer type to get a new instance of. We are using the pattern that you describe where the services are just selected. But maybe it's just a piece that I'm

Re: [osgi-dev] Retrieving service configuration implementation in reference method

2018-08-24 Thread Tim Ward via osgi-dev
Right, so in this case it looks like you’re running a whiteboard, is it possible you would be better off not using the service properties for this filtering? For example: @Reference(policy=DYNAMIC, cardinality=MULTIPLE) private final List renderers = new CopyOnWriteArrayList<>(); public ZKRende

Re: [osgi-dev] Retrieving service configuration implementation in reference method

2018-08-24 Thread Alain Picard via osgi-dev
They represent classes, which is why I would have like to have a Class annotation so I could do "tester=MyTester.class". instead of "tester="com.acme.mypkg.MyTester". For example I have a number of components implementing a service and as part of their property they define their "filter conditions

Re: [osgi-dev] Retrieving service configuration implementation in reference method

2018-08-24 Thread Tim Ward via osgi-dev
Do these properties “represent” classes or are they actually classes? If they are just representations (which would be a good thing) then you can define a static string constant representing the class which is mapped internally to the correct class name (which can then change over time). Clients

Re: [osgi-dev] Retrieving service configuration implementation in reference method

2018-08-24 Thread Alain Picard via osgi-dev
Tim & all, My immediate use case is that my components have some properties and some of those represent classes (this interfaces with 3rd party libraries, I would probably design it differently if I could, but it has to be configuration as it is used to determine if the component is a match, much

Re: [osgi-dev] Retrieving service configuration implementation in reference method

2018-08-23 Thread Tim Ward via osgi-dev
The properties visible in the Map (or ServiceReference) are the service properties. There is some overlap with configuration (services that are configurable are encouraged to publish configuration properties as service properties) but they are separate, and can be different. The only way that s

[osgi-dev] Retrieving service configuration implementation in reference method

2018-08-22 Thread Alain Picard via osgi-dev
In a reference method, i can get the property configuration of the service along with the ComponentFactory and some other optional arguments. Can any of those give me a way to retrieve the implementation from the configuration (i.e. the class name of the implementation) ? Thanks Alain