Announcement Announcement Module
Collapse

Spring Dynamic Modules forum decommissioned in favor of Eclipse Gemini Blueprint

With the official first release of Eclipse Gemini Blueprint shipped, the migration of the Spring Dynamic Modules code base to the Eclipse Foundation, as part of the Gemini project, has been completed.

As such, this forum has been decommissioned in favour of the Eclipse Gemini forums.
See more
See less
Customizing autowiring Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Customizing autowiring

    Hi,
    i intend to build a modular app with springs dynamic (osgi) modules.
    My question is how one can intervene in the auto-wiring process, such that the implementation chosen for an argument / field is dependent on the modules being loaded. Since multiple modules providing each an implementation may be loaded at any given time, "byType" won't do. Qualifiers are not the way to go either, because I wan't the client to be able to override default implementations.

    From studying the API classes, I thought that maybe extending AutowireCandidateResolver is a solution. It could then do whatever logic it sees fit to check a candidate with isAutowireCandidate(). Only thing it would have to do is make sure, that there is but one bean returning "true".

    If that is how to do it, how will I be able to register this extension to AutowireCandidateResolver against my ApplicationContext? Afaik the interface is not one of the automatically registerable components.

    Greetings,
    Murat

  • #2
    Murat, there shouldn't be any problems with autowire by type in OSGi - even if there are multiple types inside the platform, your bundle will use only one version so inside your bundle, there will be no ambiguity.

    Comment

    Working...
    X