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

Marcel Offermans commented on FELIX-987:
----------------------------------------

There are currently three things besides dependencies that are automatically 
injected: BundleContext, ServiceRegistration and DependencyManager.

For service dependencies, you can now configure two things:
1) if you want them to be injected at all (setAutoConfig(boolean))
2) which specific field name you want to use (default is all fields of that 
type) (setAutoConfig(String))

Probably, you want to be able to do something similar for these things, 
defaulting to the same behaviour as before if you don't configure anything. I'm 
thinking about adding the following method to the ServiceImpl:
 - setAutoConfig(Clazz type, boolean autoConfig) allowing you to do: 
setAutoConfig(BundleContext.class, false)
 - setAutoConfig(Clazz type, String instanceName) to only use a specific 
instance name for injection

Does that make sense?

> Please make bundle context injection optional
> ---------------------------------------------
>
>                 Key: FELIX-987
>                 URL: https://issues.apache.org/jira/browse/FELIX-987
>             Project: Felix
>          Issue Type: Improvement
>          Components: Dependency Manager
>            Reporter: Jeroen van Grondelle
>            Assignee: Marcel Offermans
>            Priority: Minor
>
> We use the dependency manager to defer the registration of some services till 
> required services are available
> through binding an intermediary object to the dependency manager.
> As we want to bind these services using a specific bundle context, we 
> communicate this bundle context
> through the intermediary.
> Dependency manager's default behaviour is to inject the bundle context 
> associated with the manager in any
> member of type bundle context. Thus, our bundle context is overwritten and 
> our services are bound to the
> wrong bundle context.
> Could bundle context  injection be made optional through a parameter/setting?
> Thanks in advance!

-- 
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