From 50d6c55b07534c97c5fad7f3710fce27ca8431e0 Mon Sep 17 00:00:00 2001 From: Andrus Adamchik Date: Sat, 9 Dec 2023 10:21:39 -0500 Subject: [PATCH] refactoring - do not inherit from ConfigModule. It doesn't add anything valuable to the picture anymore --- .../simplejavamail/SimpleJavaMailModule.java | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/bootique-simplejavamail/src/main/java/io/bootique/simplejavamail/SimpleJavaMailModule.java b/bootique-simplejavamail/src/main/java/io/bootique/simplejavamail/SimpleJavaMailModule.java index 59529c6..25f70a9 100644 --- a/bootique-simplejavamail/src/main/java/io/bootique/simplejavamail/SimpleJavaMailModule.java +++ b/bootique-simplejavamail/src/main/java/io/bootique/simplejavamail/SimpleJavaMailModule.java @@ -1,8 +1,9 @@ package io.bootique.simplejavamail; -import io.bootique.ConfigModule; +import io.bootique.BQModule; import io.bootique.ModuleCrate; import io.bootique.config.ConfigurationFactory; +import io.bootique.di.Binder; import io.bootique.di.Provides; import io.bootique.shutdown.ShutdownManager; @@ -13,19 +14,25 @@ * @deprecated in favor of the Jakarta flavor */ @Deprecated(since = "3.0", forRemoval = true) -public class SimpleJavaMailModule extends ConfigModule { +public class SimpleJavaMailModule implements BQModule { + + private static final String CONFIG_PREFIX = "simplejavamail"; @Override public ModuleCrate crate() { return ModuleCrate.of(this) .description("Deprecated, can be replaced with 'bootique-simplejavamail-jakarta'.") - .config(configPrefix, MailersFactory.class) + .config(CONFIG_PREFIX, MailersFactory.class) .build(); } + @Override + public void configure(Binder binder) { + } + @Singleton @Provides - Mailers provideMailers(ConfigurationFactory configurationFactory, ShutdownManager shutdownManager) { - return config(MailersFactory.class, configurationFactory).createMailers(shutdownManager); + Mailers provideMailers(ConfigurationFactory configFactory, ShutdownManager shutdownManager) { + return configFactory.config(MailersFactory.class, CONFIG_PREFIX).createMailers(shutdownManager); } }