From 006ff5b1ef12cd661a00b02ae21be5b628af9894 Mon Sep 17 00:00:00 2001 From: Johan Haleby Date: Fri, 22 Dec 2023 12:22:06 +0100 Subject: [PATCH] Removed OccurrentMongoRegistrar.java because it's not needed because we don't need to read any properties from the EnableOccurrent annotation. Also intellij works better without the registrar. --- .../mongo/blocking/EnableOccurrent.java | 2 +- .../blocking/OccurrentMongoRegistrar.java | 46 ------------------- 2 files changed, 1 insertion(+), 47 deletions(-) delete mode 100644 framework/spring-boot-starter-mongodb/src/main/java/org/occurrent/springboot/mongo/blocking/OccurrentMongoRegistrar.java diff --git a/framework/spring-boot-starter-mongodb/src/main/java/org/occurrent/springboot/mongo/blocking/EnableOccurrent.java b/framework/spring-boot-starter-mongodb/src/main/java/org/occurrent/springboot/mongo/blocking/EnableOccurrent.java index 291c2a180..9f508b728 100644 --- a/framework/spring-boot-starter-mongodb/src/main/java/org/occurrent/springboot/mongo/blocking/EnableOccurrent.java +++ b/framework/spring-boot-starter-mongodb/src/main/java/org/occurrent/springboot/mongo/blocking/EnableOccurrent.java @@ -28,6 +28,6 @@ @Retention(RetentionPolicy.RUNTIME) @Documented @Inherited -@Import(OccurrentMongoRegistrar.class) +@Import(OccurrentMongoAutoConfiguration.class) public @interface EnableOccurrent { } \ No newline at end of file diff --git a/framework/spring-boot-starter-mongodb/src/main/java/org/occurrent/springboot/mongo/blocking/OccurrentMongoRegistrar.java b/framework/spring-boot-starter-mongodb/src/main/java/org/occurrent/springboot/mongo/blocking/OccurrentMongoRegistrar.java deleted file mode 100644 index 569c86e74..000000000 --- a/framework/spring-boot-starter-mongodb/src/main/java/org/occurrent/springboot/mongo/blocking/OccurrentMongoRegistrar.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * - * Copyright 2023 Johan Haleby - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.occurrent.springboot.mongo.blocking; - -import org.jetbrains.annotations.NotNull; -import org.springframework.beans.factory.support.BeanDefinitionRegistry; -import org.springframework.beans.factory.support.RootBeanDefinition; -import org.springframework.context.annotation.ImportBeanDefinitionRegistrar; -import org.springframework.core.type.AnnotationMetadata; - -import static org.springframework.beans.factory.config.BeanDefinition.ROLE_SUPPORT; - -public class OccurrentMongoRegistrar implements ImportBeanDefinitionRegistrar { - - @Override - public void registerBeanDefinitions(AnnotationMetadata metadata, @NotNull BeanDefinitionRegistry registry) { -// AnnotationAttributes attributes = AnnotationAttributes.fromMap(metadata.getAnnotationAttributes(EnableOccurrent.class.getName(), true)); -// Class eventT = null; -// try { -// eventT = Class.forName(Objects.requireNonNull(attributes).getString("eventType")); -// } catch (ClassNotFoundException e) { -// throw new RuntimeException(e); -// } - - RootBeanDefinition definition = new RootBeanDefinition(OccurrentMongoAutoConfiguration.class); - definition.setSource(metadata); - definition.setRole(ROLE_SUPPORT); - definition.setLazyInit(false); - registry.registerBeanDefinition("occurrentMongoAutoConfiguration", definition); - } -} \ No newline at end of file