diff --git a/Jaxrs/Basic/pom.xml b/Jaxrs/Basic/pom.xml
index daf7c3f..a806bc0 100644
--- a/Jaxrs/Basic/pom.xml
+++ b/Jaxrs/Basic/pom.xml
@@ -25,6 +25,12 @@
guiced-undertow
+
+ com.guicedee
+ guice-injection
+
+
+
org.junit.jupiter
junit-jupiter
diff --git a/Jaxrs/Basic/src/main/java/com/guicedee/examples/jaxrs/basic/HelloWorld.java b/Jaxrs/Basic/src/main/java/com/guicedee/examples/jaxrs/basic/HelloWorld.java
index 03b6d57..655b43f 100644
--- a/Jaxrs/Basic/src/main/java/com/guicedee/examples/jaxrs/basic/HelloWorld.java
+++ b/Jaxrs/Basic/src/main/java/com/guicedee/examples/jaxrs/basic/HelloWorld.java
@@ -1,33 +1,36 @@
package com.guicedee.examples.jaxrs.basic;
-import com.guicedee.guicedinjection.*;
-import com.guicedee.guicedservlets.undertow.*;
-import io.undertow.*;
-import jakarta.ws.rs.*;
+import com.guicedee.client.IGuiceContext;
+import com.guicedee.guicedservlets.undertow.GuicedUndertow;
+import io.undertow.Undertow;
+import jakarta.ws.rs.GET;
+import jakarta.ws.rs.Path;
+import jakarta.ws.rs.PathParam;
+import jakarta.ws.rs.Produces;
-import java.time.*;
-import java.time.temporal.*;
+import java.time.LocalDateTime;
+import java.time.temporal.ChronoUnit;
@Path("hello")
@Produces("application/json")
public class HelloWorld
{
- @GET
- @Path("{name}")
- public String hello(@PathParam("name") final String name)
- {
- return "Hello! " + name;
- }
-
- public static void main(String[] args) throws Exception
- {
- LocalDateTime startTime = LocalDateTime.now();
-
- //optional for class scanning optimization
- GuiceContext.registerModule("com.guicedee.examples.jaxrs.basic");
- Undertow boot = GuicedUndertow.boot("0.0.0.0", 6003);
- LocalDateTime endTime = LocalDateTime.now();
-
- System.out.println("Started in " + ChronoUnit.MILLIS.between(startTime, endTime) + "ms");
- }
+ @GET
+ @Path("{name}")
+ public String hello(@PathParam("name") final String name)
+ {
+ return "Hello! " + name;
+ }
+
+ public static void main(String[] args) throws Exception
+ {
+ LocalDateTime startTime = LocalDateTime.now();
+
+ //optional for class scanning optimization
+ IGuiceContext.registerModule("com.guicedee.examples.jaxrs.basic");
+ Undertow boot = GuicedUndertow.boot("0.0.0.0", 6003);
+ LocalDateTime endTime = LocalDateTime.now();
+
+ System.out.println("Started in " + ChronoUnit.MILLIS.between(startTime, endTime) + "ms");
+ }
}
diff --git a/Jaxrs/Basic/src/main/java/module-info.java b/Jaxrs/Basic/src/main/java/module-info.java
index 2212bb6..872cff9 100644
--- a/Jaxrs/Basic/src/main/java/module-info.java
+++ b/Jaxrs/Basic/src/main/java/module-info.java
@@ -1,9 +1,10 @@
module com.guicedee.examples.jaxrs.basic {
+ requires com.guicedee.guicedinjection;
requires com.guicedee.guicedservlets.rest;
requires com.guicedee.guicedservlets.undertow;
requires java.net.http;
-
- exports com.guicedee.examples.jaxrs.basic;
+
+ exports com.guicedee.examples.jaxrs.basic;
opens com.guicedee.examples.jaxrs.basic to com.google.guice, com.fasterxml.jackson.databind, org.apache.cxf;
}
diff --git a/Jaxrs/Basic/src/test/java/com/guicedee/examples/jaxrs/basic/tests/HelloWorldTest.java b/Jaxrs/Basic/src/test/java/com/guicedee/examples/jaxrs/basic/tests/HelloWorldTest.java
index e97dba4..b41835a 100644
--- a/Jaxrs/Basic/src/test/java/com/guicedee/examples/jaxrs/basic/tests/HelloWorldTest.java
+++ b/Jaxrs/Basic/src/test/java/com/guicedee/examples/jaxrs/basic/tests/HelloWorldTest.java
@@ -32,6 +32,6 @@ public void testWorld() throws Exception
System.out.println(response.body());
assertEquals(200, response.statusCode());
- GuiceContext.destroy();
+ GuiceContext.instance().destroy();
}
}
\ No newline at end of file
diff --git a/Jaxrs/Basic/src/test/java/module-info.java b/Jaxrs/Basic/src/test/java/module-info.java
index c673775..c448b36 100644
--- a/Jaxrs/Basic/src/test/java/module-info.java
+++ b/Jaxrs/Basic/src/test/java/module-info.java
@@ -6,6 +6,7 @@
requires com.guicedee.guicedservlets.rest;
requires com.guicedee.guicedservlets.undertow;
+ requires com.guicedee.guicedinjection;
opens com.guicedee.examples.jaxrs.basic.tests to com.google.guice, com.fasterxml.jackson.databind, org.apache.cxf,org.junit.platform.commons;
}
\ No newline at end of file
diff --git a/Jaxrs/Binding/pom.xml b/Jaxrs/Binding/pom.xml
index d9bd658..93613d0 100644
--- a/Jaxrs/Binding/pom.xml
+++ b/Jaxrs/Binding/pom.xml
@@ -25,6 +25,16 @@
com.guicedee.servlets
guiced-rest-services
+
+ com.guicedee
+ guice-inject-client
+
+
+ com.guicedee
+ guice-injection
+
+
+
com.guicedee.servlets
guiced-openapi
diff --git a/Jaxrs/Binding/src/main/java/com/guicedee/examples/jaxrs/binding/BootJaxRSBindings.java b/Jaxrs/Binding/src/main/java/com/guicedee/examples/jaxrs/binding/BootJaxRSBindings.java
index a11dad3..cc46e4e 100644
--- a/Jaxrs/Binding/src/main/java/com/guicedee/examples/jaxrs/binding/BootJaxRSBindings.java
+++ b/Jaxrs/Binding/src/main/java/com/guicedee/examples/jaxrs/binding/BootJaxRSBindings.java
@@ -1,15 +1,15 @@
package com.guicedee.examples.jaxrs.binding;
-import com.guicedee.guicedinjection.GuiceContext;
+import com.guicedee.client.IGuiceContext;
import com.guicedee.guicedservlets.undertow.GuicedUndertow;
import io.undertow.Undertow;
public class BootJaxRSBindings
{
- public static void main(String... args) throws Exception
- {
- GuiceContext.registerModule("com.guicedee.examples.jaxrs.binding");
- Undertow undertow = GuicedUndertow.boot("0.0.0.0", 6003);
- }
+ public static void main(String... args) throws Exception
+ {
+ IGuiceContext.registerModule("com.guicedee.examples.jaxrs.binding");
+ Undertow undertow = GuicedUndertow.boot("0.0.0.0", 6003);
+ }
}
diff --git a/Jaxrs/Binding/src/main/java/com/guicedee/examples/jaxrs/binding/resources/RestApplication.java b/Jaxrs/Binding/src/main/java/com/guicedee/examples/jaxrs/binding/resources/RestApplication.java
index 4f656a6..9e1534b 100644
--- a/Jaxrs/Binding/src/main/java/com/guicedee/examples/jaxrs/binding/resources/RestApplication.java
+++ b/Jaxrs/Binding/src/main/java/com/guicedee/examples/jaxrs/binding/resources/RestApplication.java
@@ -1,6 +1,6 @@
package com.guicedee.examples.jaxrs.binding.resources;
-import com.guicedee.guicedinjection.GuiceContext;
+import com.guicedee.client.IGuiceContext;
import jakarta.ws.rs.core.Application;
import java.util.HashSet;
@@ -9,20 +9,20 @@
public class RestApplication extends Application
{
- private final Set> classes = new HashSet<>();
- private final Set