diff --git a/extensions/arc/deployment/pom.xml b/extensions/arc/deployment/pom.xml index bb95d4b482594..750b73d939433 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 3c85d5bcb5c5a..0000000000000 --- 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 8f90940b1b742..5a51ccb5f1d26 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 53d1a2b115c78..0c81148f2c0f7 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 6ce64502afe59..fe0b50353eb3e 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 0000000000000..b5d706953a2f8 --- /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 7ff0417790d2e..ff367d475dbde 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 30105109899a7..3edf0324010e5 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 e87ac408df65d..f0a0b02060f3d 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 80e21d19453a8..850b47b70d32c 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 6f55650ab8749..9e20a8ce74e49 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 1322965d7693d..bc44c69ddb9e0 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 c24383d931a0e..77190db2103a9 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 0000000000000..b3ab550805cdf --- /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 a014b59a2f594..98441b3b2f1dd 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 0be4624dcb02e..0000000000000 --- 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 b556d539b4a98..0000000000000 --- 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 c1aae4d423337..0000000000000 --- 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 58b311cc647da..0000000000000 --- 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 e7d62ddc3fda1..0000000000000 --- 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 d4186ed87c8e3..0000000000000 --- 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 69f7a8c6190c4..0000000000000 --- 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 44de75f20d0a3..0000000000000 --- 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 e16223aa68598..0000000000000 --- 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 473affc152f1b..0000000000000 --- 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 bc864d1bc26c4..0000000000000 --- 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 adb73e72277ab..0000000000000 --- 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 cb86a9ea15499..0000000000000 --- 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 078a39546f5be..0000000000000 --- 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 10cf07b38f528..0000000000000 --- 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 9bd7c3c57fabc..aa2d666e5bcb1 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 dba9292e95acc..8ad6c9d1bef36 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/container-image/deployment/src/main/java/io/quarkus/container/image/deployment/devui/ContainerImageDevUiProcessor.java b/extensions/container-image/deployment/src/main/java/io/quarkus/container/image/deployment/devui/ContainerImageDevUiProcessor.java index 95d061780881b..0a465f3be1069 100644 --- a/extensions/container-image/deployment/src/main/java/io/quarkus/container/image/deployment/devui/ContainerImageDevUiProcessor.java +++ b/extensions/container-image/deployment/src/main/java/io/quarkus/container/image/deployment/devui/ContainerImageDevUiProcessor.java @@ -1,5 +1,6 @@ package io.quarkus.container.image.deployment.devui; +import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.function.Function; @@ -18,15 +19,14 @@ import io.quarkus.devui.spi.JsonRPCProvidersBuildItem; import io.quarkus.devui.spi.page.CardPageBuildItem; import io.quarkus.devui.spi.page.Page; -import io.vertx.core.json.JsonArray; public class ContainerImageDevUiProcessor { @BuildStep(onlyIf = IsDevelopment.class) CardPageBuildItem create(List extensions) { // Get the list of builders - JsonArray array = extensions.stream().map(AvailableContainerImageExtensionBuildItem::getName).sorted() - .collect(JsonArray::new, JsonArray::add, JsonArray::addAll); + List array = extensions.stream().map(AvailableContainerImageExtensionBuildItem::getName).sorted() + .collect(ArrayList::new, ArrayList::add, ArrayList::addAll); CardPageBuildItem card = new CardPageBuildItem(); card.addBuildTimeData("builderTypes", array); diff --git a/extensions/hibernate-orm/runtime/src/main/java/io/quarkus/hibernate/orm/runtime/dev/HibernateOrmDevInfoSupplier.java b/extensions/hibernate-orm/runtime/src/main/java/io/quarkus/hibernate/orm/runtime/dev/HibernateOrmDevInfoSupplier.java deleted file mode 100644 index 278c5f83115b2..0000000000000 --- a/extensions/hibernate-orm/runtime/src/main/java/io/quarkus/hibernate/orm/runtime/dev/HibernateOrmDevInfoSupplier.java +++ /dev/null @@ -1,13 +0,0 @@ -package io.quarkus.hibernate.orm.runtime.dev; - -import java.util.function.Supplier; - -@Deprecated // Only useful for the legacy Dev UI -public class HibernateOrmDevInfoSupplier implements Supplier { - - @Override - public HibernateOrmDevInfo get() { - return HibernateOrmDevController.get().getInfo(); - } - -} diff --git a/extensions/hibernate-search-orm-elasticsearch/runtime/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/runtime/dev/HibernateSearchElasticsearchDevRecorder.java b/extensions/hibernate-search-orm-elasticsearch/runtime/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/runtime/dev/HibernateSearchElasticsearchDevRecorder.java index 981a557508773..ea3c638ea92fa 100644 --- a/extensions/hibernate-search-orm-elasticsearch/runtime/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/runtime/dev/HibernateSearchElasticsearchDevRecorder.java +++ b/extensions/hibernate-search-orm-elasticsearch/runtime/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/runtime/dev/HibernateSearchElasticsearchDevRecorder.java @@ -1,23 +1,13 @@ package io.quarkus.hibernate.search.orm.elasticsearch.runtime.dev; -import java.time.Duration; import java.util.LinkedHashSet; -import java.util.List; import java.util.Map; import java.util.Set; import java.util.stream.Collectors; -import org.hibernate.search.mapper.orm.entity.SearchIndexedEntity; -import org.hibernate.search.mapper.orm.mapping.SearchMapping; - -import io.quarkus.devconsole.runtime.spi.DevConsolePostHandler; -import io.quarkus.devconsole.runtime.spi.FlashScopeUtil; import io.quarkus.hibernate.search.orm.elasticsearch.runtime.HibernateSearchElasticsearchRuntimeConfig; import io.quarkus.hibernate.search.orm.elasticsearch.runtime.HibernateSearchElasticsearchRuntimeConfigPersistenceUnit; import io.quarkus.runtime.annotations.Recorder; -import io.vertx.core.Handler; -import io.vertx.core.MultiMap; -import io.vertx.ext.web.RoutingContext; @Recorder public class HibernateSearchElasticsearchDevRecorder { @@ -34,36 +24,4 @@ public void initController( .collect(Collectors.toCollection(LinkedHashSet::new)); HibernateSearchElasticsearchDevController.get().setActivePersistenceUnitNames(activePersistenceUnitNames); } - - @Deprecated // Only useful for the legacy Dev UI - public Handler indexEntity() { - return new DevConsolePostHandler() { - @Override - protected void handlePostAsync(RoutingContext event, MultiMap form) throws Exception { - if (form.isEmpty()) { - return; - } - Set persistenceUnitNames = form.entries().stream().map(Map.Entry::getValue) - .collect(Collectors.toSet()); - Map mappings = HibernateSearchElasticsearchDevController.get() - .searchMappings(persistenceUnitNames); - if (mappings.isEmpty()) { - flashMessage(event, "There are no indexed entity types.", FlashScopeUtil.FlashMessageStatus.ERROR); - return; - } - for (Map.Entry entry : mappings.entrySet()) { - SearchMapping mapping = entry.getValue(); - List entityNames = mapping.allIndexedEntities().stream() - .map(SearchIndexedEntity::jpaName) - .filter(jpaName -> form.contains(jpaName, entry.getKey(), false)) - .collect(Collectors.toList()); - if (!entityNames.isEmpty()) { - mapping.scope(Object.class, entityNames).massIndexer() - .startAndWait(); - flashMessage(event, "Entities successfully reindexed", Duration.ofSeconds(10)); - } - } - } - }; - } } diff --git a/extensions/kafka-streams/deployment/src/main/java/io/quarkus/kafka/streams/deployment/devconsole/DevConsoleProcessor.java b/extensions/kafka-streams/deployment/src/main/java/io/quarkus/kafka/streams/deployment/devconsole/DevConsoleProcessor.java deleted file mode 100644 index 9ed6a787cc21d..0000000000000 --- a/extensions/kafka-streams/deployment/src/main/java/io/quarkus/kafka/streams/deployment/devconsole/DevConsoleProcessor.java +++ /dev/null @@ -1,17 +0,0 @@ -package io.quarkus.kafka.streams.deployment.devconsole; - -import io.quarkus.deployment.IsDevelopment; -import io.quarkus.deployment.annotations.BuildStep; -import io.quarkus.deployment.pkg.builditem.CurateOutcomeBuildItem; -import io.quarkus.devconsole.spi.DevConsoleRuntimeTemplateInfoBuildItem; -import io.quarkus.kafka.streams.runtime.TopologySupplier; - -public class DevConsoleProcessor { - - @BuildStep(onlyIf = IsDevelopment.class) - public DevConsoleRuntimeTemplateInfoBuildItem collectInfos(CurateOutcomeBuildItem curateOutcomeBuildItem) { - return new DevConsoleRuntimeTemplateInfoBuildItem("topology", new TopologySupplier(), this.getClass(), - curateOutcomeBuildItem); - } - -} diff --git a/extensions/kafka-streams/deployment/src/main/resources/dev-templates/embedded.html b/extensions/kafka-streams/deployment/src/main/resources/dev-templates/embedded.html deleted file mode 100644 index 68aca76e2bebe..0000000000000 --- a/extensions/kafka-streams/deployment/src/main/resources/dev-templates/embedded.html +++ /dev/null @@ -1,3 +0,0 @@ - - - Topology diff --git a/extensions/kafka-streams/deployment/src/main/resources/dev-templates/kafka-streams-topology.html b/extensions/kafka-streams/deployment/src/main/resources/dev-templates/kafka-streams-topology.html deleted file mode 100644 index 42b626d376783..0000000000000 --- a/extensions/kafka-streams/deployment/src/main/resources/dev-templates/kafka-streams-topology.html +++ /dev/null @@ -1,379 +0,0 @@ -{#include main fluid=true} -{#style} -#kafka-streams-topology svg { - height: 100%; -} - -#topology-description { - resize: none; - font-family: SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace; -} - -#kafka-streams-topology .no-outline { - box-shadow: none !important; - outline: 0; -} - -#kafka-streams-topology .caret { - border: solid #000; - border-width: 0 2px 2px 0; - display: inline; - cursor: pointer; - padding: 3px; - position: absolute; - right: 0; - margin-top: 10px; -} - -#kafka-streams-topology .list-group-item .collapsed .caret { - transform: rotate(40deg); - -webkit-transform: rotate(40deg); - transition: .3s transform ease-in-out; -} - -#kafka-streams-topology .list-group-item .caret { - transform: rotate(-140deg); - -webkit-transform: rotate(-140deg); - transition: .3s transform ease-in-out; -} - -#kafka-streams-topology .w-15 { - width: 15%!important; -} -{/style} -{#scriptref} - -{/scriptref} -{#script} -function toMermaid(topology) { - var lines = topology.split('\n'); - var subTopologies = []; - var outside = []; - var currentGraphNodeName; - var subTopologiesList = []; - var topicSourcesList = []; - var topicSinksList = []; - var stateStoresList = []; - var name = (value) => value.replaceAll("-", "-
    "); - - var subTopology = { - pattern: /Sub-topology: ([0-9]*)/, - startFormatter: (subTopology) => `subgraph Sub-Topology: $\{subTopology}`, - endFormatter: () => `end`, - visit: function(line) { - var match = line.match(this.pattern); - // Close the previous sub-topology before opening a new one; - if(subTopologies.length) { - subTopologies.push(this.endFormatter()); - } - subTopologies.push(this.startFormatter(match[1])); - subTopologiesList.push(match[1]); - } - } - var source = { - pattern: /Source:\s+(\S+)\s+\(topics:\s+\[(.*)\]\)/, - formatter: (source, topic) => `$\{topic}[$\{topic}] --> $\{source}($\{name(source)})`, - visit: function(line) { - var match = line.match(this.pattern); - currentGraphNodeName = match[1].trim(); - var topics = match[2] - topics.split(',').filter(String).map(topic => topic.trim()).forEach(topic => { - outside.push(this.formatter(currentGraphNodeName, topic)); - topicSourcesList.push(topic); - }); - } - }; - - var processor = { - pattern: /Processor:\s+(\S+)\s+\(stores:\s+\[(.*)\]\)/, - formatter: (processor, store) => (processor.includes("JOIN")) ? `$\{store}[($\{name(store)})] --> $\{processor}($\{name(processor)})` : `$\{processor}($\{name(processor)}) --> $\{store}[($\{name(store)})]`, - visit: function(line) { - var match = line.match(this.pattern); - currentGraphNodeName = match[1].trim(); - var stores = match[2]; - stores.split(',').filter(String).map(store => store.trim()).forEach(store => { - outside.push(this.formatter(currentGraphNodeName, store)); - stateStoresList.push(store); - }); - } - }; - - var sink = { - pattern: /Sink:\s+(\S+)\s+\(topic:\s+(.*)\)/, - formatter: (sink, topic) => `$\{sink}($\{name(sink)}) --> $\{topic}[$\{topic}]`, - visit: function(line) { - var match = line.match(this.pattern); - currentGraphNodeName = match[1].trim(); - var topic = match[2].trim(); - outside.push(this.formatter(currentGraphNodeName, topic)); - topicSinksList.push(topic); - } - } - - var rightArrow = { - pattern: /\s*-->\s+(.*)/, - formatter: (src, dst) => `$\{src}($\{name(src)}) --> $\{dst}($\{name(dst)})`, - visit: function(line) { - var match = line.match(this.pattern); - match[1].split(',').filter(String).map(target => target.trim()).filter(target => target !== "none").forEach(target => { - subTopologies.push(this.formatter(currentGraphNodeName, target)) - }); - } - }; - - for(const line of lines) { - switch(true) { - case subTopology.pattern.test(line): - subTopology.visit(line); - break; - case source.pattern.test(line): - source.visit(line); - break; - case processor.pattern.test(line): - processor.visit(line); - break; - case sink.pattern.test(line): - sink.visit(line); - break; - case rightArrow.pattern.test(line): - rightArrow.visit(line); - break; - default: - break; - } - - } - - if(subTopologies.length) { - subTopologies.push(subTopology.endFormatter()); - } - - var description = ["graph TD"].concat(outside).concat(subTopologies).concat(topicSourcesList).concat(topicSinksList).concat(stateStoresList).join('\n'); - - return { - description: description, - details: { - subTopologies: subTopologiesList, - topicSources: topicSourcesList, - topicSinks: topicSinksList, - stateStores: stateStoresList - } - }; -} -function svgToCanvas(svgCode) { - var canvas = document.createElement('canvas'); - try { - var ctx = canvas.getContext("2d"); - - var img = new Image(); - img.src = "data:image/svg+xml;base64," + btoa(unescape(encodeURIComponent(svgCode))); - img.onload = () => { - canvas.width = img.width; - canvas.height = img.height; - ctx.drawImage(img, 0, 0, img.width, img.height); - }; - } catch (err) { - console.error('Failed to generate canvas') - } - return canvas; -} -mermaid.initialize(\{startOnLoad:false}); -$(function(){ - - var canvas = document.createElement("canvas"); - var topologyDescription = $('#topology-description').val(); - var mermaidGraphDefinition = toMermaid(topologyDescription); - console.log(mermaidGraphDefinition.description); - - var id = "mermaid-graph-" + Date.now(); - - mermaid.mermaidAPI.render(id, mermaidGraphDefinition.description, (svgCode, bindFunctions) => { - canvas = svgToCanvas(svgCode); - $('#topology-graph-wrapper').html(svgCode); - $(`#$\{id}`).addClass('mx-auto d-block'); // center the graph - }); - - $('#sub-topologies-details').html(mermaidGraphDefinition.details.subTopologies.length); - $('#topic-sources-details').text(mermaidGraphDefinition.details.topicSources.length); - $('#topic-sinks-details').text(mermaidGraphDefinition.details.topicSinks.length); - $('#state-stores-details').text(mermaidGraphDefinition.details.stateStores.length); - - mermaidGraphDefinition.details.topicSources.sort().forEach(topic => { - $('#topic-sources-list').append(`
  • $\{topic}
  • `) - }); - - mermaidGraphDefinition.details.topicSinks.sort().forEach(topic => { - $('#topic-sinks-list').append(`
  • $\{topic}
  • `) - }); - - mermaidGraphDefinition.details.stateStores.sort().forEach(store => { - $('#state-stores-list').append(`
  • $\{store}
  • `) - }); - - $("#topology-graph-visualization-toggle, #topology-description-visualization-toggle").click(() => { - $("#topology-description-wrapper").toggleClass("d-none"); - $("#topology-description-visualization-toggle").toggleClass("btn-primary"); - $("#topology-description-visualization-toggle").toggleClass("btn-outline-primary"); - - $("#topology-graph-wrapper").toggleClass("d-none"); - $("#topology-graph-visualization-toggle").toggleClass("btn-outline-primary"); - $("#topology-graph-visualization-toggle").toggleClass("btn-primary"); - }); - - $("#topology-copy-button").click(() => { - var isDescriptionVisible = !$("#topology-description-wrapper").hasClass("d-none"); - if (isDescriptionVisible) { - navigator.clipboard.writeText($('#topology-description').val().trim() + '\n'); - } else { - canvas.toBlob(blob => { - navigator.clipboard.write([new ClipboardItem({ ['image/png']: blob })]); - }) - } - }); - - $("#topology-copy-button").popover({ trigger:"manual" }).click(function() { - var pop = $(this); - pop.popover("show") - pop.on('shown.bs.popover',() => setTimeout(() => pop.popover("hide"), 1000)); - }); - - $("#topology-download-button").click(() => { - var downloadLink = document.createElement('a'); - - var isDescriptionVisible = !$("#topology-description-wrapper").hasClass("d-none"); - if (isDescriptionVisible) { - var description= $('#topology-description').val().trim() + '\n'; - downloadLink.href = 'data:text/plain;charset=utf-8,' + encodeURIComponent(description); - downloadLink.download = 'topology.txt'; - } else { - downloadLink.href = canvas.toDataURL('image/png'); - downloadLink.download = 'topology.png'; - } - - downloadLink.style.display = 'none'; - document.body.appendChild(downloadLink); - - downloadLink.click(); - - document.body.removeChild(downloadLink); - }); -}); -{/script} -{#title}Topology{/title} -{#body} -
    -{#if info:topology} -
    -
    -

    Details

    -
    -
    -
    -
    -
    - -
    - -
    - -
    -
    -
      -
    -
    -
    -
    - -
    - -
    -
    -
      -
    -
    -
    -
    - -
    - -
    -
    -
      -
    -
    -
    -
    -
    -
    -
    -
    -

    Description

    -
    -
    -
    -
    -
    -
    - - -
    -
    - - -
    -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    -
    -
    -
    -
    -{#else} -{#topologyNotFound /} -{/if} -
    -{/body} -{/include} diff --git a/extensions/kafka-streams/deployment/src/main/resources/dev-templates/tags/topologyNotFound.html b/extensions/kafka-streams/deployment/src/main/resources/dev-templates/tags/topologyNotFound.html deleted file mode 100644 index 7caa3fb578494..0000000000000 --- a/extensions/kafka-streams/deployment/src/main/resources/dev-templates/tags/topologyNotFound.html +++ /dev/null @@ -1,16 +0,0 @@ -
    -
    -
    -

    No topology found.

    -

    - Verify you have an @ApplicationScoped bean which defines a CDI producer method with a @Produces annotation returning the Kafka Streams Topology. -

    -
    -

    - - Quarkus Apache Kafka Streams guide - -

    -
    -
    -
    diff --git a/extensions/netty/deployment/pom.xml b/extensions/netty/deployment/pom.xml index 52f243a900bfa..222d693dd417b 100644 --- a/extensions/netty/deployment/pom.xml +++ b/extensions/netty/deployment/pom.xml @@ -21,6 +21,10 @@ io.quarkus quarkus-arc-deployment
    + + io.vertx + vertx-web + diff --git a/extensions/qute/deployment/src/main/java/io/quarkus/qute/deployment/devui/QuteDevUIProcessor.java b/extensions/qute/deployment/src/main/java/io/quarkus/qute/deployment/devui/QuteDevUIProcessor.java index b68871784c160..b75e0d10620e2 100644 --- a/extensions/qute/deployment/src/main/java/io/quarkus/qute/deployment/devui/QuteDevUIProcessor.java +++ b/extensions/qute/deployment/src/main/java/io/quarkus/qute/deployment/devui/QuteDevUIProcessor.java @@ -3,8 +3,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Comparator; +import java.util.HashMap; import java.util.HashSet; import java.util.List; +import java.util.Map; import java.util.Map.Entry; import java.util.Set; import java.util.stream.Collectors; @@ -26,8 +28,6 @@ import io.quarkus.qute.deployment.TemplateVariantsBuildItem; import io.quarkus.qute.deployment.TemplatesAnalysisBuildItem; import io.quarkus.qute.deployment.TemplatesAnalysisBuildItem.TemplateAnalysis; -import io.vertx.core.json.JsonArray; -import io.vertx.core.json.JsonObject; public class QuteDevUIProcessor { @@ -116,41 +116,42 @@ public int compare(TemplateExtensionMethodBuildItem m1, TemplateExtensionMethodB cardPages.produce(pageBuildItem); } - private JsonArray createTemplateGlobalsJson(List sortedTemplateGlobals) { - JsonArray globals = new JsonArray(); + private List> createTemplateGlobalsJson(List sortedTemplateGlobals) { + List> globals = new ArrayList<>(); for (TemplateGlobalBuildItem global : sortedTemplateGlobals) { - JsonObject json = new JsonObject(); - json.put("name", global.getName()); - json.put("target", global.getDeclaringClass() + "#" + Map map = new HashMap<>(); + map.put("name", global.getName()); + map.put("target", global.getDeclaringClass() + "#" + (global.isField() ? global.getTarget().asField().name() : global.getTarget().asMethod().name() + "()")); - globals.add(json); + globals.add(map); } return globals; } - private JsonArray createTemplateDataJson(List sortedTemplateData) { - JsonArray data = new JsonArray(); + private List> createTemplateDataJson(List sortedTemplateData) { + List> data = new ArrayList<>(); for (TemplateDataBuildItem templateData : sortedTemplateData) { - JsonObject json = new JsonObject(); - json.put("target", templateData.getTargetClass().name().toString()); + Map map = new HashMap<>(); + map.put("target", templateData.getTargetClass().name().toString()); if (templateData.hasNamespace()) { - json.put("namespace", templateData.getNamespace()); + map.put("namespace", templateData.getNamespace()); } if (templateData.getIgnore() != null && templateData.getIgnore().length > 0) { - json.put("ignores", Arrays.toString(templateData.getIgnore())); + map.put("ignores", Arrays.toString(templateData.getIgnore())); } if (templateData.isProperties()) { - json.put("properties", true); + map.put("properties", true); } - data.add(json); + data.add(map); } return data; } - private JsonArray createExtensionMethodsJson(List sortedExtensionMethods) { - JsonArray extensionMethods = new JsonArray(); + private List> createExtensionMethodsJson( + List sortedExtensionMethods) { + List> extensionMethods = new ArrayList<>(); for (TemplateExtensionMethodBuildItem templateExtensionMethod : sortedExtensionMethods) { - JsonObject extensionMethod = new JsonObject(); + Map extensionMethod = new HashMap<>(); extensionMethod.put("name", templateExtensionMethod.getMethod().declaringClass().name() + "#" + templateExtensionMethod.getMethod().name() + "()"); if (templateExtensionMethod.getMatchRegex() != null && !templateExtensionMethod.getMatchRegex().isEmpty()) { @@ -170,12 +171,12 @@ private JsonArray createExtensionMethodsJson(List sortedTemplatePaths, + private List> createTemplatesJson(List sortedTemplatePaths, List checkedTemplates, TemplatesAnalysisBuildItem templatesAnalysis, TemplateVariantsBuildItem variants) { - JsonArray templates = new JsonArray(); + List> templates = new ArrayList<>(); for (TemplatePathBuildItem templatePath : sortedTemplatePaths) { - JsonObject template = new JsonObject(); + Map template = new HashMap<>(); template.put("path", templatePath.getPath()); CheckedTemplateBuildItem checkedTemplate = findCheckedTemplate(getBasePath(templatePath.getPath(), variants), @@ -189,12 +190,12 @@ private JsonArray createTemplatesJson(List sortedTemplate .filter(ta -> ta.path.equals(templatePath.getPath())).findFirst().orElse(null); if (analysis != null) { if (!analysis.fragmentIds.isEmpty()) { - JsonArray fragmentIds = new JsonArray(); + List fragmentIds = new ArrayList<>(); analysis.fragmentIds.forEach(fragmentIds::add); template.put("fragmentIds", fragmentIds); } if (!analysis.parameterDeclarations.isEmpty()) { - JsonArray paramDeclarations = new JsonArray(); + List paramDeclarations = new ArrayList<>(); for (ParameterDeclaration pd : analysis.parameterDeclarations) { paramDeclarations.add(String.format("{@%s %s%s}", pd.getTypeInfo().substring(1, pd.getTypeInfo().length() - 1), pd.getKey(), diff --git a/extensions/reactive-db2-client/deployment/src/main/java/io/quarkus/reactive/db2/client/deployment/ReactiveDB2ClientProcessor.java b/extensions/reactive-db2-client/deployment/src/main/java/io/quarkus/reactive/db2/client/deployment/ReactiveDB2ClientProcessor.java index 4fef9763a80fd..d20b951f8d517 100644 --- a/extensions/reactive-db2-client/deployment/src/main/java/io/quarkus/reactive/db2/client/deployment/ReactiveDB2ClientProcessor.java +++ b/extensions/reactive-db2-client/deployment/src/main/java/io/quarkus/reactive/db2/client/deployment/ReactiveDB2ClientProcessor.java @@ -19,7 +19,7 @@ import io.quarkus.arc.deployment.SyntheticBeanBuildItem.ExtendedBeanConfigurator; import io.quarkus.arc.deployment.UnremovableBeanBuildItem; import io.quarkus.arc.deployment.ValidationPhaseBuildItem; -import io.quarkus.arc.deployment.devconsole.Name; +import io.quarkus.arc.deployment.devui.Name; import io.quarkus.arc.processor.BeanInfo; import io.quarkus.arc.processor.DotNames; import io.quarkus.datasource.common.runtime.DataSourceUtil; diff --git a/extensions/reactive-mssql-client/deployment/src/main/java/io/quarkus/reactive/mssql/client/deployment/ReactiveMSSQLClientProcessor.java b/extensions/reactive-mssql-client/deployment/src/main/java/io/quarkus/reactive/mssql/client/deployment/ReactiveMSSQLClientProcessor.java index ff740e9276ed2..5e5d06baf8bdd 100644 --- a/extensions/reactive-mssql-client/deployment/src/main/java/io/quarkus/reactive/mssql/client/deployment/ReactiveMSSQLClientProcessor.java +++ b/extensions/reactive-mssql-client/deployment/src/main/java/io/quarkus/reactive/mssql/client/deployment/ReactiveMSSQLClientProcessor.java @@ -19,7 +19,7 @@ import io.quarkus.arc.deployment.SyntheticBeanBuildItem.ExtendedBeanConfigurator; import io.quarkus.arc.deployment.UnremovableBeanBuildItem; import io.quarkus.arc.deployment.ValidationPhaseBuildItem; -import io.quarkus.arc.deployment.devconsole.Name; +import io.quarkus.arc.deployment.devui.Name; import io.quarkus.arc.processor.BeanInfo; import io.quarkus.arc.processor.DotNames; import io.quarkus.datasource.common.runtime.DataSourceUtil; diff --git a/extensions/reactive-mysql-client/deployment/src/main/java/io/quarkus/reactive/mysql/client/deployment/ReactiveMySQLClientProcessor.java b/extensions/reactive-mysql-client/deployment/src/main/java/io/quarkus/reactive/mysql/client/deployment/ReactiveMySQLClientProcessor.java index 7a31ef9cc1927..b512986ade9ee 100644 --- a/extensions/reactive-mysql-client/deployment/src/main/java/io/quarkus/reactive/mysql/client/deployment/ReactiveMySQLClientProcessor.java +++ b/extensions/reactive-mysql-client/deployment/src/main/java/io/quarkus/reactive/mysql/client/deployment/ReactiveMySQLClientProcessor.java @@ -19,7 +19,7 @@ import io.quarkus.arc.deployment.SyntheticBeanBuildItem.ExtendedBeanConfigurator; import io.quarkus.arc.deployment.UnremovableBeanBuildItem; import io.quarkus.arc.deployment.ValidationPhaseBuildItem; -import io.quarkus.arc.deployment.devconsole.Name; +import io.quarkus.arc.deployment.devui.Name; import io.quarkus.arc.processor.BeanInfo; import io.quarkus.arc.processor.DotNames; import io.quarkus.datasource.common.runtime.DataSourceUtil; diff --git a/extensions/reactive-oracle-client/deployment/src/main/java/io/quarkus/reactive/oracle/client/deployment/ReactiveOracleClientProcessor.java b/extensions/reactive-oracle-client/deployment/src/main/java/io/quarkus/reactive/oracle/client/deployment/ReactiveOracleClientProcessor.java index ec3d61852f381..25918da0fca34 100644 --- a/extensions/reactive-oracle-client/deployment/src/main/java/io/quarkus/reactive/oracle/client/deployment/ReactiveOracleClientProcessor.java +++ b/extensions/reactive-oracle-client/deployment/src/main/java/io/quarkus/reactive/oracle/client/deployment/ReactiveOracleClientProcessor.java @@ -19,7 +19,7 @@ import io.quarkus.arc.deployment.SyntheticBeanBuildItem.ExtendedBeanConfigurator; import io.quarkus.arc.deployment.UnremovableBeanBuildItem; import io.quarkus.arc.deployment.ValidationPhaseBuildItem; -import io.quarkus.arc.deployment.devconsole.Name; +import io.quarkus.arc.deployment.devui.Name; import io.quarkus.arc.processor.BeanInfo; import io.quarkus.arc.processor.DotNames; import io.quarkus.datasource.common.runtime.DataSourceUtil; diff --git a/extensions/reactive-pg-client/deployment/src/main/java/io/quarkus/reactive/pg/client/deployment/ReactivePgClientProcessor.java b/extensions/reactive-pg-client/deployment/src/main/java/io/quarkus/reactive/pg/client/deployment/ReactivePgClientProcessor.java index 6470b439610e4..77690e5430e3d 100644 --- a/extensions/reactive-pg-client/deployment/src/main/java/io/quarkus/reactive/pg/client/deployment/ReactivePgClientProcessor.java +++ b/extensions/reactive-pg-client/deployment/src/main/java/io/quarkus/reactive/pg/client/deployment/ReactivePgClientProcessor.java @@ -19,7 +19,7 @@ import io.quarkus.arc.deployment.SyntheticBeanBuildItem.ExtendedBeanConfigurator; import io.quarkus.arc.deployment.UnremovableBeanBuildItem; import io.quarkus.arc.deployment.ValidationPhaseBuildItem; -import io.quarkus.arc.deployment.devconsole.Name; +import io.quarkus.arc.deployment.devui.Name; import io.quarkus.arc.processor.BeanInfo; import io.quarkus.arc.processor.DotNames; import io.quarkus.datasource.common.runtime.DataSourceUtil; diff --git a/extensions/vertx-http/deployment/pom.xml b/extensions/vertx-http/deployment/pom.xml index 90fd6328e4ab6..c3db62b0bee6f 100644 --- a/extensions/vertx-http/deployment/pom.xml +++ b/extensions/vertx-http/deployment/pom.xml @@ -25,6 +25,10 @@ io.quarkus quarkus-vertx-http-deployment-spi + + io.quarkus + quarkus-vertx-http-dev-console-spi + io.quarkus quarkus-mutiny-deployment 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 a47bf5c86501e..a94209495f368 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,6 @@ 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.processor.BeanInfo; import io.quarkus.arc.processor.BuildExtension; import io.quarkus.arc.processor.DecoratorInfo; @@ -27,6 +26,7 @@ import io.quarkus.vertx.http.runtime.devmode.ArcDevRecorder; public class ArcDevProcessor { + private static final String BEAN_DEPENDENCIES = "io.quarkus.arc.beanDependencies"; @Record(ExecutionTime.RUNTIME_INIT) @BuildStep(onlyIf = IsDevelopment.class) @@ -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(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 b2fb2ca8954cf..0000000000000 --- 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 b143b86491884..0000000000000 --- 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")); - - } -}