osgi / bugzilla-archive

Archive of OSGi Alliance Specification Bugzilla bugs. The Specification Bugzilla system was decommissioned with the move to GitHub. The issues in this repository are imported from the Specification Bugzilla system for archival purposes.
0 stars 1 forks source link

[ds] Factory Config + Factory Component, and more service props #2558

Closed bjhargrave closed 10 years ago

bjhargrave commented 10 years ago

Original bug ID: BZ#2690 From: David Jencks <djencks@us.ibm.com> Reported version: R6

bjhargrave commented 10 years ago

Comment author: David Jencks <djencks@us.ibm.com>

I'm not sure how appropriate this would be for rfc 190, but I'm planning to implement it for felix ds since it will be very easy and people have asked for it.

There's no real technical reason that prevents applying factory configurations to a factory component to create lots of differently configured ComponentFactory services, although this is currently prohibited by the spec. The problem right now is that there's no way to distinguish these services since they all have exactly the same 2 service properties.

So there are two parts to this:

  1. for a factory component, expose configuration properties whose key starts with a special prefix, perhaps org.osgi.service.component.factory.property., as service properties of the ComponentFactory service (with the prefix trimmed off). This would work for any factory component. (this feature has been requested separately from (2))

  2. Allow factory configurations for one of the pids, just like with other non-factory components. Each factory configuration will result in a CompomentFactory whose "default" properties are derived from the xml descriptor and the configurations for the pids, including the one factory configuration; the "newInstance" properties will be merged with these "default" properties.

bjhargrave commented 10 years ago

Comment author: @bjhargrave

CPEG call: This request is basically a request for a factory factory [1]. BJ objects to this. Peter asks why this change is proposed. Is there a use case the proposed change would address? David Jencks indicates there is not a specific request for this by he felt it should be supported. David will come back with a use case to continue the discussion.

[1] http://discuss.joelonsoftware.com/default.asp?joel.3.219431.12

bjhargrave commented 10 years ago

Comment author: David Jencks <djencks@us.ibm.com>

We won't put this in the spec at this time. I plan to implement the idea in felix as an extension and may bring it back if it turns out to be heavily used.