Skip to content

Commit

Permalink
Fix ConfigProducer
Browse files Browse the repository at this point in the history
  • Loading branch information
radcortez committed Jun 28, 2021
1 parent 71f276a commit efde8dd
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import javax.enterprise.context.Dependent;
import javax.enterprise.inject.Produces;
import javax.enterprise.inject.spi.InjectionPoint;
import javax.inject.Inject;

import org.eclipse.microprofile.config.Config;
import org.eclipse.microprofile.config.ConfigProvider;
Expand All @@ -41,12 +40,15 @@
*/
@ApplicationScoped
public class ConfigProducer {
@Inject
Config config;

ConfigProducer() {
this.config = ConfigProvider.getConfig(getContextClassLoader()).unwrap(SmallRyeConfig.class);
}

@Produces
protected SmallRyeConfig getConfig() {
return ConfigProvider.getConfig(getContextClassLoader()).unwrap(SmallRyeConfig.class);
return config.unwrap(SmallRyeConfig.class);
}

@Dependent
Expand Down

0 comments on commit efde8dd

Please sign in to comment.