feat(config): Add @ConditionalOnMissingBean annotation to service beans in configuration classes
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package de.extio.game_engine.event;
|
||||
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
|
||||
@@ -19,6 +20,7 @@ public class EventsAutoConfiguration {
|
||||
}
|
||||
|
||||
@Bean
|
||||
@ConditionalOnMissingBean
|
||||
EventService eventService(final EventHandlerRegistry registry, final EventExecutor executor) {
|
||||
final EventService eventService = new EventServiceImpl(registry, executor);
|
||||
return eventService;
|
||||
|
||||
Reference in New Issue
Block a user