Skip to content

Commit

Permalink
refactor(config): package-private bean methods in configs
Browse files Browse the repository at this point in the history
  • Loading branch information
theborakompanioni committed Jul 2, 2023
1 parent 0c7a531 commit eb7bb7d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import java.util.TimeZone;

@Slf4j
@SpringBootApplication
@SpringBootApplication(proxyBeanMethods = false)
public class ClnSpendAndReplaceApplication {
static {
TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@

@EnableAsync
@Configuration
public class ClnSpendAndReplaceAsyncConfig implements AsyncConfigurer {
class ClnSpendAndReplaceAsyncConfig implements AsyncConfigurer {

@Override
public Executor getAsyncExecutor() {
return taskExecutor();
}

@Bean("tbkSpringAsyncTaskExecutor")
public ThreadPoolTaskExecutor taskExecutor() {
ThreadPoolTaskExecutor taskExecutor() {
ThreadPoolTaskExecutor threadPoolTaskExecutor = new ThreadPoolTaskExecutor();
threadPoolTaskExecutor.setThreadNamePrefix("tbk-async-");
threadPoolTaskExecutor.setCorePoolSize(1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
@Slf4j
@Configuration(proxyBeanMethods = false)
@EnableConfigurationProperties(ClnSpendAndReplaceProperties.class)
public class ClnSpendAndReplaceConfig {
class ClnSpendAndReplaceConfig {

private final ClnSpendAndReplaceProperties properties;

Expand All @@ -30,7 +30,7 @@ public ClnSpendAndReplaceConfig(ClnSpendAndReplaceProperties properties) {
}

@Bean
public RunOptions runOptions(Environment env, ApplicationArguments applicationArguments) {
RunOptions runOptions(Environment env, ApplicationArguments applicationArguments) {
boolean isExplicitTestEnvironment = env.acceptsProfiles(Profiles.of("test | debug | development | staging"));
boolean isExplicitDryRunGivenByUserViaArguments = applicationArguments.containsOption("dry");
boolean isExplicitDryRunGivenByUserViaProperties = properties.getDry();
Expand All @@ -45,19 +45,19 @@ public RunOptions runOptions(Environment env, ApplicationArguments applicationAr
}

@Bean
public ApplicationShutdownManager applicationShutdownManager(ApplicationContext applicationContext) {
ApplicationShutdownManager applicationShutdownManager(ApplicationContext applicationContext) {
return new ApplicationShutdownManager(applicationContext);
}

@Bean
public ClnSpendAndReplacePlugin clnSpendAndReplacePlugin(ApplicationShutdownManager applicationShutdownManager,
ClnSpendAndReplacePlugin clnSpendAndReplacePlugin(ApplicationShutdownManager applicationShutdownManager,
Exchange exchange,
RunOptions dryRunOption) {
return new ClnSpendAndReplacePlugin(applicationShutdownManager, exchange, dryRunOption);
}

@Bean
public PluginInitializer pluginInitializer(ClnSpendAndReplacePlugin plugin) {
PluginInitializer pluginInitializer(ClnSpendAndReplacePlugin plugin) {
return new PluginInitializer(plugin);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,4 @@ public class ClnSpendAndReplaceProperties {
public boolean getDry() {
return Objects.requireNonNullElse(dry, false);
}

}

0 comments on commit eb7bb7d

Please sign in to comment.