From 23fc027b5048491385e09afbc40d1dd7358aaa23 Mon Sep 17 00:00:00 2001 From: Peter Vlugter <59895+pvlugter@users.noreply.github.com> Date: Tue, 10 Oct 2023 12:02:07 +1300 Subject: [PATCH] update: serialization and reflect config --- .../java/local/drones/DeliveriesQueue.java | 2 +- .../src/main/java/local/drones/Drone.java | 1 - .../src/main/java/local/drones/Position.java | 2 - .../generated/reflect-config.json | 64 +++++++++++++++++++ 4 files changed, 65 insertions(+), 4 deletions(-) diff --git a/samples/grpc/local-drone-control-java/src/main/java/local/drones/DeliveriesQueue.java b/samples/grpc/local-drone-control-java/src/main/java/local/drones/DeliveriesQueue.java index 213733108..445fc3189 100644 --- a/samples/grpc/local-drone-control-java/src/main/java/local/drones/DeliveriesQueue.java +++ b/samples/grpc/local-drone-control-java/src/main/java/local/drones/DeliveriesQueue.java @@ -89,7 +89,7 @@ public State( } } - public static final class WaitingDelivery { + public static final class WaitingDelivery implements CborSerializable { public final String deliveryId; public final Coordinates from; public final Coordinates to; diff --git a/samples/grpc/local-drone-control-java/src/main/java/local/drones/Drone.java b/samples/grpc/local-drone-control-java/src/main/java/local/drones/Drone.java index 7d8eb7840..dac370083 100644 --- a/samples/grpc/local-drone-control-java/src/main/java/local/drones/Drone.java +++ b/samples/grpc/local-drone-control-java/src/main/java/local/drones/Drone.java @@ -40,7 +40,6 @@ public static final class ReportPosition implements Command { public final Position position; public final ActorRef replyTo; - @JsonCreator public ReportPosition(Position position, ActorRef replyTo) { this.position = position; this.replyTo = replyTo; diff --git a/samples/grpc/local-drone-control-java/src/main/java/local/drones/Position.java b/samples/grpc/local-drone-control-java/src/main/java/local/drones/Position.java index 20d671f28..d8137ba58 100644 --- a/samples/grpc/local-drone-control-java/src/main/java/local/drones/Position.java +++ b/samples/grpc/local-drone-control-java/src/main/java/local/drones/Position.java @@ -1,14 +1,12 @@ package local.drones; import akka.serialization.jackson.CborSerializable; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Objects; public final class Position implements CborSerializable { public final Coordinates coordinates; public final double altitude; - @JsonCreator public Position(Coordinates coordinates, double altitude) { this.coordinates = coordinates; this.altitude = altitude; diff --git a/samples/grpc/local-drone-control-java/src/main/resources/META-INF/native-image/generated/reflect-config.json b/samples/grpc/local-drone-control-java/src/main/resources/META-INF/native-image/generated/reflect-config.json index bf147f505..393c1b43f 100644 --- a/samples/grpc/local-drone-control-java/src/main/resources/META-INF/native-image/generated/reflect-config.json +++ b/samples/grpc/local-drone-control-java/src/main/resources/META-INF/native-image/generated/reflect-config.json @@ -4434,6 +4434,30 @@ } ] }, + { + "name": "local.drones.DeliveriesQueue$Command", + "queryAllDeclaredMethods": true + }, + { + "name": "local.drones.DeliveriesQueue$CompleteDelivery", + "allDeclaredFields": true, + "queryAllDeclaredMethods": true, + "queryAllDeclaredConstructors": true, + "fields": [ + { + "name": "MODULE$" + } + ], + "methods": [ + { + "name": "", + "parameterTypes": [ + "java.lang.String", + "akka.actor.typed.ActorRef" + ] + } + ] + }, { "name": "local.drones.DeliveriesQueue$DeliveryInProgress", "allDeclaredFields": true, @@ -4455,6 +4479,46 @@ } ] }, + { + "name": "local.drones.DeliveriesQueue$GetCurrentState", + "allDeclaredFields": true, + "queryAllDeclaredMethods": true, + "queryAllDeclaredConstructors": true, + "fields": [ + { + "name": "MODULE$" + } + ], + "methods": [ + { + "name": "", + "parameterTypes": [ + "akka.actor.typed.ActorRef" + ] + } + ] + }, + { + "name": "local.drones.DeliveriesQueue$RequestDelivery", + "allDeclaredFields": true, + "queryAllDeclaredMethods": true, + "queryAllDeclaredConstructors": true, + "fields": [ + { + "name": "MODULE$" + } + ], + "methods": [ + { + "name": "", + "parameterTypes": [ + "java.lang.String", + "local.drones.Coordinates", + "akka.actor.typed.ActorRef" + ] + } + ] + }, { "name": "local.drones.DeliveriesQueue$State", "allDeclaredFields": true,