Skip to content

Instantly share code, notes, and snippets.

@chkal
Last active May 20, 2016 11:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chkal/09fc83002edc57da64e4b7e49b201489 to your computer and use it in GitHub Desktop.
Save chkal/09fc83002edc57da64e4b7e49b201489 to your computer and use it in GitHub Desktop.
// some interface
public interface Plugin {
// ...
}
// standard bean
public class FirstPlugin implements Plugin {
// ...
}
// alternative which is enabled via beans.xml
@Alternative
public class SecondPlugin implements Plugin {
// ...
}
// QUESTION: What is the result of calling this?
Set<Beans> result = CDI.current().getBeanManager().getBeans(Plugin.class);
// My interpretation of CDI 2.0.EDR1: It returns both FirstPlugin and SecondPlugin
// In CDI 1.0 days OWB returned only SecondPlugin (https://issues.apache.org/jira/browse/OWB-658)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment