Last active
March 30, 2018 22:13
-
-
Save steveturner/8427d8407e97cf0a5233bb3ff19fab9c to your computer and use it in GitHub Desktop.
An example using CDI to provide multiple implementations of an interface.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Inject | |
private Instance<IPropagationModel> providerSource; | |
public ProviderLister() { | |
} | |
public List<String> getProviderList() { | |
List<String> names = new ArrayList<String>(); | |
for (IPropagationModel provider : providerSource) { | |
names.add(provider.getName()); | |
} | |
return names; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment