373 lines
36 KiB
HTML
373 lines
36 KiB
HTML
<!DOCTYPE HTML>
|
|
<html lang>
|
|
<head>
|
|
<!-- Generated by javadoc (21) on Mon May 11 14:20:32 UTC 2026 -->
|
|
<title>FlashApp (flash-parent 2.1.0-SNAPSHOT API)</title>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
|
<meta name="dc.created" content="2026-05-11">
|
|
<meta name="description" content="declaration: package: dev.relism.flash.extension, class: FlashApp">
|
|
<meta name="generator" content="javadoc/ClassWriterImpl">
|
|
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
|
|
<link rel="stylesheet" type="text/css" href="../../../../script-dir/jquery-ui.min.css" title="Style">
|
|
<script type="text/javascript" src="../../../../script.js"></script>
|
|
<script type="text/javascript" src="../../../../script-dir/jquery-3.7.1.min.js"></script>
|
|
<script type="text/javascript" src="../../../../script-dir/jquery-ui.min.js"></script>
|
|
</head>
|
|
<body class="class-declaration-page">
|
|
<script type="text/javascript">var pathtoroot = "../../../../";
|
|
loadScripts(document, 'script');</script>
|
|
<noscript>
|
|
<div>JavaScript is disabled on your browser.</div>
|
|
</noscript>
|
|
<div class="flex-box">
|
|
<header role="banner" class="flex-header">
|
|
<nav role="navigation">
|
|
<!-- ========= START OF TOP NAVBAR ======= -->
|
|
<div class="top-nav" id="navbar-top"><button id="navbar-toggle-button" aria-controls="navbar-top" aria-expanded="false" aria-label="Toggle navigation links"><span class="nav-bar-toggle-icon"> </span><span class="nav-bar-toggle-icon"> </span><span class="nav-bar-toggle-icon"> </span></button>
|
|
<div class="skip-nav"><a href="#skip-navbar-top" title="Skip navigation links">Skip navigation links</a></div>
|
|
<ul id="navbar-top-firstrow" class="nav-list" title="Navigation">
|
|
<li><a href="../../../../index.html">Overview</a></li>
|
|
<li><a href="package-summary.html">Package</a></li>
|
|
<li class="nav-bar-cell1-rev">Class</li>
|
|
<li><a href="class-use/FlashApp.html">Use</a></li>
|
|
<li><a href="package-tree.html">Tree</a></li>
|
|
<li><a href="../../../../index-all.html">Index</a></li>
|
|
<li><a href="../../../../help-doc.html#class">Help</a></li>
|
|
</ul>
|
|
<ul class="sub-nav-list-small">
|
|
<li>
|
|
<p>Summary:</p>
|
|
<ul>
|
|
<li>Nested</li>
|
|
<li>Field</li>
|
|
<li>Constr</li>
|
|
<li><a href="#method-summary">Method</a></li>
|
|
</ul>
|
|
</li>
|
|
<li>
|
|
<p>Detail:</p>
|
|
<ul>
|
|
<li>Field</li>
|
|
<li>Constr</li>
|
|
<li><a href="#method-detail">Method</a></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<div class="sub-nav">
|
|
<div id="navbar-sub-list">
|
|
<ul class="sub-nav-list">
|
|
<li>Summary: </li>
|
|
<li>Nested | </li>
|
|
<li>Field | </li>
|
|
<li>Constr | </li>
|
|
<li><a href="#method-summary">Method</a></li>
|
|
</ul>
|
|
<ul class="sub-nav-list">
|
|
<li>Detail: </li>
|
|
<li>Field | </li>
|
|
<li>Constr | </li>
|
|
<li><a href="#method-detail">Method</a></li>
|
|
</ul>
|
|
</div>
|
|
<div class="nav-list-search"><a href="../../../../search.html">SEARCH</a>
|
|
<input type="text" id="search-input" disabled placeholder="Search">
|
|
<input type="reset" id="reset-button" disabled value="reset">
|
|
</div>
|
|
</div>
|
|
<!-- ========= END OF TOP NAVBAR ========= -->
|
|
<span class="skip-nav" id="skip-navbar-top"></span></nav>
|
|
</header>
|
|
<div class="flex-content">
|
|
<main role="main">
|
|
<!-- ======== START OF CLASS DATA ======== -->
|
|
<div class="header">
|
|
<div class="sub-title"><span class="package-label-in-type">Package</span> <a href="package-summary.html">dev.relism.flash.extension</a></div>
|
|
<h1 title="Class FlashApp" class="title">Class FlashApp</h1>
|
|
</div>
|
|
<div class="inheritance" title="Inheritance Tree"><a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">java.lang.Object</a>
|
|
<div class="inheritance"><a href="FlashRegistrar.html" title="class in dev.relism.flash.extension">dev.relism.flash.extension.FlashRegistrar</a><<a href="FlashApp.html" title="class in dev.relism.flash.extension">FlashApp</a>>
|
|
<div class="inheritance">dev.relism.flash.extension.FlashApp</div>
|
|
</div>
|
|
</div>
|
|
<section class="class-description" id="class-description">
|
|
<hr>
|
|
<div class="type-signature"><span class="modifiers">public final class </span><span class="element-name type-name-label">FlashApp</span>
|
|
<span class="extends-implements">extends <a href="FlashRegistrar.html" title="class in dev.relism.flash.extension">FlashRegistrar</a><<a href="FlashApp.html" title="class in dev.relism.flash.extension">FlashApp</a>></span></div>
|
|
<div class="block">Single entry point for Flash. Owns one flat <a href="../routing/routers/fastpathrouter/FastPathRouterImpl.html" title="class in dev.relism.flash.routing.routers.fastpathrouter"><code>FastPathRouterImpl</code></a> —
|
|
all routes (app-level and scoped) compile into a single FSM at startup.
|
|
|
|
<pre><code>
|
|
FlashApp.create(8080)
|
|
.install(new JacksonExtension())
|
|
.use(cors)
|
|
.get("/ping", (req, res) -> "pong")
|
|
.get("/secured", (req, res) -> user(), oidc.protect())
|
|
.scan("dev.example.handlers")
|
|
.mount("/api", scope -> scope.get("/health", (req, res) -> "ok"))
|
|
.startAndBlock(); // blocks main thread
|
|
</code></pre>
|
|
|
|
<h3 id="startup-sequence-both-start-and-startandblock--heading">Startup sequence (both <a href="#start()"><code>start()</code></a> and <a href="#startAndBlock()"><code>startAndBlock()</code></a>)</h3>
|
|
<ol>
|
|
<li>Extensions sorted by <a href="FlashExtension.html#priority()"><code>FlashExtension.priority()</code></a> — lower first.</li>
|
|
<li>All <a href="FlashExtension.html#provide(dev.relism.flash.extension.FlashContext)"><code>FlashExtension.provide(dev.relism.flash.extension.FlashContext)</code></a> — register services, processors, listeners.</li>
|
|
<li><code>FlashContext.resolveAll()</code> — topo-sort, cycle detection.</li>
|
|
<li>All <a href="FlashExtension.html#routes(dev.relism.flash.extension.FlashRegistrar,dev.relism.flash.extension.FlashContext)"><code>FlashExtension.routes(dev.relism.flash.extension.FlashRegistrar<?>, dev.relism.flash.extension.FlashContext)</code></a> — routes registered, services available.</li>
|
|
<li>Compile all routes into one flat FSM — zero prefix scanning at runtime.</li>
|
|
<li>Accept loop started.</li>
|
|
</ol>
|
|
|
|
<h3 id="default-error-handlers-heading">Default error handlers</h3>
|
|
Dev mode (<code>-Dflash.env=dev</code>): rich HTML with stack traces.
|
|
Prod mode (default): generic JSON — no internal details leaked.
|
|
Override via <a href="#onException(dev.relism.flash.routing.AbstractRouter.ExceptionHandler)"><code>onException(dev.relism.flash.routing.AbstractRouter.ExceptionHandler)</code></a> / <a href="#onNotFound(dev.relism.flash.models.SimpleHandler.FunctionalHandler)"><code>onNotFound(dev.relism.flash.models.SimpleHandler.FunctionalHandler)</code></a>.</div>
|
|
</section>
|
|
<section class="summary">
|
|
<ul class="summary-list">
|
|
<!-- ========== METHOD SUMMARY =========== -->
|
|
<li>
|
|
<section class="method-summary" id="method-summary">
|
|
<h2>Method Summary</h2>
|
|
<div id="method-summary-table">
|
|
<div class="table-tabs" role="tablist" aria-orientation="horizontal"><button id="method-summary-table-tab0" role="tab" aria-selected="true" aria-controls="method-summary-table.tabpanel" tabindex="0" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table', 3)" class="active-table-tab">All Methods</button><button id="method-summary-table-tab1" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab1', 3)" class="table-tab">Static Methods</button><button id="method-summary-table-tab2" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab2', 3)" class="table-tab">Instance Methods</button><button id="method-summary-table-tab4" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab4', 3)" class="table-tab">Concrete Methods</button></div>
|
|
<div id="method-summary-table.tabpanel" role="tabpanel" aria-labelledby="method-summary-table-tab0">
|
|
<div class="summary-table three-column-summary">
|
|
<div class="table-header col-first">Modifier and Type</div>
|
|
<div class="table-header col-second">Method</div>
|
|
<div class="table-header col-last">Description</div>
|
|
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>protected void</code></div>
|
|
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#addMiddleware(dev.relism.flash.routing.Middleware)" class="member-name-link">addMiddleware</a><wbr>(<a href="../routing/Middleware.html" title="interface in dev.relism.flash.routing">Middleware</a> mw)</code></div>
|
|
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
|
|
<div class="block">Registers a middleware in this registrar's own scope (global or scope-level).</div>
|
|
</div>
|
|
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>protected void</code></div>
|
|
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#addRoute(dev.relism.flash.http.HttpMethod,java.lang.String,dev.relism.flash.models.RequestHandler,java.util.List)" class="member-name-link">addRoute</a><wbr>(<a href="../http/HttpMethod.html" title="enum class in dev.relism.flash.http">HttpMethod</a> method,
|
|
<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> path,
|
|
<a href="../models/RequestHandler.html" title="class in dev.relism.flash.models">RequestHandler</a> handler,
|
|
<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a><<a href="../routing/Middleware.html" title="interface in dev.relism.flash.routing">Middleware</a>> mw)</code></div>
|
|
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
|
|
<div class="block">Adds a route immediately to this registrar's deferred compilation list.</div>
|
|
</div>
|
|
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>protected void</code></div>
|
|
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#addWsRoute(java.lang.String,dev.relism.flash.websocket.WebSocketEndpoint)" class="member-name-link">addWsRoute</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> path,
|
|
<a href="../websocket/WebSocketEndpoint.html" title="class in dev.relism.flash.websocket">WebSocketEndpoint</a> endpoint)</code></div>
|
|
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> </div>
|
|
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="FlashApp.html" title="class in dev.relism.flash.extension">FlashApp</a></code></div>
|
|
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#create(int)" class="member-name-link">create</a><wbr>(int port)</code></div>
|
|
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"> </div>
|
|
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="FlashApp.html" title="class in dev.relism.flash.extension">FlashApp</a></code></div>
|
|
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#create(dev.relism.flash.extension.FlashConfiguration)" class="member-name-link">create</a><wbr>(<a href="FlashConfiguration.html" title="class in dev.relism.flash.extension">FlashConfiguration</a> cfg)</code></div>
|
|
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"> </div>
|
|
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="FlashContext.html" title="class in dev.relism.flash.extension">FlashContext</a></code></div>
|
|
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#ctx()" class="member-name-link">ctx</a>()</code></div>
|
|
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
|
|
<div class="block">Returns the <a href="FlashContext.html" title="class in dev.relism.flash.extension"><code>FlashContext</code></a> for this registrar.</div>
|
|
</div>
|
|
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="FlashApp.html" title="class in dev.relism.flash.extension">FlashApp</a></code></div>
|
|
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#install(dev.relism.flash.extension.FlashExtension)" class="member-name-link">install</a><wbr>(<a href="FlashExtension.html" title="interface in dev.relism.flash.extension">FlashExtension</a> ext)</code></div>
|
|
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
|
|
<div class="block">Registers an extension for two-phase installation at startup.</div>
|
|
</div>
|
|
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="FlashApp.html" title="class in dev.relism.flash.extension">FlashApp</a></code></div>
|
|
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#mount(java.lang.String,java.util.function.Consumer)" class="member-name-link">mount</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> namespace,
|
|
<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/function/Consumer.html" title="class or interface in java.util.function" class="external-link">Consumer</a><<a href="FlashScope.html" title="class in dev.relism.flash.extension">FlashScope</a>> configure)</code></div>
|
|
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
|
|
<div class="block">Mounts a scoped group of routes under <code>namespace</code>.</div>
|
|
</div>
|
|
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="FlashApp.html" title="class in dev.relism.flash.extension">FlashApp</a></code></div>
|
|
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#onException(dev.relism.flash.routing.AbstractRouter.ExceptionHandler)" class="member-name-link">onException</a><wbr>(<a href="../routing/AbstractRouter.ExceptionHandler.html" title="interface in dev.relism.flash.routing">AbstractRouter.ExceptionHandler</a> handler)</code></div>
|
|
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> </div>
|
|
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="FlashApp.html" title="class in dev.relism.flash.extension">FlashApp</a></code></div>
|
|
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#onNotFound(dev.relism.flash.models.SimpleHandler.FunctionalHandler)" class="member-name-link">onNotFound</a><wbr>(<a href="../models/SimpleHandler.FunctionalHandler.html" title="interface in dev.relism.flash.models">SimpleHandler.FunctionalHandler</a> handler)</code></div>
|
|
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> </div>
|
|
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="FlashApp.html" title="class in dev.relism.flash.extension">FlashApp</a></code></div>
|
|
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#start()" class="member-name-link">start</a>()</code></div>
|
|
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
|
|
<div class="block">Boots the server and starts accepting connections.</div>
|
|
</div>
|
|
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
|
|
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#startAndBlock()" class="member-name-link">startAndBlock</a>()</code></div>
|
|
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
|
|
<div class="block">Boots the server and blocks the calling thread until the server is stopped.</div>
|
|
</div>
|
|
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/concurrent/CompletableFuture.html" title="class or interface in java.util.concurrent" class="external-link">CompletableFuture</a><wbr><<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Void.html" title="class or interface in java.lang" class="external-link">Void</a>></code></div>
|
|
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#stop()" class="member-name-link">stop</a>()</code></div>
|
|
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> </div>
|
|
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="FlashApp.html" title="class in dev.relism.flash.extension">FlashApp</a></code></div>
|
|
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#ws(java.lang.String,dev.relism.flash.websocket.WebSocketHandler)" class="member-name-link">ws</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> path,
|
|
<a href="../websocket/WebSocketHandler.html" title="interface in dev.relism.flash.websocket">WebSocketHandler</a> handler)</code></div>
|
|
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
|
|
<div class="block">Registers a WebSocket endpoint at <code>path</code>.</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="inherited-list">
|
|
<h3 id="methods-inherited-from-class-dev.relism.flash.extension.FlashRegistrar">Methods inherited from class dev.relism.flash.extension.<a href="FlashRegistrar.html" title="class in dev.relism.flash.extension">FlashRegistrar</a></h3>
|
|
<code><a href="FlashRegistrar.html#connect(java.lang.String,dev.relism.flash.models.SimpleHandler.FunctionalHandler,dev.relism.flash.routing.Middleware...)">connect</a>, <a href="FlashRegistrar.html#delete(java.lang.String,dev.relism.flash.models.SimpleHandler.FunctionalHandler,dev.relism.flash.routing.Middleware...)">delete</a>, <a href="FlashRegistrar.html#get(java.lang.String,dev.relism.flash.models.SimpleHandler.FunctionalHandler,dev.relism.flash.routing.Middleware...)">get</a>, <a href="FlashRegistrar.html#head(java.lang.String,dev.relism.flash.models.SimpleHandler.FunctionalHandler,dev.relism.flash.routing.Middleware...)">head</a>, <a href="FlashRegistrar.html#instantiate(java.lang.Class)">instantiate</a>, <a href="FlashRegistrar.html#instantiateWs(java.lang.Class)">instantiateWs</a>, <a href="FlashRegistrar.html#options(java.lang.String,dev.relism.flash.models.SimpleHandler.FunctionalHandler,dev.relism.flash.routing.Middleware...)">options</a>, <a href="FlashRegistrar.html#patch(java.lang.String,dev.relism.flash.models.SimpleHandler.FunctionalHandler,dev.relism.flash.routing.Middleware...)">patch</a>, <a href="FlashRegistrar.html#post(java.lang.String,dev.relism.flash.models.SimpleHandler.FunctionalHandler,dev.relism.flash.routing.Middleware...)">post</a>, <a href="FlashRegistrar.html#purge(java.lang.String,dev.relism.flash.models.SimpleHandler.FunctionalHandler,dev.relism.flash.routing.Middleware...)">purge</a>, <a href="FlashRegistrar.html#put(java.lang.String,dev.relism.flash.models.SimpleHandler.FunctionalHandler,dev.relism.flash.routing.Middleware...)">put</a>, <a href="FlashRegistrar.html#scan(java.lang.String)">scan</a>, <a href="FlashRegistrar.html#trace(java.lang.String,dev.relism.flash.models.SimpleHandler.FunctionalHandler,dev.relism.flash.routing.Middleware...)">trace</a>, <a href="FlashRegistrar.html#use(dev.relism.flash.routing.Middleware...)">use</a></code></div>
|
|
<div class="inherited-list">
|
|
<h3 id="methods-inherited-from-class-java.lang.Object">Methods inherited from class java.lang.<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></h3>
|
|
<code><a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#clone()" title="class or interface in java.lang" class="external-link">clone</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang" class="external-link">equals</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#finalize()" title="class or interface in java.lang" class="external-link">finalize</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#getClass()" title="class or interface in java.lang" class="external-link">getClass</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#hashCode()" title="class or interface in java.lang" class="external-link">hashCode</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#notify()" title="class or interface in java.lang" class="external-link">notify</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#notifyAll()" title="class or interface in java.lang" class="external-link">notifyAll</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#toString()" title="class or interface in java.lang" class="external-link">toString</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#wait()" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#wait(long)" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#wait(long,int)" title="class or interface in java.lang" class="external-link">wait</a></code></div>
|
|
</section>
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
<section class="details">
|
|
<ul class="details-list">
|
|
<!-- ============ METHOD DETAIL ========== -->
|
|
<li>
|
|
<section class="method-details" id="method-detail">
|
|
<h2>Method Details</h2>
|
|
<ul class="member-list">
|
|
<li>
|
|
<section class="detail" id="create(int)">
|
|
<h3>create</h3>
|
|
<div class="member-signature"><span class="modifiers">public static</span> <span class="return-type"><a href="FlashApp.html" title="class in dev.relism.flash.extension">FlashApp</a></span> <span class="element-name">create</span><wbr><span class="parameters">(int port)</span></div>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="create(dev.relism.flash.extension.FlashConfiguration)">
|
|
<h3>create</h3>
|
|
<div class="member-signature"><span class="modifiers">public static</span> <span class="return-type"><a href="FlashApp.html" title="class in dev.relism.flash.extension">FlashApp</a></span> <span class="element-name">create</span><wbr><span class="parameters">(<a href="FlashConfiguration.html" title="class in dev.relism.flash.extension">FlashConfiguration</a> cfg)</span></div>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="mount(java.lang.String,java.util.function.Consumer)">
|
|
<h3>mount</h3>
|
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="FlashApp.html" title="class in dev.relism.flash.extension">FlashApp</a></span> <span class="element-name">mount</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> namespace,
|
|
<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/function/Consumer.html" title="class or interface in java.util.function" class="external-link">Consumer</a><<a href="FlashScope.html" title="class in dev.relism.flash.extension">FlashScope</a>> configure)</span></div>
|
|
<div class="block">Mounts a scoped group of routes under <code>namespace</code>. Routes accumulate in a
|
|
<a href="FlashScope.html" title="class in dev.relism.flash.extension"><code>FlashScope</code></a> builder and merge into this app's single flat router at startup —
|
|
pure syntactic sugar, no extra router involved.</div>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="ws(java.lang.String,dev.relism.flash.websocket.WebSocketHandler)">
|
|
<h3>ws</h3>
|
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="FlashApp.html" title="class in dev.relism.flash.extension">FlashApp</a></span> <span class="element-name">ws</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> path,
|
|
<a href="../websocket/WebSocketHandler.html" title="interface in dev.relism.flash.websocket">WebSocketHandler</a> handler)</span></div>
|
|
<div class="block">Registers a WebSocket endpoint at <code>path</code>.
|
|
Runs on the same virtual-thread model as HTTP handlers.
|
|
A path may have both an HTTP handler and a WS endpoint simultaneously.</div>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="onException(dev.relism.flash.routing.AbstractRouter.ExceptionHandler)">
|
|
<h3>onException</h3>
|
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="FlashApp.html" title="class in dev.relism.flash.extension">FlashApp</a></span> <span class="element-name">onException</span><wbr><span class="parameters">(<a href="../routing/AbstractRouter.ExceptionHandler.html" title="interface in dev.relism.flash.routing">AbstractRouter.ExceptionHandler</a> handler)</span></div>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="onNotFound(dev.relism.flash.models.SimpleHandler.FunctionalHandler)">
|
|
<h3>onNotFound</h3>
|
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="FlashApp.html" title="class in dev.relism.flash.extension">FlashApp</a></span> <span class="element-name">onNotFound</span><wbr><span class="parameters">(<a href="../models/SimpleHandler.FunctionalHandler.html" title="interface in dev.relism.flash.models">SimpleHandler.FunctionalHandler</a> handler)</span></div>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="ctx()">
|
|
<h3>ctx</h3>
|
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="FlashContext.html" title="class in dev.relism.flash.extension">FlashContext</a></span> <span class="element-name">ctx</span>()</div>
|
|
<div class="block"><span class="description-from-type-label">Description copied from class: <code><a href="FlashRegistrar.html#ctx()">FlashRegistrar</a></code></span></div>
|
|
<div class="block">Returns the <a href="FlashContext.html" title="class in dev.relism.flash.extension"><code>FlashContext</code></a> for this registrar.</div>
|
|
<dl class="notes">
|
|
<dt>Specified by:</dt>
|
|
<dd><code><a href="FlashRegistrar.html#ctx()">ctx</a></code> in class <code><a href="FlashRegistrar.html" title="class in dev.relism.flash.extension">FlashRegistrar</a><<a href="FlashApp.html" title="class in dev.relism.flash.extension">FlashApp</a>></code></dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="install(dev.relism.flash.extension.FlashExtension)">
|
|
<h3>install</h3>
|
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="FlashApp.html" title="class in dev.relism.flash.extension">FlashApp</a></span> <span class="element-name">install</span><wbr><span class="parameters">(<a href="FlashExtension.html" title="interface in dev.relism.flash.extension">FlashExtension</a> ext)</span></div>
|
|
<div class="block">Registers an extension for two-phase installation at startup.
|
|
Install order is irrelevant — all <a href="FlashExtension.html#provide(dev.relism.flash.extension.FlashContext)"><code>FlashExtension.provide(dev.relism.flash.extension.FlashContext)</code></a> calls complete
|
|
before any <a href="FlashExtension.html#routes(dev.relism.flash.extension.FlashRegistrar,dev.relism.flash.extension.FlashContext)"><code>FlashExtension.routes(dev.relism.flash.extension.FlashRegistrar<?>, dev.relism.flash.extension.FlashContext)</code></a> call begins.
|
|
Extensions are sorted by <a href="FlashExtension.html#priority()"><code>FlashExtension.priority()</code></a> before execution.</div>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="start()">
|
|
<h3>start</h3>
|
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="FlashApp.html" title="class in dev.relism.flash.extension">FlashApp</a></span> <span class="element-name">start</span>()</div>
|
|
<div class="block">Boots the server and starts accepting connections. Returns immediately — the
|
|
accept loop runs on a background platform thread.
|
|
|
|
<p>Use <a href="#startAndBlock()"><code>startAndBlock()</code></a> in <code>main()</code> if you have no other work to do
|
|
after startup.</div>
|
|
<dl class="notes">
|
|
<dt>Returns:</dt>
|
|
<dd><code>this</code> for storing or chaining (e.g. <code>.start().ctx().require(...)</code>)</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="startAndBlock()">
|
|
<h3>startAndBlock</h3>
|
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">startAndBlock</span>()</div>
|
|
<div class="block">Boots the server and blocks the calling thread until the server is stopped.
|
|
Suitable for the end of <code>main()</code> — no need to keep the JVM alive manually.</div>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="stop()">
|
|
<h3>stop</h3>
|
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/concurrent/CompletableFuture.html" title="class or interface in java.util.concurrent" class="external-link">CompletableFuture</a><<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Void.html" title="class or interface in java.lang" class="external-link">Void</a>></span> <span class="element-name">stop</span>()</div>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="addRoute(dev.relism.flash.http.HttpMethod,java.lang.String,dev.relism.flash.models.RequestHandler,java.util.List)">
|
|
<h3>addRoute</h3>
|
|
<div class="member-signature"><span class="modifiers">protected</span> <span class="return-type">void</span> <span class="element-name">addRoute</span><wbr><span class="parameters">(<a href="../http/HttpMethod.html" title="enum class in dev.relism.flash.http">HttpMethod</a> method,
|
|
<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> path,
|
|
<a href="../models/RequestHandler.html" title="class in dev.relism.flash.models">RequestHandler</a> handler,
|
|
<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a><<a href="../routing/Middleware.html" title="interface in dev.relism.flash.routing">Middleware</a>> mw)</span></div>
|
|
<div class="block"><span class="description-from-type-label">Description copied from class: <code><a href="FlashRegistrar.html#addRoute(dev.relism.flash.http.HttpMethod,java.lang.String,dev.relism.flash.models.RequestHandler,java.util.List)">FlashRegistrar</a></code></span></div>
|
|
<div class="block">Adds a route immediately to this registrar's deferred compilation list.
|
|
Subclasses may prepend a namespace prefix and inject scope middlewares before storing.</div>
|
|
<dl class="notes">
|
|
<dt>Specified by:</dt>
|
|
<dd><code><a href="FlashRegistrar.html#addRoute(dev.relism.flash.http.HttpMethod,java.lang.String,dev.relism.flash.models.RequestHandler,java.util.List)">addRoute</a></code> in class <code><a href="FlashRegistrar.html" title="class in dev.relism.flash.extension">FlashRegistrar</a><<a href="FlashApp.html" title="class in dev.relism.flash.extension">FlashApp</a>></code></dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="addWsRoute(java.lang.String,dev.relism.flash.websocket.WebSocketEndpoint)">
|
|
<h3>addWsRoute</h3>
|
|
<div class="member-signature"><span class="modifiers">protected</span> <span class="return-type">void</span> <span class="element-name">addWsRoute</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> path,
|
|
<a href="../websocket/WebSocketEndpoint.html" title="class in dev.relism.flash.websocket">WebSocketEndpoint</a> endpoint)</span></div>
|
|
<dl class="notes">
|
|
<dt>Specified by:</dt>
|
|
<dd><code><a href="FlashRegistrar.html#addWsRoute(java.lang.String,dev.relism.flash.websocket.WebSocketEndpoint)">addWsRoute</a></code> in class <code><a href="FlashRegistrar.html" title="class in dev.relism.flash.extension">FlashRegistrar</a><<a href="FlashApp.html" title="class in dev.relism.flash.extension">FlashApp</a>></code></dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="addMiddleware(dev.relism.flash.routing.Middleware)">
|
|
<h3>addMiddleware</h3>
|
|
<div class="member-signature"><span class="modifiers">protected</span> <span class="return-type">void</span> <span class="element-name">addMiddleware</span><wbr><span class="parameters">(<a href="../routing/Middleware.html" title="interface in dev.relism.flash.routing">Middleware</a> mw)</span></div>
|
|
<div class="block"><span class="description-from-type-label">Description copied from class: <code><a href="FlashRegistrar.html#addMiddleware(dev.relism.flash.routing.Middleware)">FlashRegistrar</a></code></span></div>
|
|
<div class="block">Registers a middleware in this registrar's own scope (global or scope-level).</div>
|
|
<dl class="notes">
|
|
<dt>Specified by:</dt>
|
|
<dd><code><a href="FlashRegistrar.html#addMiddleware(dev.relism.flash.routing.Middleware)">addMiddleware</a></code> in class <code><a href="FlashRegistrar.html" title="class in dev.relism.flash.extension">FlashRegistrar</a><<a href="FlashApp.html" title="class in dev.relism.flash.extension">FlashApp</a>></code></dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
<!-- ========= END OF CLASS DATA ========= -->
|
|
</main>
|
|
<footer role="contentinfo">
|
|
<hr>
|
|
<p class="legal-copy"><small>Copyright © 2026. All rights reserved.</small></p>
|
|
</footer>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|