Skip to content

Commit

Permalink
refactoring - do not inherit from ConfigModule.
Browse files Browse the repository at this point in the history
It doesn't add anything valuable to the picture anymore
  • Loading branch information
andrus committed Dec 9, 2023
1 parent ef2aca8 commit 5c43b3f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,25 @@
*/
package io.bootique.linkmove.v2.rest;

import io.bootique.ConfigModule;
import io.bootique.BQModule;
import io.bootique.ModuleCrate;
import io.bootique.di.Binder;

/**
* @since 2.0
* @deprecated in favor of LinkMove v3
*/
@Deprecated(since = "3.0", forRemoval = true)
public class LinkMoveRestModule extends ConfigModule {
public class LinkMoveRestModule implements BQModule {

@Override
public ModuleCrate crate() {
return ModuleCrate.of(this)
.description("Deprecated, can be replaced with 'bootique-linkmove3-rest-jakarta'.")
.build();
}

@Override
public void configure(Binder binder) {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
package io.bootique.linkmove.v2;

import com.nhl.link.move.runtime.LmRuntime;
import io.bootique.ConfigModule;
import io.bootique.BQModule;
import io.bootique.ModuleCrate;
import io.bootique.config.ConfigurationFactory;
import io.bootique.di.Binder;
Expand All @@ -36,7 +36,9 @@
* @deprecated in favor of LinkMove v3
*/
@Deprecated(since = "3.0", forRemoval = true)
public class LinkMoveModule extends ConfigModule {
public class LinkMoveModule implements BQModule {

private static final String CONFIG_PREFIX = "linkmove";

/**
* @param binder DI binder passed to the Module that invokes this method.
Expand All @@ -50,7 +52,7 @@ public static LinkMoveModuleExtender extend(Binder binder) {
public ModuleCrate crate() {
return ModuleCrate.of(this)
.description("Deprecated, can be replaced with 'bootique-linkmove3'.")
.config("linkmove", LinkMoveFactory.class)
.config(CONFIG_PREFIX, LinkMoveFactory.class)
.build();
}

Expand All @@ -67,7 +69,7 @@ public LmRuntime createLinkMoveRuntime(
ServerRuntime targetRuntime,
Set<LinkMoveBuilderCallback> buildCallbacks) {

return config(LinkMoveFactory.class, configFactory)
return configFactory.config(LinkMoveFactory.class, CONFIG_PREFIX)
.createLinkMove(injector, targetRuntime, buildCallbacks);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
package io.bootique.linkmove.v3.rest;

import io.bootique.ConfigModule;
import io.bootique.BQModule;
import io.bootique.ModuleCrate;
import io.bootique.di.Binder;
import io.bootique.di.Provides;
Expand All @@ -32,7 +32,7 @@
* @deprecated in favor of the Jakarta version of the REST connector
*/
@Deprecated(forRemoval = true)
public class LinkMoveRestModule extends ConfigModule {
public class LinkMoveRestModule implements BQModule {

@Override
public ModuleCrate crate() {
Expand Down

0 comments on commit 5c43b3f

Please sign in to comment.