You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by ra...@apache.org on 2019/02/01 16:26:27 UTC
[tomee] 02/16: TOMEE-2408 - Removed all MP deployable endpoints.
Rules required to activate them.
This is an automated email from the ASF dual-hosted git repository.
radcortez pushed a commit to branch TOMEE-2408
in repository https://gitbox.apache.org/repos/asf/tomee.git
commit 1a4e4adc5d6b0785409592f8ae79548cc1bded91
Author: Roberto Cortez <ra...@yahoo.com>
AuthorDate: Fri Jan 18 17:19:40 2019 +0000
TOMEE-2408 - Removed all MP deployable endpoints. Rules required to activate them.
---
.../cdi/TomEEMicroProfileExtension.java | 24 +++++++++++-----------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/tomee/tomee-microprofile/mp-common/src/main/java/org/apache/tomee/microprofile/cdi/TomEEMicroProfileExtension.java b/tomee/tomee-microprofile/mp-common/src/main/java/org/apache/tomee/microprofile/cdi/TomEEMicroProfileExtension.java
index c3e094c..2765395 100644
--- a/tomee/tomee-microprofile/mp-common/src/main/java/org/apache/tomee/microprofile/cdi/TomEEMicroProfileExtension.java
+++ b/tomee/tomee-microprofile/mp-common/src/main/java/org/apache/tomee/microprofile/cdi/TomEEMicroProfileExtension.java
@@ -16,8 +16,10 @@
*/
package org.apache.tomee.microprofile.cdi;
-import org.apache.geronimo.microprofile.impl.health.jaxrs.HealthChecksEndpoint;
-import org.apache.geronimo.microprofile.metrics.jaxrs.MetricsEndpoints;
+import org.apache.geronimo.microprofile.common.jaxrs.HealthChecksEndpoint;
+import org.apache.geronimo.microprofile.impl.health.cdi.CdiHealthChecksEndpoint;
+import org.apache.geronimo.microprofile.metrics.common.jaxrs.MetricsEndpoints;
+import org.apache.geronimo.microprofile.metrics.jaxrs.CdiMetricsEndpoints;
import org.apache.geronimo.microprofile.openapi.jaxrs.OpenAPIEndpoint;
import org.apache.openejb.assembler.classic.AppInfo;
import org.apache.openejb.assembler.classic.WebAppInfo;
@@ -39,15 +41,10 @@ import javax.enterprise.inject.spi.BeanManager;
import javax.enterprise.inject.spi.BeforeBeanDiscovery;
import javax.enterprise.inject.spi.CDI;
import javax.enterprise.inject.spi.Extension;
-import javax.enterprise.inject.spi.Interceptor;
import javax.enterprise.inject.spi.ProcessAnnotatedType;
import javax.enterprise.inject.spi.ProcessInjectionPoint;
import javax.enterprise.inject.spi.WithAnnotations;
-import javax.enterprise.util.AnnotationLiteral;
-import java.util.List;
-
-import static javax.enterprise.inject.spi.InterceptionType.AROUND_INVOKE;
import static javax.interceptor.Interceptor.Priority.LIBRARY_BEFORE;
public class TomEEMicroProfileExtension implements Extension {
@@ -103,9 +100,11 @@ public class TomEEMicroProfileExtension implements Extension {
@Priority(BEFORE_MICROPROFILE_EXTENSIONS)
final AfterBeanDiscovery afterBeanDiscovery,
final BeanManager beanManager) {
+ /*
final List<Interceptor<?>> interceptors =
beanManager.resolveInterceptors(AROUND_INVOKE, new AnnotationLiteral<Counted>() {});
interceptors.isEmpty();
+ */
}
public boolean requiresConfig() {
@@ -156,7 +155,7 @@ public class TomEEMicroProfileExtension implements Extension {
SystemInstance.get().addObserver(new TomEEMicroProfileAfterApplicationCreated());
}
- static class TomEEMicroProfileAfterApplicationCreated {
+ public static class TomEEMicroProfileAfterApplicationCreated {
public void processApplication(
@org.apache.openejb.observer.Observes
final BeforeEvent<AssemblerAfterApplicationCreated> afterApplicationCreated) {
@@ -166,11 +165,12 @@ public class TomEEMicroProfileExtension implements Extension {
final AppInfo app = afterApplicationCreated.getEvent().getApp();
for (final WebAppInfo webApp : app.webApps) {
if (webApp.restApplications.isEmpty()) {
- if (!microProfileExtension.requiresMetrics) {
- webApp.restClass.removeIf(className -> className.equals(MetricsEndpoints.class.getName()));
- }
-
webApp.restClass.removeIf(className -> className.equals(HealthChecksEndpoint.class.getName()));
+ webApp.restClass.removeIf(className -> className.equals(CdiHealthChecksEndpoint.class.getName()));
+
+ webApp.restClass.removeIf(className -> className.equals(MetricsEndpoints.class.getName()));
+ webApp.restClass.removeIf(className -> className.equals(CdiMetricsEndpoints.class.getName()));
+
webApp.restClass.removeIf(className -> className.equals(OpenAPIEndpoint.class.getName()));
}
}