Created
January 20, 2017 22:15
-
-
Save struberg/1677ccc92a5d8818862ab9e5aca88ebe to your computer and use it in GitHub Desktop.
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
public class ConfigLocator implements Extension { | |
private Config config; | |
public void initConfig(@Observes BeforeBeanDiscovery bbd, BeanManager bm) { | |
List<ConfigSource> collectedConfigSources = new ArrayList<>(); | |
bm.fireEvent(new CollectConfig(collectedConfigSources)); | |
this.config = ConfigProvider.newConfig()......; | |
bm.fireEvent(config); | |
} | |
} | |
and then use | |
CDI.current().getBeanManager().getExtension(ConfigLocator.class); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment