Skip to content

Commit

Permalink
Upgrading to the latest BQModuleProvider format
Browse files Browse the repository at this point in the history
  • Loading branch information
andrus committed Nov 24, 2023
1 parent 0a4741d commit f85d14c
Showing 1 changed file with 9 additions and 24 deletions.
33 changes: 9 additions & 24 deletions src/main/java/io/bootique/curator/CuratorModuleProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, Type> 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();
}
}

0 comments on commit f85d14c

Please sign in to comment.