refactor: disable eager-loading provider
MODIFY
common/logging/core/src/main/java/io/apiman/common/logging/ApimanLoggerFactoryRegistry.java
common/logging/core/src/main/java/io/apiman/common/logging/ApimanLoggerFactoryRegistry.java
@@ -56,7 +56,7 @@ public class ApimanLoggerFactoryRegistry {
IDelegateFactory instance = (IDelegateFactory) loggerFactory.newInstance();
String name = loggerFactory.getAnnotation(ApimanLoggerFactory.class).value();
DELEGATE_FACTORY_MAP.put(name, instance);
- System.err.println("Logger registered: " + name);
+ // System.err.println("Logger registered: " + name);
} catch (InstantiationException | IllegalAccessException e) {
throw new RuntimeException(e);
}

MODIFY
manager/api/rest-impl/src/main/java/io/apiman/manager/api/providers/eager/EagerProvider.java
manager/api/rest-impl/src/main/java/io/apiman/manager/api/providers/eager/EagerProvider.java
-package io.apiman.manager.api.providers.eager;
-
-import javax.enterprise.event.Observes;
-import javax.enterprise.inject.spi.AfterDeploymentValidation;
-import javax.enterprise.inject.spi.Bean;
-import javax.enterprise.inject.spi.BeanManager;
-import javax.enterprise.inject.spi.Extension;
-import javax.enterprise.util.AnnotationLiteral;
-import javax.ws.rs.ext.Provider;
-
-/**
- * Thanks to Dan Allen <a href="https://gist.github.com/mojavelinux/635719#file-startupbeanextension-java-L19">
- * for this trick to eager initialise</a> managed beans in CDI.
- *
- * todo(msavy): This has been temporarily disabled due to annoying classloader side-effects on Wildfly
- * I haven't had time to figure out yet (should be provider in META-INF/services/ which is currently deleted.
- *
- * @author Marc Savy {@literal <marc@blackparrotlabs.io>}
- */
-@Provider
-public class EagerProvider implements Extension {
-
- public void afterDeploymentValidation(@Observes AfterDeploymentValidation event, BeanManager beanManager) {
- beanManager
- .getBeans(Object.class, new AnnotationLiteral<EagerLoaded>() {})
- .parallelStream()
- .forEach(bean -> prod(bean, beanManager));
- }
-
- /**
- * Call #toString to trigger the managed bean to be initialised.
- */
- private void prod(Bean<?> bean, BeanManager beanManager) {
- beanManager.getReference(bean, bean.getBeanClass(), beanManager.createCreationalContext(bean)).toString();
- }
-}
+// package io.apiman.manager.api.providers.eager;
+//
+// import javax.enterprise.event.Observes;
+// import javax.enterprise.inject.spi.AfterDeploymentValidation;
+// import javax.enterprise.inject.spi.Bean;
+// import javax.enterprise.inject.spi.BeanManager;
+// import javax.enterprise.inject.spi.Extension;
+// import javax.enterprise.util.AnnotationLiteral;
+// import javax.ws.rs.ext.Provider;
+//
+// /**
+// * Thanks to Dan Allen <a href="https://gist.github.com/mojavelinux/635719#file-startupbeanextension-java-L19">
+// * for this trick to eager initialise</a> managed beans in CDI.
+// *
+// * todo(msavy): This has been temporarily disabled due to annoying classloader side-effects on Wildfly
+// * I haven't had time to figure out yet (should be provider in META-INF/services/ which is currently deleted.
+// *
+// * @author Marc Savy {@literal <marc@blackparrotlabs.io>}
+// */
+// @Provider
+// public class EagerProvider implements Extension {
+//
+// public void afterDeploymentValidation(@Observes AfterDeploymentValidation event, BeanManager beanManager) {
+// beanManager
+// .getBeans(Object.class, new AnnotationLiteral<EagerLoaded>() {})
+// .parallelStream()
+// .forEach(bean -> prod(bean, beanManager));
+// }
+//
+// /**
+// * Call #toString to trigger the managed bean to be initialised.
+// */
+// private void prod(Bean<?> bean, BeanManager beanManager) {
+// beanManager.getReference(bean, bean.getBeanClass(), beanManager.createCreationalContext(bean)).toString();
+// }
+// }

MODIFY
manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/ApiManagerApplication.java
manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/ApiManagerApplication.java
@@ -19,7 +19,7 @@ package io.apiman.manager.api.rest.impl;
import io.apiman.manager.api.config.Version;
import io.apiman.manager.api.exportimport.manager.ExportImportManager;
import io.apiman.manager.api.providers.JacksonObjectMapperProvider;
-import io.apiman.manager.api.providers.eager.EagerProvider;
+// import io.apiman.manager.api.providers.eager.EagerProvider;
import io.apiman.manager.api.rest.exceptions.mappers.IllegalArgumentExceptionMapper;
import io.apiman.manager.api.rest.exceptions.mappers.RestExceptionMapper;
import io.apiman.manager.api.rest.interceptors.BlobResourceInterceptorProvider;
@@ -89,8 +89,8 @@ public class ApiManagerApplication extends Application {
JacksonObjectMapperProvider.class,
BlobResourceInterceptorProvider.class,
TotalCountInterceptorProvider.class,
- RestExceptionMapper.class,
- EagerProvider.class
+ RestExceptionMapper.class
+ // EagerProvider.class
);
System.out.println("API Manager Application constructor end");

refactor: disable eager-loading provider