Package dev.relism.flash.ext.routeviewer
Class RouteViewerExtension
java.lang.Object
dev.relism.flash.ext.routeviewer.RouteViewerExtension
- All Implemented Interfaces:
FlashExtension
Mounts an interactive route-graph viewer at a configurable HTTP endpoint.
The viewer is a React SPA (@xyflow/react) bundled into the JAR.
It renders routers, routes, handler inheritance chains, and middleware chains
as a draggable, zoomable node graph.
Endpoints registered
GET <path>— SPA shell (index.html)GET <path>/app.js— React bundleGET <path>/app.css— stylesGET <path>/data— graph JSON consumed by the SPA
The route listener is registered during the provide(dev.relism.flash.extension.FlashContext) phase, before any routes
are compiled. Combined with the two-phase extension model, this guarantees all routes
(including those from other extensions) are always captured — install order is irrelevant.
FlashApp.create(8080)
.install(new OidcExtension(config))
.install(new RouteViewerExtension())
.scan("dev.example.handlers")
.start();
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionInstalls the viewer at "/routeviewer".RouteViewerExtension(String path) Installs the viewer at a custom path. -
Method Summary
Modifier and TypeMethodDescriptionintpriority()Observability — runs last so the viewer sees the complete middleware chain.voidprovide(FlashContext ctx) Phase 1 — register services and processors.voidroutes(FlashRegistrar<?> app, FlashContext ctx) Phase 2 — register routes.
-
Field Details
-
DEFAULT_PATH
- See Also:
-
-
Constructor Details
-
RouteViewerExtension
public RouteViewerExtension()Installs the viewer at "/routeviewer". -
RouteViewerExtension
Installs the viewer at a custom path.- Parameters:
path- e.g."/_routes"
-
-
Method Details
-
priority
public int priority()Observability — runs last so the viewer sees the complete middleware chain.- Specified by:
priorityin interfaceFlashExtension
-
provide
Description copied from interface:FlashExtensionPhase 1 — register services and processors. Safe:FlashContext.provide(java.lang.Class<T>, T),FlashContext.supply(java.lang.Class<T>, java.util.function.Supplier<T>),FlashContext.addAnnotationProcessor(dev.relism.flash.extension.AnnotationProcessor),FlashContext.addRouteListener(dev.relism.flash.extension.RouteListener). Unsafe:FlashContext.require(java.lang.Class<T>)(services not yet resolved).- Specified by:
providein interfaceFlashExtension
-
routes
Description copied from interface:FlashExtensionPhase 2 — register routes. All services are fully resolved.FlashContext.require(java.lang.Class<T>)is safe here.- Specified by:
routesin interfaceFlashExtension
-