|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |
@Target(value={TYPE,METHOD,FIELD}) @Retention(value=RUNTIME) @Documented public @interface Alternative
Specifies that a bean is an alternative. May be applied to a bean class, producer method or field or stereotype.
@Alternative public class MockOrder extends Order { ... }
An alternative is never available for injection, lookup or EL resolution in a Java EE module or library that is not a bean deployment archive (a module or library with no beans.xml file).
Nor is an alternative available for injection, lookup or EL resolution in every bean deployment archive. An alternative must be explicitly selected in every bean deployment archive in which the alternative should be available for injection, lookup and EL resolution.
By default, a bean deployment archive has no selected alternatives. An alternative must be explicitly declared using the <alternatives> element of the beans.xml file of the bean deployment archive. The <alternatives> element contains a list of bean classes and stereotypes. An alternative is selected for the bean deployment archive if either:
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |