This discussion is archived
3 Replies Latest reply: Feb 28, 2013 10:45 PM by r035198x RSS

Detect presence/absence of a module with CDI

943372 Newbie
Currently Being Moderated

my project builds a war. In the war there is a jar A which provides the implementation I1 of interface I. I1 is injected in a JSF controller. There is an optional jar B which provides another implementation I2 of interface I. I2 has an higher priority than I1. Is there a possibilty to achieve when jar B is present in the war I2 is injected. I tried it with @Alternative on I2 with an entry in beans.xml as alternative in jar B without success. I1 is injected. Something like a priority would be necessary. Or probably I am on a wrong way and there's another one that fits for my use case?



  • Correct Answers - 10 points
  • Helpful Answers - 5 points