Announcement Announcement Module
Collapse
No announcement yet.
Injecting multiple dependencies (List or Set) Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Injecting multiple dependencies (List or Set)

    I've dug around quite a bit but haven't found any examples of injecting N arbitrary dependencies into an object. For instance injecting 1 or more protocol listeners into an application w/o specifying a setListener1, setListener2, ..., setListenerN interface.

    Did I totally miss something?

  • #2
    You can have a property like

    void setListeners(Listener[] listeners)

    and use Spring <list> syntax to do the injection? In this case the property could simply be List typed as well.

    Rob

    Comment


    • #3
      Doh. That worked like a champ; thx. Don't know how I missed that.

      Comment

      Working...
      X