From d5f3dd864da25382546fe252619bbca3ed1b9ae9 Mon Sep 17 00:00:00 2001 From: Alexandros Bourantas Date: Mon, 13 Jan 2020 10:27:00 +0100 Subject: [PATCH 1/2] Update to version 1.0.0 From adba08a5bfb41cc357a4ab212597c786e6e72bb1 Mon Sep 17 00:00:00 2001 From: Alexandros Bourantas Date: Thu, 30 Jan 2020 13:25:28 +0100 Subject: [PATCH 2/2] changes Consumers to be Serializable --- .../infra/persistence/Queries__Proxy.java | 18 +++++++----------- .../vlingo/frontservice/model/User__Proxy.java | 15 +++++---------- 2 files changed, 12 insertions(+), 21 deletions(-) diff --git a/vlingo-http-frontservice/src/main/java/io/vlingo/frontservice/infra/persistence/Queries__Proxy.java b/vlingo-http-frontservice/src/main/java/io/vlingo/frontservice/infra/persistence/Queries__Proxy.java index 58078320..51107c43 100644 --- a/vlingo-http-frontservice/src/main/java/io/vlingo/frontservice/infra/persistence/Queries__Proxy.java +++ b/vlingo-http-frontservice/src/main/java/io/vlingo/frontservice/infra/persistence/Queries__Proxy.java @@ -1,18 +1,14 @@ package io.vlingo.frontservice.infra.persistence; -import java.util.Collection; -import java.util.function.Consumer; - -import io.vlingo.actors.Actor; -import io.vlingo.actors.DeadLetter; -import io.vlingo.actors.LocalMessage; -import io.vlingo.actors.Mailbox; -import io.vlingo.actors.Returns; +import io.vlingo.actors.*; import io.vlingo.common.BasicCompletes; import io.vlingo.common.Completes; +import io.vlingo.common.SerializableConsumer; import io.vlingo.frontservice.data.ProfileData; import io.vlingo.frontservice.data.UserData; +import java.util.Collection; + public class Queries__Proxy implements Queries { private static final String profileOfRepresentation1 = "profileOf(java.lang.String)"; @@ -29,7 +25,7 @@ public Queries__Proxy(final Actor actor, final Mailbox mailbox){ public Completes profileOf(java.lang.String arg0) { if (!actor.isStopped()) { - final Consumer consumer = (actor) -> actor.profileOf(arg0); + final SerializableConsumer consumer = (actor) -> actor.profileOf(arg0); final Completes completes = new BasicCompletes<>(actor.scheduler()); mailbox.send(new LocalMessage(actor, Queries.class, consumer, Returns.value(completes), profileOfRepresentation1)); return completes; @@ -40,7 +36,7 @@ public Completes profileOf(java.lang.String arg0) { } public Completes userDataOf(java.lang.String arg0) { if (!actor.isStopped()) { - final Consumer consumer = (actor) -> actor.userDataOf(arg0); + final SerializableConsumer consumer = (actor) -> actor.userDataOf(arg0); final Completes completes = new BasicCompletes<>(actor.scheduler()); mailbox.send(new LocalMessage(actor, Queries.class, consumer, Returns.value(completes), userDataOfRepresentation2)); return completes; @@ -51,7 +47,7 @@ public Completes userDataOf(java.lang.String arg0) { } public Completes> usersData() { if (!actor.isStopped()) { - final Consumer consumer = (actor) -> actor.usersData(); + final SerializableConsumer consumer = (actor) -> actor.usersData(); final Completes> completes = new BasicCompletes<>(actor.scheduler()); mailbox.send(new LocalMessage(actor, Queries.class, consumer, Returns.value(completes), usersDataRepresentation3)); return completes; diff --git a/vlingo-http-frontservice/src/main/java/io/vlingo/frontservice/model/User__Proxy.java b/vlingo-http-frontservice/src/main/java/io/vlingo/frontservice/model/User__Proxy.java index ae0ffe30..45f725d6 100644 --- a/vlingo-http-frontservice/src/main/java/io/vlingo/frontservice/model/User__Proxy.java +++ b/vlingo-http-frontservice/src/main/java/io/vlingo/frontservice/model/User__Proxy.java @@ -7,15 +7,10 @@ package io.vlingo.frontservice.model; -import java.util.function.Consumer; - -import io.vlingo.actors.Actor; -import io.vlingo.actors.DeadLetter; -import io.vlingo.actors.LocalMessage; -import io.vlingo.actors.Mailbox; -import io.vlingo.actors.Returns; +import io.vlingo.actors.*; import io.vlingo.common.BasicCompletes; import io.vlingo.common.Completes; +import io.vlingo.common.SerializableConsumer; public class User__Proxy implements User { @@ -34,7 +29,7 @@ public User__Proxy(final Actor actor, final Mailbox mailbox){ @Override public void attachPrivateToken(String arg0) { if (!actor.isStopped()) { - final Consumer consumer = (actor) -> actor.attachPrivateToken(arg0); + final SerializableConsumer consumer = (actor) -> actor.attachPrivateToken(arg0); mailbox.send(new LocalMessage(actor, User.class, consumer, null, attachPrivateToken1)); } else { actor.deadLetters().failedDelivery(new DeadLetter(actor, attachPrivateToken1)); @@ -42,7 +37,7 @@ public void attachPrivateToken(String arg0) { } public Completes withContact(Contact arg0) { if (!actor.isStopped()) { - final Consumer consumer = (actor) -> actor.withContact(arg0); + final SerializableConsumer consumer = (actor) -> actor.withContact(arg0); final Completes completes = new BasicCompletes<>(actor.scheduler()); mailbox.send(new LocalMessage(actor, User.class, consumer, Returns.value(completes), withContactRepresentation2)); return completes; @@ -53,7 +48,7 @@ public Completes withContact(Contact arg0) { } public Completes withName(Name arg0) { if (!actor.isStopped()) { - final Consumer consumer = (actor) -> actor.withName(arg0); + final SerializableConsumer consumer = (actor) -> actor.withName(arg0); final Completes completes = new BasicCompletes<>(actor.scheduler()); mailbox.send(new LocalMessage(actor, User.class, consumer, Returns.value(completes), withNameRepresentation3)); return completes;