diff --git a/src/main/java/io/bootique/curator/CuratorModuleProvider.java b/src/main/java/io/bootique/curator/CuratorModuleProvider.java index 67e1c1b..55f91fd 100644 --- a/src/main/java/io/bootique/curator/CuratorModuleProvider.java +++ b/src/main/java/io/bootique/curator/CuratorModuleProvider.java @@ -19,32 +19,17 @@ package io.bootique.curator; -import io.bootique.BQModuleMetadata; import io.bootique.BQModuleProvider; -import io.bootique.di.BQModule; - -import java.lang.reflect.Type; -import java.util.Collections; -import java.util.Map; +import io.bootique.bootstrap.BuiltModule; public class CuratorModuleProvider implements BQModuleProvider { - @Override - public BQModule module() { - return new CuratorModule(); - } - - @Override - public Map configs() { - // TODO: config prefix is hardcoded. Refactor away from ConfigModule, and make provider - // generate config prefix, reusing it in metadata... - return Collections.singletonMap("curator", CuratorFrameworkFactory.class); - } - - @Override - public BQModuleMetadata.Builder moduleBuilder() { - return BQModuleProvider.super - .moduleBuilder() - .description("Provides integration with Apache Curator, a Zookeeper client."); - } + @Override + public BuiltModule buildModule() { + return BuiltModule.of(new CuratorModule()) + .provider(this) + .description("Integrates Apache Curator Zookeeper client") + .config("curator", CuratorFrameworkFactory.class) + .build(); + } }