Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement