Say I have:
public interface Foo {...} public class AltProducer { private Foo altFoo; @Produces @Alternative public Foo getAltFoo() { return altFoo; } }
What do I need to put in beans.xml so that my AltProducer @Produces method is called, instead of typing Bar?
Found - you can simply specify the entire manufacturer class as an alternative.
@Alternative public class AltProducer { ... }
beans.xml:
<beans> <alternatives> <class>com.package.AltProducer</class> </alternatives> </beans>