From d9c503700012ae02bafafa7bbce8f0ab569a0960 Mon Sep 17 00:00:00 2001 From: "Neil J. L. Benn" Date: Sat, 15 Jun 2024 11:20:36 +0200 Subject: [PATCH] Remove the @Blocking annotation from ProductsResource (#16) --- .../java/com/lunatech/training/quarkus/ProductsResource.java | 3 --- .../java/com/lunatech/training/quarkus/ProductsResource.java | 3 --- .../java/com/lunatech/training/quarkus/ProductsResource.java | 4 ---- .../java/com/lunatech/training/quarkus/ProductsResource.java | 4 ---- .../java/com/lunatech/training/quarkus/ProductsResource.java | 4 ---- .../java/com/lunatech/training/quarkus/ProductsResource.java | 4 ---- 6 files changed, 22 deletions(-) diff --git a/code/exercise_005_products_from_the_database/src/main/java/com/lunatech/training/quarkus/ProductsResource.java b/code/exercise_005_products_from_the_database/src/main/java/com/lunatech/training/quarkus/ProductsResource.java index 10165ef..4b4fbeb 100644 --- a/code/exercise_005_products_from_the_database/src/main/java/com/lunatech/training/quarkus/ProductsResource.java +++ b/code/exercise_005_products_from_the_database/src/main/java/com/lunatech/training/quarkus/ProductsResource.java @@ -2,7 +2,6 @@ import io.quarkus.qute.Template; import io.quarkus.qute.TemplateInstance; -import io.smallrye.common.annotation.Blocking; import jakarta.inject.Inject; import jakarta.ws.rs.GET; @@ -20,14 +19,12 @@ public class ProductsResource { Template details; @GET - @Blocking public TemplateInstance products() { return catalogue.data("products", Product.listAll()); } @GET @Path("{productId}") - @Blocking public TemplateInstance details(@PathParam("productId") Long productId) { Product product = Product.findById(productId); if(product != null) { diff --git a/code/exercise_006_CDI_and_ArC/src/main/java/com/lunatech/training/quarkus/ProductsResource.java b/code/exercise_006_CDI_and_ArC/src/main/java/com/lunatech/training/quarkus/ProductsResource.java index 10165ef..4b4fbeb 100644 --- a/code/exercise_006_CDI_and_ArC/src/main/java/com/lunatech/training/quarkus/ProductsResource.java +++ b/code/exercise_006_CDI_and_ArC/src/main/java/com/lunatech/training/quarkus/ProductsResource.java @@ -2,7 +2,6 @@ import io.quarkus.qute.Template; import io.quarkus.qute.TemplateInstance; -import io.smallrye.common.annotation.Blocking; import jakarta.inject.Inject; import jakarta.ws.rs.GET; @@ -20,14 +19,12 @@ public class ProductsResource { Template details; @GET - @Blocking public TemplateInstance products() { return catalogue.data("products", Product.listAll()); } @GET @Path("{productId}") - @Blocking public TemplateInstance details(@PathParam("productId") Long productId) { Product product = Product.findById(productId); if(product != null) { diff --git a/code/exercise_007_Convert_endpoints_to_JSON/src/main/java/com/lunatech/training/quarkus/ProductsResource.java b/code/exercise_007_Convert_endpoints_to_JSON/src/main/java/com/lunatech/training/quarkus/ProductsResource.java index 7611246..b216d1f 100644 --- a/code/exercise_007_Convert_endpoints_to_JSON/src/main/java/com/lunatech/training/quarkus/ProductsResource.java +++ b/code/exercise_007_Convert_endpoints_to_JSON/src/main/java/com/lunatech/training/quarkus/ProductsResource.java @@ -1,7 +1,5 @@ package com.lunatech.training.quarkus; -import io.smallrye.common.annotation.Blocking; - import jakarta.ws.rs.*; import jakarta.ws.rs.core.MediaType; import java.util.List; @@ -11,14 +9,12 @@ public class ProductsResource { @GET - @Blocking public List products() { return Product.listAll(); } @GET @Path("{productId}") - @Blocking public Product details(@PathParam("productId") Long productId) { Product product = Product.findById(productId); if (product != null) { diff --git a/code/exercise_008_Adding_REST_data_Panache/src/main/java/com/lunatech/training/quarkus/ProductsResource.java b/code/exercise_008_Adding_REST_data_Panache/src/main/java/com/lunatech/training/quarkus/ProductsResource.java index 7611246..b216d1f 100644 --- a/code/exercise_008_Adding_REST_data_Panache/src/main/java/com/lunatech/training/quarkus/ProductsResource.java +++ b/code/exercise_008_Adding_REST_data_Panache/src/main/java/com/lunatech/training/quarkus/ProductsResource.java @@ -1,7 +1,5 @@ package com.lunatech.training.quarkus; -import io.smallrye.common.annotation.Blocking; - import jakarta.ws.rs.*; import jakarta.ws.rs.core.MediaType; import java.util.List; @@ -11,14 +9,12 @@ public class ProductsResource { @GET - @Blocking public List products() { return Product.listAll(); } @GET @Path("{productId}") - @Blocking public Product details(@PathParam("productId") Long productId) { Product product = Product.findById(productId); if (product != null) { diff --git a/code/exercise_009_Hook_up_the_React_app/src/main/java/com/lunatech/training/quarkus/ProductsResource.java b/code/exercise_009_Hook_up_the_React_app/src/main/java/com/lunatech/training/quarkus/ProductsResource.java index 7611246..b216d1f 100644 --- a/code/exercise_009_Hook_up_the_React_app/src/main/java/com/lunatech/training/quarkus/ProductsResource.java +++ b/code/exercise_009_Hook_up_the_React_app/src/main/java/com/lunatech/training/quarkus/ProductsResource.java @@ -1,7 +1,5 @@ package com.lunatech.training.quarkus; -import io.smallrye.common.annotation.Blocking; - import jakarta.ws.rs.*; import jakarta.ws.rs.core.MediaType; import java.util.List; @@ -11,14 +9,12 @@ public class ProductsResource { @GET - @Blocking public List products() { return Product.listAll(); } @GET @Path("{productId}") - @Blocking public Product details(@PathParam("productId") Long productId) { Product product = Product.findById(productId); if (product != null) { diff --git a/code/exercise_010_Validation_and_PUT/src/main/java/com/lunatech/training/quarkus/ProductsResource.java b/code/exercise_010_Validation_and_PUT/src/main/java/com/lunatech/training/quarkus/ProductsResource.java index 51b5bf1..73e2faa 100644 --- a/code/exercise_010_Validation_and_PUT/src/main/java/com/lunatech/training/quarkus/ProductsResource.java +++ b/code/exercise_010_Validation_and_PUT/src/main/java/com/lunatech/training/quarkus/ProductsResource.java @@ -1,7 +1,5 @@ package com.lunatech.training.quarkus; -import io.smallrye.common.annotation.Blocking; - import jakarta.transaction.Transactional; import jakarta.validation.Valid; import jakarta.ws.rs.*; @@ -14,14 +12,12 @@ public class ProductsResource { @GET - @Blocking public List products() { return Product.listAll(); } @GET @Path("{productId}") - @Blocking public Product details(@PathParam("productId") Long productId) { Product product = Product.findById(productId); if (product != null) {