Advertisement
Guest User

Untitled

a guest
Jan 20th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. public class ConfigLocator implements Extension {
  2. private Config config;
  3.  
  4. public void initConfig(@Observes BeforeBeanDiscovery bbd, BeanManager bm) {
  5. List<ConfigSource> collectedConfigSources = new ArrayList<>();
  6. bm.fireEvent(new CollectConfig(collectedConfigSources));
  7. this.config = ConfigProvider.newConfig()......;
  8.  
  9.  
  10. bm.fireEvent(config);
  11. }
  12. }
  13.  
  14.  
  15. and then use
  16.  
  17. CDI.current().getBeanManager().getExtension(ConfigLocator.class);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement