33import java .util .Map ;
44import java .util .concurrent .Executor ;
55import java .util .concurrent .Executors ;
6- import java .util .concurrent .ThreadFactory ;
76import java .util .function .Consumer ;
87
98import javax .net .ssl .SSLContext ;
1211import io .avaje .jex .spi .JsonService ;
1312import io .avaje .jex .spi .TemplateRender ;
1413
15- /**
16- * Jex configuration.
17- */
14+ /** Jex configuration. */
1815public sealed interface JexConfig permits DJexConfig {
1916
20- /**
21- * Set the port to use. Defaults to 7001.
22- */
17+ /** Set the port to use. Defaults to 7001. */
2318 JexConfig port (int port );
2419
25- /**
26- * Set the host to bind to.
27- */
20+ /** Set the host to bind to. */
2821 JexConfig host (String host );
2922
30- /**
31- * Set the contextPath.
32- */
23+ /** Set the contextPath. */
3324 JexConfig contextPath (String contextPath );
3425
35- /**
36- * Set to true to include the health endpoint. Defaults to true.
37- */
26+ /** Set to true to include the health endpoint. Defaults to true. */
3827 JexConfig health (boolean health );
3928
40- /**
41- * Set to true to ignore trailing slashes. Defaults to true.
42- */
29+ /** Set to true to ignore trailing slashes. Defaults to true. */
4330 JexConfig ignoreTrailingSlashes (boolean ignoreTrailingSlashes );
4431
45- /**
46- * Set to true to pre compress static files. Defaults to false.
47- */
48- JexConfig preCompressStaticFiles (boolean preCompressStaticFiles );
49-
50- /**
51- * Set the JsonService to use.
52- */
32+ /** Set the JsonService to use. */
5333 JexConfig jsonService (JsonService jsonService );
5434
5535 /**
5636 * Register a template renderer explicitly.
5737 *
5838 * @param extension The extension the renderer applies to.
59- * @param renderer The template render to use for the given extension.
39+ * @param renderer The template render to use for the given extension.
6040 */
6141 JexConfig renderer (String extension , TemplateRender renderer );
6242
63- /**
64- * Set executor for serving requests.
65- */
43+ /** Set executor for serving requests. */
6644 JexConfig executor (Executor executor );
6745
6846 /**
69- * Executor for serving requests. Defaults to a {@link Executors#newVirtualThreadPerTaskExecutor()}
47+ * Executor for serving requests. Defaults to a {@link
48+ * Executors#newVirtualThreadPerTaskExecutor()}
7049 */
7150 Executor executor ();
7251
73- /**
74- * Return the port to use.
75- */
52+ /** Return the port to use. */
7653 int port ();
7754
78- /**
79- * Return the host to bind to.
80- */
55+ /** Return the host to bind to. */
8156 String host ();
8257
83- /**
84- * Return the contextPath to use.
85- */
58+ /** Return the contextPath to use. */
8659 String contextPath ();
8760
88- /**
89- * Return true to include the health endpoint.
90- */
61+ /** Return true to include the health endpoint. */
9162 boolean health ();
9263
93- /**
94- * Return true to ignore trailing slashes.
95- */
64+ /** Return true to ignore trailing slashes. */
9665 boolean ignoreTrailingSlashes ();
9766
98- /**
99- * Return true if static files should be pre compressed.
100- */
101- boolean preCompressStaticFiles ();
102-
103- /**
104- * Return the JsonService.
105- */
67+ /** Return the JsonService. */
10668 JsonService jsonService ();
10769
10870 /** Return the ssl context if https is enabled. */
@@ -111,13 +73,15 @@ public sealed interface JexConfig permits DJexConfig {
11173 /** Enable https with the provided SSLContext. */
11274 JexConfig sslContext (SSLContext ssl );
11375
114- /**
115- * Return the template renderers registered by extension.
116- */
76+ /** Return the template renderers registered by extension. */
11777 Map <String , TemplateRender > renderers ();
11878
79+ /** configure compression via consumer */
11980 JexConfig compression (Consumer <CompressionConfig > consumer );
12081
82+ /** get compression configuration */
12183 CompressionConfig compression ();
12284
85+ /** whether to disable JexPlugins loaded from ServiceLoader */
86+ JexConfig disableSpiPlugins ();
12387}
0 commit comments