File tree Expand file tree Collapse file tree 4 files changed +6
-7
lines changed
test-helidon/src/main/java/org/example
test-javalin/src/main/java/org/example/myapp
test-spark/src/main/java/org/example/web Expand file tree Collapse file tree 4 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ get all the WebRoutes and register them with Javalin using.
5555fun main(args: Array<String>) {
5656
5757 // get all the webRoutes
58- val webRoutes = SystemContext. getBeans (WebRoutes ::class .java )
58+ val webRoutes = ApplicationScope. list (WebRoutes ::class .java )
5959
6060 val javalin = Javalin.create ()
6161
Original file line number Diff line number Diff line change 11package org .example ;
22
3- import io .avaje .inject .SystemContext ;
3+ import io .avaje .inject .ApplicationScope ;
44import io .helidon .health .HealthSupport ;
55import io .helidon .media .jackson .JacksonSupport ;
66import io .helidon .metrics .MetricsSupport ;
@@ -58,7 +58,7 @@ private static Routing createRouting() {
5858 .register (MetricsSupport .create ())
5959 .register ("/greet" , new GreetService ());
6060
61- SystemContext . getBeans (Service .class ).forEach (builder ::register );
61+ ApplicationScope . list (Service .class ).forEach (builder ::register );
6262
6363 return builder .build ();
6464 }
Original file line number Diff line number Diff line change 44import io .avaje .http .api .InvalidTypeArgumentException ;
55import io .avaje .http .api .ValidationException ;
66import io .avaje .http .api .WebRoutes ;
7- import io .avaje .inject .SystemContext ;
7+ import io .avaje .inject .ApplicationScope ;
88import io .javalin .Javalin ;
99import io .javalin .http .staticfiles .Location ;
1010import io .swagger .v3 .oas .annotations .OpenAPIDefinition ;
@@ -71,7 +71,7 @@ public static Javalin start(int port) {
7171 });
7272
7373 // All WebRoutes / Controllers ... from DI Context
74- List <WebRoutes > webRoutes = SystemContext . getBeans (WebRoutes .class );
74+ List <WebRoutes > webRoutes = ApplicationScope . list (WebRoutes .class );
7575 app .routes (() -> webRoutes .forEach (WebRoutes ::registerRoutes ));
7676
7777 app .start (port );
Original file line number Diff line number Diff line change 11package org .example .web ;
22
33import io .avaje .http .api .WebRoutes ;
4- import io .avaje .inject .SystemContext ;
54import spark .Spark ;
65
76public class App {
@@ -17,7 +16,7 @@ public static void main(String[] args) {
1716 return "hello" ;
1817 });
1918
20- SystemContext . getBeans (WebRoutes .class )
19+ ApplicationScope . list (WebRoutes .class )
2120 .forEach (WebRoutes ::registerRoutes );
2221 }
2322}
You can’t perform that action at this time.
0 commit comments