Java style accessors for AbstractFSM #22592

This commit is contained in:
Johan Andrén 2017-03-17 10:18:15 +01:00
parent 363ca39f52
commit 07e88300bc
24 changed files with 85 additions and 58 deletions

View file

@ -18,7 +18,7 @@ public class FactorialBackend extends AbstractActor {
CompletableFuture.supplyAsync(() -> factorial(n))
.thenApply((factorial) -> new FactorialResult(n, factorial));
pipe(result, getContext().dispatcher()).to(sender());
pipe(result, getContext().dispatcher()).to(getSender());
})
.build();

View file

@ -51,7 +51,7 @@ public class FactorialFrontend extends AbstractActor {
if (repeat)
sendJobs();
else
getContext().stop(self());
getContext().stop(getSelf());
}
})
.match(ReceiveTimeout.class, x -> {

View file

@ -53,7 +53,7 @@ public class StatsSampleClient extends AbstractActor {
//re-subscribe when restart
@Override
public void postStop() {
cluster.unsubscribe(self());
cluster.unsubscribe(getSelf());
tickTask.cancel();
}

View file

@ -18,13 +18,13 @@ public class TransformationBackend extends AbstractActor {
//subscribe to cluster changes, MemberUp
@Override
public void preStart() {
cluster.subscribe(self(), MemberUp.class);
cluster.subscribe(getSelf(), MemberUp.class);
}
//re-subscribe when restart
@Override
public void postStop() {
cluster.unsubscribe(self());
cluster.unsubscribe(getSelf());
}
@Override

View file

@ -31,8 +31,8 @@ public class TransformationFrontend extends AbstractActor {
.forward(job, getContext());
})
.matchEquals(BACKEND_REGISTRATION, x -> {
getContext().watch(sender());
backends.add(sender());
getContext().watch(getSender());
backends.add(getSender());
})
.match(Terminated.class, terminated -> {
backends.remove(terminated.getActor());