[ 
https://issues.apache.org/jira/browse/FELIX-303?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12753122#action_12753122
 ] 

Arjun Panday commented on FELIX-303:
------------------------------------

Hi Marcel,

I see this old issue is still open so i'm just adding on to it.
We've been using compositions with DM, but we noticed that only field injection 
was supported for compositions; callbacks only work on the main service (or on 
a single other instance, but this is rather a separate use case i think)
I'm suggesting a small fix attached here in order to also support callbacks on 
compositions.
The only issue i foresee is that DM normally dumps an exception when the 
callback is missing; since we cannot be sure which part of the composition has 
the callback, it now becomes normal to have missing callback methods, so i 
simply changed the stack trace to an info log.

I hope it helps.

> Support for compositions
> ------------------------
>
>                 Key: FELIX-303
>                 URL: https://issues.apache.org/jira/browse/FELIX-303
>             Project: Felix
>          Issue Type: New Feature
>          Components: Dependency Manager
>    Affects Versions: felix-0.8.0
>            Reporter: Marcel Offermans
>            Assignee: Marcel Offermans
>         Attachments: dm-patch.tgz, proxy.patch.txt
>
>
> When creating service implementations out of POJO's, the more complex 
> implementations will often be composed out of several POJO's, using 
> composition instead of inheritance. This means instead of one implementation, 
> you have N implementations. The consequences of this are that for both the 
> callbacks and the injected services, you want to be able to explicitly 
> specify one of more instances, instead of assuming there's only one. The API 
> needs to be extended to support this (basically adding a parameter of type 
> Object[] for some of the methods).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to