diff --git a/bootique-job-consul/src/main/java/io/bootique/job/consul/ConsulJobModuleProvider.java b/bootique-job-consul/src/main/java/io/bootique/job/consul/ConsulJobModuleProvider.java index 07e24788..e6f42e07 100644 --- a/bootique-job-consul/src/main/java/io/bootique/job/consul/ConsulJobModuleProvider.java +++ b/bootique-job-consul/src/main/java/io/bootique/job/consul/ConsulJobModuleProvider.java @@ -19,13 +19,15 @@ package io.bootique.job.consul; import io.bootique.BQModuleProvider; -import io.bootique.di.BQModule; - +import io.bootique.bootstrap.BuiltModule; public class ConsulJobModuleProvider implements BQModuleProvider { @Override - public BQModule module() { - return new ConsulJobModule(); + public BuiltModule buildModule() { + return BuiltModule.of(new ConsulJobModule()) + .provider(this) + .description("Integrates Consul-based Bootique job locks") + .build(); } } diff --git a/bootique-job-instrumented/src/main/java/io/bootique/job/instrumented/JobInstrumentedModuleProvider.java b/bootique-job-instrumented/src/main/java/io/bootique/job/instrumented/JobInstrumentedModuleProvider.java index d7bb1614..858ca5f9 100644 --- a/bootique-job-instrumented/src/main/java/io/bootique/job/instrumented/JobInstrumentedModuleProvider.java +++ b/bootique-job-instrumented/src/main/java/io/bootique/job/instrumented/JobInstrumentedModuleProvider.java @@ -20,26 +20,24 @@ package io.bootique.job.instrumented; import io.bootique.BQModuleProvider; -import io.bootique.di.BQModule; +import io.bootique.bootstrap.BuiltModule; import io.bootique.job.JobModule; import io.bootique.job.JobModuleProvider; import io.bootique.metrics.MetricsModuleProvider; import java.util.Collection; -import java.util.Collections; import static java.util.Arrays.asList; public class JobInstrumentedModuleProvider implements BQModuleProvider { @Override - public BQModule module() { - return new JobInstrumentedModule(); - } - - @Override - public Collection> overrides() { - return Collections.singleton(JobModule.class); + public BuiltModule buildModule() { + return BuiltModule.of(new JobInstrumentedModule()) + .provider(this) + .description("Integrates metrics and extra logging in Bootique job engine") + .overrides(JobModule.class) + .build(); } @Override diff --git a/bootique-job-zookeeper/src/main/java/io/bootique/job/zookeeper/ZkJobModuleProvider.java b/bootique-job-zookeeper/src/main/java/io/bootique/job/zookeeper/ZkJobModuleProvider.java index 143e84c0..15b48ea4 100644 --- a/bootique-job-zookeeper/src/main/java/io/bootique/job/zookeeper/ZkJobModuleProvider.java +++ b/bootique-job-zookeeper/src/main/java/io/bootique/job/zookeeper/ZkJobModuleProvider.java @@ -1,12 +1,15 @@ package io.bootique.job.zookeeper; import io.bootique.BQModuleProvider; -import io.bootique.di.BQModule; +import io.bootique.bootstrap.BuiltModule; public class ZkJobModuleProvider implements BQModuleProvider { @Override - public BQModule module() { - return new ZkJobModule(); + public BuiltModule buildModule() { + return BuiltModule.of(new ZkJobModule()) + .provider(this) + .description("Integrates Zookeeper-based Bootique job locks") + .build(); } } diff --git a/bootique-job/src/main/java/io/bootique/job/JobModuleProvider.java b/bootique-job/src/main/java/io/bootique/job/JobModuleProvider.java index 5b84182c..72d131b7 100644 --- a/bootique-job/src/main/java/io/bootique/job/JobModuleProvider.java +++ b/bootique-job/src/main/java/io/bootique/job/JobModuleProvider.java @@ -20,30 +20,24 @@ package io.bootique.job; import io.bootique.BQModuleProvider; -import io.bootique.di.BQModule; +import io.bootique.bootstrap.BuiltModule; import io.bootique.job.graph.JobGraphNodeFactory; import io.bootique.job.scheduler.SchedulerFactory; import io.bootique.type.TypeRef; -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.Map; public class JobModuleProvider implements BQModuleProvider { @Override - public BQModule module() { - return new JobModule(); - } - - @Override - public Map configs() { - + public BuiltModule buildModule() { TypeRef> jobs = new TypeRef<>() {}; - Map configs = new HashMap<>(); - configs.put("scheduler", SchedulerFactory.class); - configs.put("jobs", jobs.getType()); - return configs; + return BuiltModule.of(new JobModule()) + .provider(this) + .description("Provides Bootique's own job execution engine") + .config("scheduler", SchedulerFactory.class) + .config("jobs", jobs.getType()) + .build(); } }