From J6EE CDI Doco…
This is what I was referring to in the other post…
You wanted the thread to continue here.
2.1.4. Alternatives
We’ve already seen how qualifiers let us choose between multiple implementations of an interface at development time. But sometimes we have an interface (or other bean type) whose implementation varies depending upon the deployment environment. For example, we may want to use a mock implementation in a testing environment. An alternative may be declared by annotating the bean class with the @Alternative annotation.
public @Alternative
class MockPaymentProcessor extends PaymentProcessorImpl { … }
We normally annotate a bean @Alternative only when there is some other implementation of an interface it implements (or of any of its bean types). We can choose between alternatives at deployment time by selecting an alternative in the CDI deployment descriptor META-INF/beans.xml of the jar or Java EE module that uses it.
Different modules can specify that they use different alternatives.
We cover alternatives in more detail in Section 4.7, “Alternatives”.
(Taken from CDI Weld doco – JBoss – Attached)
I can see that a dependent deployment COULD:
set the alternative in the beans.xml OR
substitute complete packages in what is deployed (as the container would be happy as long as it find ONLY ONE possible injectable bean)
Your Thoughts?
Attachments:
You must be
logged in to view attached files.