diff --git a/disjob-registry/disjob-registry-database/src/main/java/cn/ponfee/disjob/registry/database/configuration/DatabaseServerRegistryAutoConfiguration.java b/disjob-registry/disjob-registry-database/src/main/java/cn/ponfee/disjob/registry/database/configuration/DatabaseServerRegistryAutoConfiguration.java index cc96e2b17..81a942fd5 100644 --- a/disjob-registry/disjob-registry-database/src/main/java/cn/ponfee/disjob/registry/database/configuration/DatabaseServerRegistryAutoConfiguration.java +++ b/disjob-registry/disjob-registry-database/src/main/java/cn/ponfee/disjob/registry/database/configuration/DatabaseServerRegistryAutoConfiguration.java @@ -86,7 +86,6 @@ public WorkerRegistry workerRegistry(DatabaseRegistryProperties config, // -------------------------------------------------------------------------destroy datasource - @ConditionalOnMissingBean @Bean private DatabaseRegistryDataSourceDestroy databaseRegistryDataSourceDestroy(@Qualifier(SPRING_BEAN_NAME_JTW) JdbcTemplateWrapper wrapper) { return new DatabaseRegistryDataSourceDestroy(wrapper); diff --git a/disjob-supervisor/src/main/java/cn/ponfee/disjob/supervisor/configuration/EnableSupervisor.java b/disjob-supervisor/src/main/java/cn/ponfee/disjob/supervisor/configuration/EnableSupervisor.java index ed6926afc..8e42c9d27 100644 --- a/disjob-supervisor/src/main/java/cn/ponfee/disjob/supervisor/configuration/EnableSupervisor.java +++ b/disjob-supervisor/src/main/java/cn/ponfee/disjob/supervisor/configuration/EnableSupervisor.java @@ -90,7 +90,6 @@ class EnableSupervisorConfiguration { @AutoConfigureOrder(Ordered.HIGHEST_PRECEDENCE) @Order(Ordered.HIGHEST_PRECEDENCE) - @ConditionalOnMissingBean @Bean(JobConstants.SPRING_BEAN_NAME_CURRENT_SUPERVISOR) public Supervisor.Current currentSupervisor(@Value("${" + JobConstants.SPRING_WEB_SERVER_PORT + "}") int port, @Value("${" + JobConstants.DISJOB_BOUND_SERVER_HOST + ":}") String boundHost) { @@ -106,7 +105,6 @@ public Supervisor.Current currentSupervisor(@Value("${" + JobConstants.SPRING_WE } @DependsOn(JobConstants.SPRING_BEAN_NAME_CURRENT_SUPERVISOR) - @ConditionalOnMissingBean @Bean public GroupedServerInvoker workerRpcServiceClient(HttpProperties http, RetryProperties retry, @@ -127,17 +125,16 @@ public GroupedServerInvoker workerRpcServiceClient(HttpPropert ); } - // 如果注解没有参数,则默认以方法的返回类型判断,即容器中不存在类型为`LocalizedMethodArgumentConfigurer`的实例才创建 - @ConditionalOnMissingBean @Bean - public LocalizedMethodArgumentConfigurer localizedMethodArgumentConfigurer() { - return new LocalizedMethodArgumentConfigurer(); + public AuthenticationConfigurer authenticationConfigurer() { + return new AuthenticationConfigurer(); } + // 如果注解没有参数,则默认以方法的返回类型判断,即容器中不存在类型为`LocalizedMethodArgumentConfigurer`的实例才创建 @ConditionalOnMissingBean @Bean - public AuthenticationConfigurer authenticationConfigurer() { - return new AuthenticationConfigurer(); + public LocalizedMethodArgumentConfigurer localizedMethodArgumentConfigurer() { + return new LocalizedMethodArgumentConfigurer(); } @ConditionalOnMissingBean @@ -178,7 +175,6 @@ public DoInLocked scanRunningInstanceLocker(@Qualifier(JDBC_TEMPLATE_SPRING_BEAN class EnableSupervisorAdapter { @DependsOn(JobConstants.SPRING_BEAN_NAME_CURRENT_SUPERVISOR) - @ConditionalOnMissingBean @Bean public SupervisorRpcService supervisorRpcService(DistributedJobManager jobManager, DistributedJobQuerier jobQuerier) { diff --git a/disjob-worker/src/main/java/cn/ponfee/disjob/worker/configuration/EnableWorker.java b/disjob-worker/src/main/java/cn/ponfee/disjob/worker/configuration/EnableWorker.java index 230f574de..28e8614f3 100644 --- a/disjob-worker/src/main/java/cn/ponfee/disjob/worker/configuration/EnableWorker.java +++ b/disjob-worker/src/main/java/cn/ponfee/disjob/worker/configuration/EnableWorker.java @@ -63,7 +63,6 @@ class EnableWorkerConfiguration { @AutoConfigureOrder(Ordered.HIGHEST_PRECEDENCE) @Order(Ordered.HIGHEST_PRECEDENCE) - @ConditionalOnMissingBean @Bean(JobConstants.SPRING_BEAN_NAME_TIMING_WHEEL) public TaskTimingWheel timingWheel(WorkerProperties config) { return new TaskTimingWheel(config.getTimingWheelTickMs(), config.getTimingWheelRingSize()); @@ -72,7 +71,6 @@ public TaskTimingWheel timingWheel(WorkerProperties config) { @AutoConfigureOrder(Ordered.HIGHEST_PRECEDENCE) @Order(Ordered.HIGHEST_PRECEDENCE) @DependsOn(JobConstants.SPRING_BEAN_NAME_TIMING_WHEEL) - @ConditionalOnMissingBean @Bean(JobConstants.SPRING_BEAN_NAME_CURRENT_WORKER) public Worker.Current currentWorker(@Value("${" + JobConstants.SPRING_WEB_SERVER_PORT + "}") int port, @Value("${" + JobConstants.DISJOB_BOUND_SERVER_HOST + ":}") String boundHost, @@ -93,7 +91,6 @@ public Worker.Current currentWorker(@Value("${" + JobConstants.SPRING_WEB_SERVER } @DependsOn(JobConstants.SPRING_BEAN_NAME_CURRENT_WORKER) - @ConditionalOnMissingBean @Bean public WorkerRpcService workerRpcService(Worker.Current currentWork, WorkerRegistry registry) {