I want to let CDI "pick up" an Alternative Class as Implementation of an Interface.
While everything is bundles in a EAR the Alternative Implementation will be in the war file and the rest (Class injecting the Interfaces, the Interface, "Default" Implementation of the Interfaces) will be in the ejb jar.
Here some code to illustrate it:
EJB Module:
public interface I {}
public class C implements I {}
public class A {
@Inject I var
public void test() {
System.out.println(var instanceof C); // I want to have here as Result: false
}
}
WAR Module:
@Alternative
public class D implements I {}
Setting the beans.xml in the war file did not help..