Skip to content

Commit b141642

Browse files
committed
server: clean up
1 parent ce43060 commit b141642

File tree

10 files changed

+15
-51
lines changed

10 files changed

+15
-51
lines changed

docs/asciidoc/body.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,14 +158,14 @@ Response encoding is achieved using the javadoc:MessageEncoder[] functional inte
158158
----
159159
public interface MessageEncoder {
160160
161-
DataBuffer encode(@NonNull Context ctx, @NonNull Object value) throws Exception;
161+
Output encode(@NonNull Context ctx, @NonNull Object value) throws Exception;
162162
}
163163
----
164164

165165
MessageEncoder has a single `encode` method that accepts two input arguments: `(context, value)` and
166166
produces a result.
167167

168-
The javadoc:buffer.DataBuffer[buffer] works like `java.nio.ByteBuffer` and it is used internally
168+
The javadoc:output.Output[] works like `java.nio.ByteBuffer` and it is used internally
169169
for performance reason.
170170

171171
.JSON example:

docs/asciidoc/migration/4.x.adoc

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,6 @@ This is a **work in progress** document, if something is wrong or missing please
1010

1111
- Java 21 as minimum
1212

13-
==== module-info.java
14-
15-
Jooby is now compatible with Java Module system.
16-
17-
Almost all Jooby components are now Java Modules, but not all them. For those where wasn't
18-
possible the Jooby module contains the `Automatic-Module-Name` manifest entry.
19-
2013
==== Buffer API
2114

2215
The package `io.jooby.buffer` is gone. It was replaced by `io.jooby.output` these classes
@@ -25,7 +18,7 @@ performance.
2518

2619
==== Value API
2720

28-
The new package is now `io.jooby.value`. The API has now decoupled from javadoc:Context[]
21+
The new package is now `io.jooby.value`. The API is now decoupled from javadoc:Context[]
2922
in future release will be the basis of a new configuration system.
3023

3124
Also, the `io.jooby.ValueNode` and `io.jooby.ValueNodeConverter` are gone.

docs/asciidoc/mvc-api.adoc

Lines changed: 9 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
== MVC API
22

3-
MVC API is an alternative way to define routes in Jooby. It generates source code to define and execute routes.
3+
MVC API is an alternative way to define routes in Jooby. It generates source code to define and execute routes. The generated class are suffixed with `_` (underscore).
44

55
If you use Gradle 6.0 or a later version, you can leverage incremental annotation processing support,
66
which means that Gradle only compiles classes that changed since the last compilation, and only runs
@@ -14,8 +14,7 @@ The annotation processor has two options allowing you to control incremental pro
1414
tasks.withType(JavaCompile) {
1515
options.compilerArgs += [
1616
'-parameters',
17-
'-Ajooby.incremental=true',
18-
'-Ajooby.services=true'
17+
'-Ajooby.incremental=true'
1918
]
2019
}
2120
----
@@ -26,26 +25,13 @@ tasks.withType(JavaCompile) {
2625
kapt {
2726
arguments {
2827
arg('jooby.incremental', true)
29-
arg('jooby.services', true)
3028
}
3129
}
3230
----
3331

3432
By setting `jooby.incremental` to `false` you can disable incremental processing entirely, which means
3533
the regardless what's changed, the whole project is recompiled each time. Defaults to `true`.
3634

37-
The generated bytecode is responsible for registering routes, retrieving and invoking your controllers.
38-
Jooby loads these classes with Java's service-provider loading facility by default. To make this work,
39-
a so-called _provider configuration_ file needs to be created alongside with the generated classes.
40-
The content of this file is dependent on all MVC controllers, therefore the annotation processor
41-
must operate in *aggregating* mode, in which _all generated_ classes are rewritten each time.
42-
43-
You may disable the generation of the provider configuration file by setting `jooby.services` to `false`
44-
(the default is `true`). This allows the annotation processor to run in *isolating* mode: if you
45-
change e.g. `HelloController` only, then only the class responsible for registering the routes for
46-
`HelloController` will be regenerated. This however will force Jooby to load the generated classes
47-
with reflection instead of the service-provider loading facility.
48-
4935
The package `annotation` contains all the annotations available for MVC routes.
5036

5137
.MVC API:
@@ -681,7 +667,7 @@ logic in the javadoc:ExecutionMode[EVENT_LOOP]:
681667
682668
public class App extends Jooby {
683669
{
684-
mvc(new MyController());
670+
mvc(new MyController_());
685671
}
686672
687673
public static void main(String[] args) {
@@ -697,7 +683,7 @@ import io.jooby.*
697683
698684
fun main(args: Array<String>) {
699685
runApp(args, EVENT_LOOP) { <1>
700-
mvc(MyController())
686+
mvc(MyController_())
701687
}
702688
}
703689
----
@@ -713,7 +699,7 @@ Similarly, if you need to run all mvc routes in the javadoc:ExecutionMode[WORKER
713699
public class App extends Jooby {
714700
{
715701
dispatch(() -> {
716-
mvc(new MyBlockingController()); <1>
702+
mvc(new MyBlockingController_()); <1>
717703
});
718704
}
719705
@@ -731,7 +717,7 @@ import io.jooby.*
731717
fun main(args: Array<String>) {
732718
runApp(args, EVENT_LOOP) {
733719
dispatch {
734-
mvc(MyBlockingController()) <1>
720+
mvc(MyBlockingController_()) <1>
735721
}
736722
}
737723
}
@@ -823,7 +809,7 @@ Executor must be registered using via services or executor utility method:
823809
{
824810
executor("single", Executors.newSingleThreadExecutor());
825811
826-
mvc(new MyController());
812+
mvc(new MyController_());
827813
}
828814
----
829815

@@ -833,7 +819,7 @@ Executor must be registered using via services or executor utility method:
833819
{
834820
executor("single", Executors.newSingleThreadExecutor())
835821
836-
mvc(MyController())
822+
mvc(MyController_())
837823
}
838824
----
839825

@@ -954,15 +940,9 @@ on them (mostly annotations processors).
954940
<compilerArg>
955941
-Ajooby.incremental=true
956942
</compilerArg>
957-
<compilerArg>
958-
-Ajooby.services=true
959-
</compilerArg>
960943
<compilerArg>
961944
-Ajooby.skipAttributeAnnotations=FooAnnotation,BarAnnotation
962945
</compilerArg>
963-
<compilerArg>
964-
-Ajooby.handler=myhandler
965-
</compilerArg>
966946
</compilerArgs>
967947
</configuration>
968948
</plugin>
@@ -976,9 +956,7 @@ tasks.withType(JavaCompile) {
976956
'-parameters',
977957
'-Ajooby.debug=false',
978958
'-Ajooby.incremental=true',
979-
'-Ajooby.services=true',
980-
'-Ajooby.skipAttributeAnnotations=FooAnnotation,BarAnnotation',
981-
'-Ajooby.handler=myhandler'
959+
'-Ajooby.skipAttributeAnnotations=FooAnnotation,BarAnnotation'
982960
]
983961
}
984962
----

jooby/src/main/java/io/jooby/Jooby.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1238,7 +1238,6 @@ public static void runApp(
12381238
var apps = new ArrayList<Jooby>();
12391239
var targetServer = server.getLoggerOff().isEmpty() ? server : MutedServer.mute(server);
12401240
try {
1241-
// Init context static var
12421241
for (var factory : provider) {
12431242
var app = createApp(server, executionMode, factory);
12441243
/*

jooby/src/main/java/io/jooby/ServerOptions.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,6 @@ public class ServerOptions {
196196
if (conf.hasPath("server.http2")) {
197197
options.setHttp2(conf.getBoolean("server.http2"));
198198
}
199-
200199
return Optional.of(options);
201200
}
202201
return Optional.empty();

jooby/src/main/java/io/jooby/SslOptions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ public static SslOptions selfSigned(final String type) {
508508
* @param key Path to use for loading SSL options. Required.
509509
* @return SSl options or empty.
510510
*/
511-
public static @NonNull Optional<SslOptions> from(@NonNull Config conf, String... key) {
511+
static @NonNull Optional<SslOptions> from(@NonNull Config conf, String... key) {
512512
return Stream.of(key)
513513
.filter(conf::hasPath)
514514
.findFirst()

modules/jooby-cli/src/main/resources/cli/build.gradle.hbs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ tasks.withType(JavaCompile) {
5454
'-parameters',
5555
{{#if apt}}
5656
'-Ajooby.incremental=true',
57-
'-Ajooby.services=true',
5857
'-Ajooby.debug=false'
5958
{{/if}}
6059
]

modules/jooby-cli/src/main/resources/cli/build.gradle.kts.hbs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ tasks {
6060
kapt {
6161
arguments {
6262
arg("jooby.incremental", true)
63-
arg("jooby.services", true)
6463
arg("jooby.debug", false)
6564
}
6665
}

modules/jooby-cli/src/main/resources/cli/docker.maven.hbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
FROM maven:3-eclipse-temurin-17 as build
1+
FROM maven:3-eclipse-temurin-21 as build
22
WORKDIR /{{artifactId}}
33
COPY pom.xml pom.xml
44
COPY src src
55
COPY conf conf
66
RUN mvn package
77

8-
FROM eclipse-temurin:17-jdk
8+
FROM eclipse-temurin:21-jdk
99
WORKDIR /{{artifactId}}
1010
{{#if stork}}
1111
COPY --from=build /{{artifactId}}/target/stork .

modules/jooby-cli/src/main/resources/cli/pom.xml.hbs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,6 @@
9393
<annotationProcessorArg>
9494
jooby.debug=false
9595
</annotationProcessorArg>
96-
<annotationProcessorArg>
97-
jooby.services=true
98-
</annotationProcessorArg>
9996
</annotationProcessorArgs>
10097
</configuration>
10198
</execution>

0 commit comments

Comments
 (0)