diff --git a/extensions/arc/deployment/pom.xml b/extensions/arc/deployment/pom.xml index bb95d4b482594e..750b73d9394339 100644 --- a/extensions/arc/deployment/pom.xml +++ b/extensions/arc/deployment/pom.xml @@ -21,10 +21,6 @@ io.quarkus quarkus-smallrye-context-propagation-spi - - io.quarkus - quarkus-vertx-http-dev-console-spi - io.quarkus quarkus-vertx-http-dev-ui-spi diff --git a/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/devconsole/DependencyGraph.java b/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/devconsole/DependencyGraph.java deleted file mode 100644 index 3c85d5bcb5c5a4..00000000000000 --- a/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/devconsole/DependencyGraph.java +++ /dev/null @@ -1,97 +0,0 @@ -package io.quarkus.arc.deployment.devconsole; - -import java.util.HashSet; -import java.util.Objects; -import java.util.Set; -import java.util.function.Predicate; - -public class DependencyGraph { - - public final Set nodes; - public final Set links; - public final int maxLevel; - - public DependencyGraph(Set nodes, Set links) { - this.nodes = nodes; - this.links = links; - this.maxLevel = links.stream().mapToInt(l -> l.level).max().orElse(0); - } - - DependencyGraph forLevel(int level) { - return filterLinks(link -> link.level <= level); - } - - DependencyGraph filterLinks(Predicate predicate) { - // Filter out links first - Set newLinks = new HashSet<>(); - Set newNodes = new HashSet<>(); - Set usedIds = new HashSet<>(); - for (Link link : links) { - if (predicate.test(link)) { - newLinks.add(link); - usedIds.add(link.source); - usedIds.add(link.target); - } - } - // Now keep only nodes for which a link exists... - for (DevBeanInfo node : nodes) { - if (usedIds.contains(node.getId())) { - newNodes.add(node); - } - } - return new DependencyGraph(newNodes, newLinks); - } - - public static class Link { - - static Link dependent(String source, String target, int level) { - return new Link(source, target, level == 0 ? "directDependent" : "dependency", level); - } - - static Link dependency(String source, String target, int level) { - return new Link(source, target, level == 0 ? "directDependency" : "dependency", level); - } - - static Link lookup(String source, String target, int level) { - return new Link(source, target, "lookup", level); - } - - static Link producer(String source, String target, int level) { - return new Link(source, target, "producer", level); - } - - public final String source; - public final String target; - public final String type; - public final int level; - - public Link(String source, String target, String type, int level) { - this.source = source; - this.target = target; - this.type = type; - this.level = level; - } - - @Override - public int hashCode() { - return Objects.hash(source, target); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - Link other = (Link) obj; - return Objects.equals(source, other.source) && Objects.equals(target, other.target); - } - - } - -} diff --git a/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/devui/ArcBeanInfoBuildItem.java b/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/devui/ArcBeanInfoBuildItem.java index 8f90940b1b7426..5a51ccb5f1d26c 100644 --- a/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/devui/ArcBeanInfoBuildItem.java +++ b/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/devui/ArcBeanInfoBuildItem.java @@ -1,6 +1,5 @@ package io.quarkus.arc.deployment.devui; -import io.quarkus.arc.deployment.devconsole.DevBeanInfos; import io.quarkus.builder.item.SimpleBuildItem; public final class ArcBeanInfoBuildItem extends SimpleBuildItem { diff --git a/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/devconsole/ArcDevConsoleProcessor.java b/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/devui/ArcDevModeApiProcessor.java similarity index 63% rename from extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/devconsole/ArcDevConsoleProcessor.java rename to extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/devui/ArcDevModeApiProcessor.java index 53d1a2b115c781..0c81148f2c0f7c 100644 --- a/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/devconsole/ArcDevConsoleProcessor.java +++ b/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/devui/ArcDevModeApiProcessor.java @@ -1,4 +1,4 @@ -package io.quarkus.arc.deployment.devconsole; +package io.quarkus.arc.deployment.devui; import java.util.ArrayList; import java.util.Collection; @@ -10,15 +10,8 @@ import java.util.Set; import java.util.stream.Collectors; -import io.quarkus.arc.deployment.AdditionalBeanBuildItem; -import io.quarkus.arc.deployment.AnnotationsTransformerBuildItem; -import io.quarkus.arc.deployment.ArcConfig; -import io.quarkus.arc.deployment.BeanDefiningAnnotationBuildItem; import io.quarkus.arc.deployment.CompletedApplicationClassPredicateBuildItem; -import io.quarkus.arc.deployment.CustomScopeAnnotationsBuildItem; import io.quarkus.arc.deployment.ValidationPhaseBuildItem; -import io.quarkus.arc.deployment.devconsole.DependencyGraph.Link; -import io.quarkus.arc.deployment.devui.ArcBeanInfoBuildItem; import io.quarkus.arc.processor.BeanDeploymentValidator; import io.quarkus.arc.processor.BeanDeploymentValidator.ValidationContext; import io.quarkus.arc.processor.BeanInfo; @@ -28,53 +21,16 @@ import io.quarkus.arc.processor.InjectionPointInfo; import io.quarkus.arc.processor.InterceptorInfo; import io.quarkus.arc.processor.ObserverInfo; -import io.quarkus.arc.runtime.ArcContainerSupplier; -import io.quarkus.arc.runtime.ArcRecorder; -import io.quarkus.arc.runtime.BeanLookupSupplier; -import io.quarkus.arc.runtime.devconsole.InvocationsMonitor; -import io.quarkus.arc.runtime.devmode.EventsMonitor; import io.quarkus.deployment.IsDevelopment; import io.quarkus.deployment.annotations.BuildProducer; import io.quarkus.deployment.annotations.BuildStep; -import io.quarkus.deployment.annotations.ExecutionTime; -import io.quarkus.deployment.annotations.Record; -import io.quarkus.deployment.pkg.builditem.CurateOutcomeBuildItem; import io.quarkus.dev.console.DevConsoleManager; -import io.quarkus.devconsole.spi.DevConsoleRouteBuildItem; -import io.quarkus.devconsole.spi.DevConsoleRuntimeTemplateInfoBuildItem; -import io.quarkus.devconsole.spi.DevConsoleTemplateInfoBuildItem; -import io.vertx.core.Handler; -import io.vertx.ext.web.RoutingContext; -public class ArcDevConsoleProcessor { - - @BuildStep(onlyIf = IsDevelopment.class) - @Record(ExecutionTime.STATIC_INIT) - public DevConsoleRuntimeTemplateInfoBuildItem exposeArcContainer(ArcRecorder recorder, - CurateOutcomeBuildItem curateOutcomeBuildItem) { - return new DevConsoleRuntimeTemplateInfoBuildItem("arcContainer", - new ArcContainerSupplier(), this.getClass(), curateOutcomeBuildItem); - } - - @BuildStep(onlyIf = IsDevelopment.class) - void monitor(ArcConfig config, BuildProducer runtimeInfos, - BuildProducer beans, BuildProducer annotationTransformers, - CustomScopeAnnotationsBuildItem customScopes, - List beanDefiningAnnotations, CurateOutcomeBuildItem curateOutcomeBuildItem) { - if (!config.devMode.monitoringEnabled) { - return; - } - runtimeInfos.produce( - new DevConsoleRuntimeTemplateInfoBuildItem("eventsMonitor", - new BeanLookupSupplier(EventsMonitor.class), this.getClass(), curateOutcomeBuildItem)); - runtimeInfos.produce(new DevConsoleRuntimeTemplateInfoBuildItem("invocationsMonitor", - new BeanLookupSupplier(InvocationsMonitor.class), this.getClass(), curateOutcomeBuildItem)); - } +public class ArcDevModeApiProcessor { @BuildStep(onlyIf = IsDevelopment.class) public void collectBeanInfo(ValidationPhaseBuildItem validationPhaseBuildItem, - CompletedApplicationClassPredicateBuildItem predicate, BuildProducer templates, - BuildProducer routes, + CompletedApplicationClassPredicateBuildItem predicate, BuildProducer arcBeanInfoProducer) { BeanDeploymentValidator.ValidationContext validationContext = validationPhaseBuildItem.getContext(); DevBeanInfos beanInfos = new DevBeanInfos(); @@ -137,60 +93,13 @@ public void collectBeanInfo(ValidationPhaseBuildItem validationPhaseBuildItem, .collect(Collectors.toList())); } // Set the global that could be used at runtime when generating the json payload for /q/arc/beans - DevConsoleManager.setGlobal(BEAN_DEPENDENCIES, beanDependenciesMap); + DevConsoleManager.setGlobal(DevBeanInfos.BEAN_DEPENDENCIES, beanDependenciesMap); beanInfos.sort(); - templates.produce(new DevConsoleTemplateInfoBuildItem("devBeanInfos", beanInfos)); arcBeanInfoProducer.produce(new ArcBeanInfoBuildItem(beanInfos)); - - routes.produce(new DevConsoleRouteBuildItem("toggleBeanDescription", "POST", new Handler() { - @Override - public void handle(RoutingContext context) { - Object val = DevConsoleManager.getGlobal(BEAN_DESCRIPTION); - if (val != null && val.equals("simple")) { - val = "full"; - } else { - val = "simple"; - } - DevConsoleManager.setGlobal(BEAN_DESCRIPTION, val); - context.response() - .putHeader("location", "beanDependencyGraph?beanId=" + context.request().getParam("beanId")) - .setStatusCode(302).end(); - } - })); - - routes.produce(new DevConsoleRouteBuildItem("setMaxDependencyLevel", "POST", new Handler() { - @Override - public void handle(RoutingContext context) { - context.request().setExpectMultipart(true); - context.request().endHandler(new Handler() { - @Override - public void handle(Void ignore) { - Integer val = null; - try { - val = Integer.parseInt(context.request().getFormAttribute("maxDepLevel")); - } catch (NumberFormatException ignored) { - } - if (val != null) { - DevConsoleManager.setGlobal(MAX_DEPENDENCY_LEVEL, val); - } - context.response() - .putHeader("location", "beanDependencyGraph?beanId=" + context.request().getParam("beanId")) - .setStatusCode(302).end(); - } - }); - - } - })); } - static final String BEAN_DESCRIPTION = "io.quarkus.arc.beanDescription"; - static final String MAX_DEPENDENCY_LEVEL = "io.quarkus.arc.maxDependencyLevel"; - public static final String BEAN_DEPENDENCIES = "io.quarkus.arc.beanDependencies"; - - static final int DEFAULT_MAX_DEPENDENCY_LEVEL = 10; - DependencyGraph buildDependencyGraph(BeanInfo bean, ValidationContext validationContext, BeanResolver resolver, DevBeanInfos devBeanInfos, List allInjectionPoints, Map> declaringToProducers, @@ -203,7 +112,7 @@ DependencyGraph buildDependencyGraph(BeanInfo bean, ValidationContext validation return new DependencyGraph(nodes, links); } - void addNodesDependencies(int level, BeanInfo root, Set nodes, Set links, BeanInfo bean, + private void addNodesDependencies(int level, BeanInfo root, Set nodes, Set links, BeanInfo bean, DevBeanInfos devBeanInfos) { if (nodes.add(devBeanInfos.getBean(bean.getIdentifier()))) { if (bean.isProducerField() || bean.isProducerMethod()) { @@ -221,7 +130,7 @@ void addNodesDependencies(int level, BeanInfo root, Set nodes, Set< } } - void addNodesDependents(int level, BeanInfo root, Set nodes, Set links, BeanInfo bean, + private void addNodesDependents(int level, BeanInfo root, Set nodes, Set links, BeanInfo bean, List injectionPoints, Map> declaringToProducers, BeanResolver resolver, DevBeanInfos devBeanInfos, Map> directDependents) { List direct = directDependents.get(bean); diff --git a/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/devui/ArcDevUIProcessor.java b/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/devui/ArcDevUIProcessor.java index 6ce64502afe599..fe0b50353eb3e5 100644 --- a/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/devui/ArcDevUIProcessor.java +++ b/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/devui/ArcDevUIProcessor.java @@ -12,11 +12,6 @@ import io.quarkus.arc.deployment.ArcConfig; import io.quarkus.arc.deployment.BeanDefiningAnnotationBuildItem; import io.quarkus.arc.deployment.CustomScopeAnnotationsBuildItem; -import io.quarkus.arc.deployment.devconsole.DevBeanInfo; -import io.quarkus.arc.deployment.devconsole.DevBeanInfos; -import io.quarkus.arc.deployment.devconsole.DevDecoratorInfo; -import io.quarkus.arc.deployment.devconsole.DevInterceptorInfo; -import io.quarkus.arc.deployment.devconsole.DevObserverInfo; import io.quarkus.arc.processor.AnnotationsTransformer; import io.quarkus.arc.runtime.devconsole.InvocationInterceptor; import io.quarkus.arc.runtime.devconsole.InvocationTree; diff --git a/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/devui/DependencyGraph.java b/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/devui/DependencyGraph.java new file mode 100644 index 00000000000000..b5d706953a2f89 --- /dev/null +++ b/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/devui/DependencyGraph.java @@ -0,0 +1,44 @@ +package io.quarkus.arc.deployment.devui; + +import java.util.HashSet; +import java.util.Set; +import java.util.function.Predicate; + +public class DependencyGraph { + + public final Set nodes; + public final Set links; + public final int maxLevel; + + public DependencyGraph(Set nodes, Set links) { + this.nodes = nodes; + this.links = links; + this.maxLevel = links.stream().mapToInt(l -> l.level).max().orElse(0); + } + + DependencyGraph forLevel(int level) { + return filterLinks(link -> link.level <= level); + } + + DependencyGraph filterLinks(Predicate predicate) { + // Filter out links first + Set newLinks = new HashSet<>(); + Set newNodes = new HashSet<>(); + Set usedIds = new HashSet<>(); + for (Link link : links) { + if (predicate.test(link)) { + newLinks.add(link); + usedIds.add(link.source); + usedIds.add(link.target); + } + } + // Now keep only nodes for which a link exists... + for (DevBeanInfo node : nodes) { + if (usedIds.contains(node.getId())) { + newNodes.add(node); + } + } + return new DependencyGraph(newNodes, newLinks); + } + +} diff --git a/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/devconsole/DevBeanInfo.java b/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/devui/DevBeanInfo.java similarity index 99% rename from extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/devconsole/DevBeanInfo.java rename to extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/devui/DevBeanInfo.java index 7ff0417790d2ed..ff367d475dbde1 100644 --- a/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/devconsole/DevBeanInfo.java +++ b/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/devui/DevBeanInfo.java @@ -1,4 +1,4 @@ -package io.quarkus.arc.deployment.devconsole; +package io.quarkus.arc.deployment.devui; import java.util.ArrayList; import java.util.HashSet; diff --git a/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/devconsole/DevBeanInfos.java b/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/devui/DevBeanInfos.java similarity index 84% rename from extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/devconsole/DevBeanInfos.java rename to extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/devui/DevBeanInfos.java index 30105109899a7b..3edf0324010e51 100644 --- a/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/devconsole/DevBeanInfos.java +++ b/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/devui/DevBeanInfos.java @@ -1,4 +1,4 @@ -package io.quarkus.arc.deployment.devconsole; +package io.quarkus.arc.deployment.devui; import java.util.ArrayList; import java.util.Collections; @@ -63,12 +63,12 @@ public Map getDependencyGraphs() { } public String getBeanDescription() { - return DevConsoleManager.getGlobal(ArcDevConsoleProcessor.BEAN_DESCRIPTION); + return DevConsoleManager.getGlobal(BEAN_DESCRIPTION); } public int getMaxDependencyLevel() { - Integer val = DevConsoleManager.getGlobal(ArcDevConsoleProcessor.MAX_DEPENDENCY_LEVEL); - return val != null ? val : ArcDevConsoleProcessor.DEFAULT_MAX_DEPENDENCY_LEVEL; + Integer val = DevConsoleManager.getGlobal(MAX_DEPENDENCY_LEVEL); + return val != null ? val : DEFAULT_MAX_DEPENDENCY_LEVEL; } public DevBeanInfo getBean(String id) { @@ -90,9 +90,9 @@ public DevInterceptorInfo getInterceptor(String id) { } public DependencyGraph getDependencyGraph(String beanId) { - Integer maxLevel = DevConsoleManager.getGlobal(ArcDevConsoleProcessor.MAX_DEPENDENCY_LEVEL); + Integer maxLevel = DevConsoleManager.getGlobal(MAX_DEPENDENCY_LEVEL); if (maxLevel == null) { - maxLevel = ArcDevConsoleProcessor.DEFAULT_MAX_DEPENDENCY_LEVEL; + maxLevel = DEFAULT_MAX_DEPENDENCY_LEVEL; } DependencyGraph graph = dependencyGraphs.get(beanId); return graph.maxLevel <= maxLevel ? graph : graph.forLevel(maxLevel); @@ -143,4 +143,9 @@ void sort() { Collections.sort(removedDecorators); Collections.sort(removedInterceptors); } + + static final String BEAN_DESCRIPTION = "io.quarkus.arc.beanDescription"; + static final String MAX_DEPENDENCY_LEVEL = "io.quarkus.arc.maxDependencyLevel"; + public static final String BEAN_DEPENDENCIES = "io.quarkus.arc.beanDependencies"; + static final int DEFAULT_MAX_DEPENDENCY_LEVEL = 10; } diff --git a/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/devconsole/DevBeanKind.java b/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/devui/DevBeanKind.java similarity index 62% rename from extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/devconsole/DevBeanKind.java rename to extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/devui/DevBeanKind.java index e87ac408df65d1..f0a0b02060f3de 100644 --- a/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/devconsole/DevBeanKind.java +++ b/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/devui/DevBeanKind.java @@ -1,4 +1,4 @@ -package io.quarkus.arc.deployment.devconsole; +package io.quarkus.arc.deployment.devui; public enum DevBeanKind { METHOD, diff --git a/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/devui/DevBeanWithInterceptorInfo.java b/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/devui/DevBeanWithInterceptorInfo.java index 80e21d19453a89..850b47b70d32c7 100644 --- a/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/devui/DevBeanWithInterceptorInfo.java +++ b/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/devui/DevBeanWithInterceptorInfo.java @@ -3,10 +3,6 @@ import java.util.ArrayList; import java.util.List; -import io.quarkus.arc.deployment.devconsole.DevBeanInfo; -import io.quarkus.arc.deployment.devconsole.DevBeanInfos; -import io.quarkus.arc.deployment.devconsole.DevInterceptorInfo; - public class DevBeanWithInterceptorInfo extends DevBeanInfo { private final List interceptorInfos = new ArrayList<>(); diff --git a/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/devconsole/DevDecoratorInfo.java b/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/devui/DevDecoratorInfo.java similarity index 98% rename from extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/devconsole/DevDecoratorInfo.java rename to extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/devui/DevDecoratorInfo.java index 6f55650ab87499..9e20a8ce74e49e 100644 --- a/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/devconsole/DevDecoratorInfo.java +++ b/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/devui/DevDecoratorInfo.java @@ -1,4 +1,4 @@ -package io.quarkus.arc.deployment.devconsole; +package io.quarkus.arc.deployment.devui; import java.util.HashSet; import java.util.Set; diff --git a/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/devconsole/DevInterceptorInfo.java b/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/devui/DevInterceptorInfo.java similarity index 98% rename from extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/devconsole/DevInterceptorInfo.java rename to extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/devui/DevInterceptorInfo.java index 1322965d7693d4..bc44c69ddb9e0e 100644 --- a/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/devconsole/DevInterceptorInfo.java +++ b/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/devui/DevInterceptorInfo.java @@ -1,4 +1,4 @@ -package io.quarkus.arc.deployment.devconsole; +package io.quarkus.arc.deployment.devui; import java.util.HashMap; import java.util.HashSet; diff --git a/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/devconsole/DevObserverInfo.java b/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/devui/DevObserverInfo.java similarity index 98% rename from extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/devconsole/DevObserverInfo.java rename to extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/devui/DevObserverInfo.java index c24383d931a0e6..77190db2103a96 100644 --- a/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/devconsole/DevObserverInfo.java +++ b/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/devui/DevObserverInfo.java @@ -1,4 +1,4 @@ -package io.quarkus.arc.deployment.devconsole; +package io.quarkus.arc.deployment.devui; import java.util.Collections; import java.util.List; diff --git a/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/devui/Link.java b/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/devui/Link.java new file mode 100644 index 00000000000000..b3ab550805cdf2 --- /dev/null +++ b/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/devui/Link.java @@ -0,0 +1,53 @@ +package io.quarkus.arc.deployment.devui; + +import java.util.Objects; + +public class Link { + static Link dependent(String source, String target, int level) { + return new Link(source, target, level == 0 ? "directDependent" : "dependency", level); + } + + static Link dependency(String source, String target, int level) { + return new Link(source, target, level == 0 ? "directDependency" : "dependency", level); + } + + static Link lookup(String source, String target, int level) { + return new Link(source, target, "lookup", level); + } + + static Link producer(String source, String target, int level) { + return new Link(source, target, "producer", level); + } + + public final String source; + public final String target; + public final String type; + public final int level; + + public Link(String source, String target, String type, int level) { + this.source = source; + this.target = target; + this.type = type; + this.level = level; + } + + @Override + public int hashCode() { + return Objects.hash(source, target); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + Link other = (Link) obj; + return Objects.equals(source, other.source) && Objects.equals(target, other.target); + } +} diff --git a/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/devconsole/Name.java b/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/devui/Name.java similarity index 98% rename from extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/devconsole/Name.java rename to extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/devui/Name.java index a014b59a2f594f..98441b3b2f1dd7 100644 --- a/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/devconsole/Name.java +++ b/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/devui/Name.java @@ -1,4 +1,4 @@ -package io.quarkus.arc.deployment.devconsole; +package io.quarkus.arc.deployment.devui; import java.util.Iterator; import java.util.List; diff --git a/extensions/arc/deployment/src/main/resources/dev-templates/beanDependencyGraph.html b/extensions/arc/deployment/src/main/resources/dev-templates/beanDependencyGraph.html deleted file mode 100644 index 0be4624dcb02e4..00000000000000 --- a/extensions/arc/deployment/src/main/resources/dev-templates/beanDependencyGraph.html +++ /dev/null @@ -1,213 +0,0 @@ -{#include main fluid=true} - - {#script} - // Bean dependency graph built with d3.js - // Based on https://observablehq.com/@d3/mobile-patent-suits - - const nodes = [ - {#each info:devBeanInfos.getDependencyGraph(currentRequest.getParam('beanId')).nodes} - { id:"{it.id}", kind:"{it.kind}", description:"{#if info:devBeanInfos.beanDescription ne "simple"}{it.description}{#else}{it.simpleDescription}{/if}", root:{#if it.id == currentRequest.getParam('beanId')}true{#else}false{/if} }, - {/each} - ]; - const links = [ - {#each info:devBeanInfos.getDependencyGraph(currentRequest.getParam('beanId')).links} - { source:"{it.source}", target:"{it.target}", type:"{it.type}" }, - {/each} - ]; - - const beanId = "{currentRequest.getParam('beanId')}"; - const chartContainer = document.getElementById('beanDepGraph_container'); - - {| - const types = ['directDependency','directDependent','dependency','lookup','producer']; - const width = chartContainer.clientWidth; - const height = chartContainer.clientHeight; - const color = d3.scaleOrdinal(types, d3.schemeCategory10); - - // Legend colors - const legendDirectDependency = document.querySelector(".legend-direct-dependency"); - legendDirectDependency.style.color = color('directDependency'); - const legendDirectDependent = document.querySelector(".legend-direct-dependent"); - legendDirectDependent.style.color = color('directDependent'); - const legendDependency = document.querySelector(".legend-dependency"); - legendDependency.style.color = color('dependency'); - const legendLookup = document.querySelector(".legend-lookup"); - legendLookup.style.color = color('lookup'); - const legendProducer = document.querySelector(".legend-producer"); - legendProducer.style.color = color('producer'); - - function linkArc(d) { - const r = Math.hypot(d.target.x - d.source.x, d.target.y - d.source.y); - return ` - M${d.source.x},${d.source.y} - A${r},${r} 0 0,1 ${d.target.x},${d.target.y} - `; - } - - const simulation = d3.forceSimulation(nodes) - .force("link", d3.forceLink(links).id(d => d.id).distance(function(d) { - return d.source.id === beanId || d.target.id === beanId ? 150 : 75; - })) - .force("charge", d3.forceManyBody().strength(-400)) - .force("center", d3.forceCenter(width / 3, height / 2)) - .force("x", d3.forceX()) - .force("y", d3.forceY()); - - function dragstart(event, d){ - // this line is needed, otherwise the simulation stops after few seconds - if (!event.active) simulation.alphaTarget(0.3).restart(); - d.fx = d.x; - d.fy = d.y; - }; - - function dragged(event, d) { - d.fx = event.x; - d.fy = event.y; - } - - function dragended(event, d) { - d.fx = event.x; - d.fy = event.y; - } - - let onZoom = function (e) { - d3.select('svg g').attr('transform', e.transform); - } - - const d3Zoom = d3.zoom() - .scaleExtent([0, 1]) - .on("zoom", onZoom); - - const svg = d3.select("#beanDepGraph_area") - .attr("preserveAspectRatio", "xMinYMin meet") - .attr("viewBox", [0, 0, width, height]) - .style("font", "1rem sans-serif") - .call(d3Zoom) - .append("g"); - - d3.select("#zoom_in").on("click", function() { - d3Zoom.scaleBy(svg.transition().duration(750), 1.2); - }); - d3.select("#zoom_out").on("click", function() { - d3Zoom.scaleBy(svg.transition().duration(750), 0.8); - }); - - svg.append("defs").selectAll("marker") - .data(types) - .join("marker") - .attr("id", d => `arrow-${d}`) - .attr("viewBox", "0 -5 10 10") - .attr("refX", 15) - .attr("refY", -0.5) - .attr("markerWidth", 6) - .attr("markerHeight", 6) - .attr("orient", "auto") - .append("path") - .attr("fill", color) - .attr("d", "M0,-5L10,0L0,5"); - - const link = svg.append("g") - .attr("fill", "none") - .attr("stroke-width", 1.5) - .selectAll("path") - .data(links) - .join("path") - .attr("stroke", d => color(d.type)) - .attr("marker-end", d => `url(${new URL(`#arrow-${d.type}`, location)})`); - - const node = svg.append("g") - .attr("fill", "currentColor") - .attr("stroke-linecap", "round") - .attr("stroke-linejoin", "round") - .selectAll("g") - .data(nodes) - .join("g") - .call(d3.drag().on("drag", dragged).on("end", dragended).on("start", dragstart)); - - node.append("circle") - .attr("stroke", "white") - .attr("stroke-width", 1) - .attr("r", 5) - .style("fill", d => d.root ? "red" : "black"); - - node.append("a") - .attr("xlink:href", d => "beanDependencyGraph?beanId=" + d.id) - .append("svg:text") - .attr("x", 8) - .attr("y", "0.31em") - .style("fill", "#1f77b4") - .text(d => d.description); - - simulation.on("tick", () => { - link.attr("d", linkArc); - node.attr("transform", d => `translate(${d.x},${d.y})`); - }); - - |} - {/script} - {#style} - #beanDepGraph_container { - min-height: 800px; - } - {/style} - {#breadcrumbs} Beans{/breadcrumbs} - {#title}Bean Dependency Graph{/title} - {#body} - {#let bean=info:devBeanInfos.getBean(currentRequest.getParam('beanId'))} - - -
-
- {bean.description} -
-
-
-
-
    -
  • root
  • -
  • direct dependencies
  • -
  • direct dependents
  • -
  • dependencies
  • -
  • declaring bean of a producer
  • -
  • potential dependency
     programmatic lookup
  • -
  • -
    - - -
    -
  • -
  • -
    -
    - - -
    -
    -
  • -
  • -
    - - - Value 0 means only direct dependencies -
    -
  • -
-
-
-
- -
-
-
- - {/let} - {/body} - - {#scriptref} - - {/scriptref} -{/include} diff --git a/extensions/arc/deployment/src/main/resources/dev-templates/beans.html b/extensions/arc/deployment/src/main/resources/dev-templates/beans.html deleted file mode 100644 index b556d539b4a983..00000000000000 --- a/extensions/arc/deployment/src/main/resources/dev-templates/beans.html +++ /dev/null @@ -1,82 +0,0 @@ -{#include main fluid=true} - {#style} - .annotation { - color: gray; - font-style: italic; - } - span.larger-badge { - font-size: 0.9em; - } - span.app-class { - cursor:pointer; - color:blue; - text-decoration:underline; - } - - {/style} - - {#script} - $(document).ready(function(){ - if (!ideKnown()) { - return; - } - $(".class-candidate").each(function() { - var className = $(this).text(); - if (appClassLocation(className)) { - $(this).addClass("app-class"); - } - }); - - $(".app-class").on("click", function() { - openInIDE($(this).text()); - }); - }); - {/script} - - {#title}Beans{/title} - {#body} - - - - - - - - - - - - - {#for bean in info:devBeanInfos.beans} - - - - - - - {/for} - -
#BeanKindAssociated InterceptorsActions
{bean_count} - {#display-bean bean/} - - {#bean-declaration bean/} - -
    - {#for interceptorId in bean.interceptors} - {#set interceptor=info:devBeanInfos.getInterceptor(interceptorId)} -
  • {interceptor.interceptorClass} {interceptor.priority}
  • - {/set} - {/for} -
-
- {#if !info:devBeanInfos.getDependencyGraph(bean.id).links.empty} - - {/if} -
- {/body} -{/include} diff --git a/extensions/arc/deployment/src/main/resources/dev-templates/decorators.html b/extensions/arc/deployment/src/main/resources/dev-templates/decorators.html deleted file mode 100644 index c1aae4d423337b..00000000000000 --- a/extensions/arc/deployment/src/main/resources/dev-templates/decorators.html +++ /dev/null @@ -1,70 +0,0 @@ -{#include main fluid=true} - {#style} - .annotation { - color: gray; - font-style: italic; - } - span.larger-badge { - font-size: 0.9em; - } - span.app-class { - cursor:pointer; - color:blue; - text-decoration:underline; - } - {/style} - - {#script} - $(document).ready(function(){ - if (!ideKnown()) { - return; - } - $(".class-candidate").each(function() { - var className = $(this).text(); - if (appClassLocation(className)) { - $(this).addClass("app-class"); - } - }); - - $(".app-class").on("click", function() { - openInIDE($(this).text()); - }); - }); - - {/script} - - {#title}Decorators{/title} - {#body} - - - - - - - - - - - - - {#for decorator in info:devBeanInfos.decorators} - - - - - - - {/for} - -
#Decorator classPriorityDelegate TypeDelegate Qualifiers
{decorator_count}.{decorator.decoratorClass}{decorator.priority}{decorator.delegateType} - {#for q in decorator.delegateQualifiers} - {q.simpleName}
- {/for} -
- {/body} -{/include} diff --git a/extensions/arc/deployment/src/main/resources/dev-templates/embedded.html b/extensions/arc/deployment/src/main/resources/dev-templates/embedded.html deleted file mode 100644 index 58b311cc647da6..00000000000000 --- a/extensions/arc/deployment/src/main/resources/dev-templates/embedded.html +++ /dev/null @@ -1,31 +0,0 @@ - - - Beans {info:devBeanInfos.beans.size} -
- - - Observers {info:devBeanInfos.observers.size} -
- - - Interceptors {info:devBeanInfos.interceptors.size} -
-{#if !info:devBeanInfos.decorators.empty} - - - Decorators {info:devBeanInfos.decorators.size} -
-{/if} -{#if config:property('quarkus.arc.dev-mode.monitoring-enabled') is "true"} - - - Fired Events -
- - - Invocation Trees -
-{/if} - - - Removed Components {info:devBeanInfos.removedComponents} \ No newline at end of file diff --git a/extensions/arc/deployment/src/main/resources/dev-templates/events.html b/extensions/arc/deployment/src/main/resources/dev-templates/events.html deleted file mode 100644 index e7d62ddc3fda18..00000000000000 --- a/extensions/arc/deployment/src/main/resources/dev-templates/events.html +++ /dev/null @@ -1,63 +0,0 @@ -{#include main fluid=true} - {#style} - .nav-item { - padding: .5rem .3rem; - } - {/style} - {#title}Fired Events{/title} - {#body} - - - - - - - - - - - {#for event in info:eventsMonitor.lastEvents.orEmpty} - - - - - - {/for} - -
Timestamp Event TypeQualifiers
- {event.timestamp} - - {event.type} - - {#when event.qualifiers.size} - {#is 1} - {event.qualifiers.iterator.next} - {#is > 1} -
    - {#for q in event.qualifiers} -
  • {q}
  • - {/for} -
- {/when} -
- {/body} -{/include} diff --git a/extensions/arc/deployment/src/main/resources/dev-templates/interceptors.html b/extensions/arc/deployment/src/main/resources/dev-templates/interceptors.html deleted file mode 100644 index d4186ed87c8e35..00000000000000 --- a/extensions/arc/deployment/src/main/resources/dev-templates/interceptors.html +++ /dev/null @@ -1,76 +0,0 @@ -{#include main fluid=true} - {#style} - .annotation { - color: gray; - font-style: italic; - } - span.larger-badge { - font-size: 0.9em; - } - span.app-class { - cursor:pointer; - color:blue; - text-decoration:underline; - } - {/style} - - {#script} - $(document).ready(function(){ - if (!ideKnown()) { - return; - } - $(".class-candidate").each(function() { - var className = $(this).text(); - if (appClassLocation(className)) { - $(this).addClass("app-class"); - } - }); - - $(".app-class").on("click", function() { - openInIDE($(this).text()); - }); - }); - - {/script} - - {#title}Interceptors{/title} - {#body} - - - - - - - - - - - - - {#for interceptor in info:devBeanInfos.interceptors} - - - - - - - {/for} - -
#Interceptor ClassPriorityBindingsInterception Types
{interceptor_count}.{interceptor.interceptorClass}{interceptor.priority} - {#for b in interceptor.bindings} - {b.simpleName}
- {/for} -
-
    - {#each interceptor.intercepts} -
  • {#interception-type it.key /} {interceptor.interceptorClass.simpleName}#{it.value.name}()
  • - {/each} -
-
- {/body} -{/include} diff --git a/extensions/arc/deployment/src/main/resources/dev-templates/invocations.html b/extensions/arc/deployment/src/main/resources/dev-templates/invocations.html deleted file mode 100644 index 69f7a8c6190c4b..00000000000000 --- a/extensions/arc/deployment/src/main/resources/dev-templates/invocations.html +++ /dev/null @@ -1,91 +0,0 @@ -{#include main fluid=true} - {#style} - .nav-item { - padding: .5rem .3rem; - } - ul#tree, ul.nested { - list-style-type: none; - } - #tree { - margin: 0; - padding: 0; - } - span.caret { - cursor: pointer; - user-select: none; - } - span.caret::before { - content: "\229E"; - color: black; - display: inline-block; - margin-right: 6px; - } - span.caret-down::before { - content: "\229F" - /*transform: rotate(90deg);*/ - } - ul.nested { - display: none; - } - ul.active { - display: block; - } - ul code { - color: #343a40; - } - ul li { - margin-top: 5px; - } - span.declaring-class { - color: gray; - } - {/style} - {#script} - var carets = document.getElementsByClassName("caret"); - for (i = 0; i < carets.length; i++) { - carets[i].addEventListener("click", function() { - this.parentElement.querySelector(".nested").classList.toggle("active"); - this.classList.toggle("caret-down"); - }); - } - {/script} - {#title}Invocation Trees{/title} - {#body} - - - - - - - - - - {#each info:invocationsMonitor.filteredLastInvocations.orEmpty} - - - - - {/each} - -
Start Invocations
{it.startFormatted}
    {#tree it root=true /}
- {/body} -{/include} diff --git a/extensions/arc/deployment/src/main/resources/dev-templates/observers.html b/extensions/arc/deployment/src/main/resources/dev-templates/observers.html deleted file mode 100644 index 44de75f20d0a3f..00000000000000 --- a/extensions/arc/deployment/src/main/resources/dev-templates/observers.html +++ /dev/null @@ -1,74 +0,0 @@ -{#include main fluid=true} - {#style} - .annotation { - color: gray; - font-style: italic; - } - span.larger-badge { - font-size: 0.9em; - } - {/style} - {#script} - $(document).ready(function(){ - if (!ideKnown()) { - return; - } - $(".class-candidate").each(function() { - var className = $(this).text(); - if (appClassLocation(className)) { - $(this).addClass("app-class"); - } - }); - - $(".app-class").on("click", function() { - openInIDE($(this).text()); - }); - }); - {/script} - {#title}Observers{/title} - {#body} - - - - - - - - - - - - - - {#for observer in info:devBeanInfos.observers} - - - - - - - - - - {/for} - -
#SourceObserved Type/QualifiersPriorityReceptionTransaction PhaseAsync
{observer_count}. - {#if observer.declaringClass} - {observer.declaringClass}#{observer.methodName}() - {#else} - Synthetic - {/if} - - {#each observer.qualifiers} - {it.simpleName} - {/each} - {observer.observedType} - {observer.priority} - {observer.reception} - - {observer.transactionPhase} - - {observer.async} -
- {/body} -{/include} diff --git a/extensions/arc/deployment/src/main/resources/dev-templates/removed-beans.html b/extensions/arc/deployment/src/main/resources/dev-templates/removed-beans.html deleted file mode 100644 index e16223aa68598a..00000000000000 --- a/extensions/arc/deployment/src/main/resources/dev-templates/removed-beans.html +++ /dev/null @@ -1,92 +0,0 @@ -{#include main} - {#style} - .annotation { - color: gray; - font-style: italic; - } - span.larger-badge { - font-size: 0.9em; - } - {/style} - {#title}Removed Components{/title} - {#body} - - - - - - - - - - - {#for bean in info:devBeanInfos.removedBeans} - - - - - {/for} - -
Removed Beans
#BeanKind
{bean_count}. - {#display-bean bean/} - - {#bean-declaration bean/} -
- - {#if !info:devBeanInfos.removedInterceptors.empty} - - - - - - - - - - - {#for interceptor in info:devBeanInfos.removedInterceptors} - - - - - {/for} - -
Removed Interceptors
#InterceptorBindings
{interceptor_count}. - {interceptor.interceptorClass} - - {#for b in interceptor.bindings} - {b.simpleName}
- {/for} -
- {/if} - - {#if !info:devBeanInfos.removedDecorators.empty} - - - - - - - - - - - {#for decorator in info:devBeanInfos.removedDecorators} - - - - - {/for} - -
Removed Decorators
#DecoratorDelegate
{decorator_count}. - {decorator.decoratorClass} - - {#for q in decorator.delegateQualifiers} - {q.simpleName}
- {/for} - {decorator.delegateType} -
- {/if} - - {/body} -{/include} diff --git a/extensions/arc/deployment/src/main/resources/dev-templates/tags/bean-declaration.html b/extensions/arc/deployment/src/main/resources/dev-templates/tags/bean-declaration.html deleted file mode 100644 index 473affc152f1b9..00000000000000 --- a/extensions/arc/deployment/src/main/resources/dev-templates/tags/bean-declaration.html +++ /dev/null @@ -1,10 +0,0 @@ -{#switch it.kind} - {#case METHOD} - Producer method
{it.declaringClass.simpleName}.{it.memberName}() - {#case FIELD} - Producer field
{it.declaringClass.simpleName}.{it.memberName} - {#case CLASS} - Class - {#else} - Synthetic -{/switch} \ No newline at end of file diff --git a/extensions/arc/deployment/src/main/resources/dev-templates/tags/display-bean.html b/extensions/arc/deployment/src/main/resources/dev-templates/tags/display-bean.html deleted file mode 100644 index bc864d1bc26c45..00000000000000 --- a/extensions/arc/deployment/src/main/resources/dev-templates/tags/display-bean.html +++ /dev/null @@ -1,5 +0,0 @@ -@{it.scope.simpleName}
-{#for q in it.nonDefaultQualifiers} -{q.simpleName}
-{/for} -{#if it.providerType.toString.length > 70}{it.providerType.toString.substring(0,70)}...{#else}{it.providerType}{/if} diff --git a/extensions/arc/deployment/src/main/resources/dev-templates/tags/duration.html b/extensions/arc/deployment/src/main/resources/dev-templates/tags/duration.html deleted file mode 100644 index adb73e72277ab8..00000000000000 --- a/extensions/arc/deployment/src/main/resources/dev-templates/tags/duration.html +++ /dev/null @@ -1,3 +0,0 @@ - - {#if it.durationMillis > 0}{it.durationMillis} ms{#else}< 1 ms{/if} - \ No newline at end of file diff --git a/extensions/arc/deployment/src/main/resources/dev-templates/tags/interception-type.html b/extensions/arc/deployment/src/main/resources/dev-templates/tags/interception-type.html deleted file mode 100644 index cb86a9ea15499a..00000000000000 --- a/extensions/arc/deployment/src/main/resources/dev-templates/tags/interception-type.html +++ /dev/null @@ -1,10 +0,0 @@ -{#switch it} - {#case AROUND_INVOKE} - @AroundInvoke - {#case AROUND_CONSTRUCT} - @AroundConstruct - {#case POST_CONSTRUCT} - @PostConstruct - {#case PRE_DESTROY} - @PreDestroy -{/switch} \ No newline at end of file diff --git a/extensions/arc/deployment/src/main/resources/dev-templates/tags/kind.html b/extensions/arc/deployment/src/main/resources/dev-templates/tags/kind.html deleted file mode 100644 index 078a39546f5be5..00000000000000 --- a/extensions/arc/deployment/src/main/resources/dev-templates/tags/kind.html +++ /dev/null @@ -1,8 +0,0 @@ -{#when it.kind} - {#is PRODUCER} -Producer - {#is DISPOSER} -Disposer - {#is OBSERVER} -Observer -{/when} \ No newline at end of file diff --git a/extensions/arc/deployment/src/main/resources/dev-templates/tags/tree.html b/extensions/arc/deployment/src/main/resources/dev-templates/tags/tree.html deleted file mode 100644 index 10cf07b38f528c..00000000000000 --- a/extensions/arc/deployment/src/main/resources/dev-templates/tags/tree.html +++ /dev/null @@ -1,15 +0,0 @@ -
  • -{#if !root} -{#if next}├─{#else}└─{/if} -{/if} -{#if it.children} -{it.declaringClassName}#{it.method.name}() {#duration it /} {#kind it /}{#if it.message != null} Error{/if} -
      -{#each it.children} -{#tree it root=false next=it_hasNext /} -{/each} -
    -{#else} -{it.declaringClassName}#{it.method.name}() {#duration it /} {#kind it /}{#if it.message != null} Error{/if} -{/if} -
  • \ No newline at end of file diff --git a/extensions/arc/deployment/src/test/java/io/quarkus/arc/test/devconsole/DevObserverInfoTest.java b/extensions/arc/deployment/src/test/java/io/quarkus/arc/test/devconsole/DevObserverInfoTest.java index 9bd7c3c57fabc2..aa2d666e5bcb13 100644 --- a/extensions/arc/deployment/src/test/java/io/quarkus/arc/test/devconsole/DevObserverInfoTest.java +++ b/extensions/arc/deployment/src/test/java/io/quarkus/arc/test/devconsole/DevObserverInfoTest.java @@ -12,8 +12,8 @@ import org.junit.jupiter.api.Test; -import io.quarkus.arc.deployment.devconsole.DevObserverInfo; -import io.quarkus.arc.deployment.devconsole.Name; +import io.quarkus.arc.deployment.devui.DevObserverInfo; +import io.quarkus.arc.deployment.devui.Name; public class DevObserverInfoTest { diff --git a/extensions/arc/deployment/src/test/java/io/quarkus/arc/test/devconsole/NameTest.java b/extensions/arc/deployment/src/test/java/io/quarkus/arc/test/devconsole/NameTest.java index dba9292e95acc5..8ad6c9d1bef365 100644 --- a/extensions/arc/deployment/src/test/java/io/quarkus/arc/test/devconsole/NameTest.java +++ b/extensions/arc/deployment/src/test/java/io/quarkus/arc/test/devconsole/NameTest.java @@ -12,7 +12,7 @@ import org.jboss.jandex.Type.Kind; import org.junit.jupiter.api.Test; -import io.quarkus.arc.deployment.devconsole.Name; +import io.quarkus.arc.deployment.devui.Name; public class NameTest { diff --git a/extensions/vertx-http/deployment/src/main/java/io/quarkus/vertx/http/deployment/devmode/ArcDevProcessor.java b/extensions/vertx-http/deployment/src/main/java/io/quarkus/vertx/http/deployment/devmode/ArcDevProcessor.java index a47bf5c86501e5..634049b405b915 100644 --- a/extensions/vertx-http/deployment/src/main/java/io/quarkus/vertx/http/deployment/devmode/ArcDevProcessor.java +++ b/extensions/vertx-http/deployment/src/main/java/io/quarkus/vertx/http/deployment/devmode/ArcDevProcessor.java @@ -11,7 +11,7 @@ import io.quarkus.arc.deployment.ArcConfig; import io.quarkus.arc.deployment.ValidationPhaseBuildItem; import io.quarkus.arc.deployment.ValidationPhaseBuildItem.ValidationErrorBuildItem; -import io.quarkus.arc.deployment.devconsole.ArcDevConsoleProcessor; +import io.quarkus.arc.deployment.devui.ArcDevModeApiProcessor; import io.quarkus.arc.processor.BeanInfo; import io.quarkus.arc.processor.BuildExtension; import io.quarkus.arc.processor.DecoratorInfo; @@ -72,7 +72,7 @@ void registerRoutes(ArcConfig arcConfig, ArcDevRecorder recorder, routes.produce(nonApplicationRootPathBuildItem.routeBuilder() .route(beansPath) .displayOnNotFoundPage("Active CDI Beans") - .handler(recorder.createBeansHandler(ArcDevConsoleProcessor.BEAN_DEPENDENCIES)).build()); + .handler(recorder.createBeansHandler(ArcDevModeApiProcessor.BEAN_DEPENDENCIES)).build()); routes.produce(nonApplicationRootPathBuildItem.routeBuilder() .route(removedBeansPath) diff --git a/integration-tests/devmode/src/test/java/io/quarkus/test/devconsole/DevConsoleArcSmokeTest.java b/integration-tests/devmode/src/test/java/io/quarkus/test/devconsole/DevConsoleArcSmokeTest.java deleted file mode 100644 index b2fb2ca8954cfe..00000000000000 --- a/integration-tests/devmode/src/test/java/io/quarkus/test/devconsole/DevConsoleArcSmokeTest.java +++ /dev/null @@ -1,61 +0,0 @@ -package io.quarkus.test.devconsole; - -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.enterprise.event.Observes; -import jakarta.inject.Named; - -import org.hamcrest.Matchers; -import org.jboss.shrinkwrap.api.asset.StringAsset; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.RegisterExtension; - -import io.quarkus.test.QuarkusDevModeTest; -import io.restassured.RestAssured; - -/** - * Note that this test cannot be placed under the relevant {@code -deployment} module because then the DEV UI processor would - * not be able to locate the template resources correctly. - */ -public class DevConsoleArcSmokeTest { - - @RegisterExtension - static final QuarkusDevModeTest test = new QuarkusDevModeTest() - .withApplicationRoot((jar) -> jar - .addClasses(Foo.class).addAsResource(new StringAsset("quarkus.arc.dev-mode.monitoring-enabled=true"), - "application.properties")); - - @Test - public void testPages() { - RestAssured - .get("q/dev-v1/io.quarkus.quarkus-arc/beans") - .then() - .statusCode(200).body(Matchers.containsString("io.quarkus.test.devconsole.DevConsoleArcSmokeTest$Foo")); - RestAssured - .get("q/dev-v1/io.quarkus.quarkus-arc/observers") - .then() - .statusCode(200) - .body(Matchers.containsString( - "io.quarkus.test.devconsole.DevConsoleArcSmokeTest$Foo#onStr")); - RestAssured - .get("q/dev-v1/io.quarkus.quarkus-arc/events") - .then() - .statusCode(200).body(Matchers.containsString("io.quarkus.runtime.StartupEvent")); - RestAssured - .get("q/dev-v1/io.quarkus.quarkus-arc/invocations") - .then() - .statusCode(200); - RestAssured - .get("q/dev-v1/io.quarkus.quarkus-arc/removed-beans") - .then() - .statusCode(200).body(Matchers.containsString("org.jboss.logging.Logger")); - } - - @Named - @ApplicationScoped - public static class Foo { - - void onStr(@Observes String event) { - } - - } -} diff --git a/integration-tests/devmode/src/test/java/io/quarkus/test/devconsole/DevConsoleSmokeTest.java b/integration-tests/devmode/src/test/java/io/quarkus/test/devconsole/DevConsoleSmokeTest.java deleted file mode 100644 index b143b864918843..00000000000000 --- a/integration-tests/devmode/src/test/java/io/quarkus/test/devconsole/DevConsoleSmokeTest.java +++ /dev/null @@ -1,28 +0,0 @@ -package io.quarkus.test.devconsole; - -import org.hamcrest.Matchers; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.RegisterExtension; - -import io.quarkus.test.QuarkusDevModeTest; -import io.restassured.RestAssured; - -/** - * Note that this test cannot be placed under the relevant {@code -deployment} module because then the DEV UI processor would - * not be able to locate the template resources correctly. - */ -public class DevConsoleSmokeTest { - - @RegisterExtension - static final QuarkusDevModeTest config = new QuarkusDevModeTest() - .withEmptyApplication(); - - @Test - public void testDevConsoleNotBroken() { - RestAssured.with() - .get("q/dev") - .then() - .statusCode(200).body(Matchers.containsString("Dev UI")); - - } -}