ActorContext as constructor parameter in AbstractBehavior, #27689 (#27806)

* ActorContext as constructor parameter in AbstractBehavior, #27689

* additional test

* additional doc clarification

* another rebase
This commit is contained in:
Patrik Nordwall 2019-09-27 11:17:37 +02:00 committed by Arnout Engelen
parent 0719de035b
commit 91db18b564
66 changed files with 442 additions and 323 deletions

View file

@ -9,6 +9,7 @@ import akka.actor.typed.ActorRef;
import akka.actor.typed.ActorSystem;
import akka.actor.typed.Behavior;
import akka.actor.typed.javadsl.AbstractBehavior;
import akka.actor.typed.javadsl.ActorContext;
import akka.actor.typed.javadsl.Adapter;
import akka.actor.typed.javadsl.Behaviors;
import akka.actor.typed.javadsl.Receive;
@ -79,14 +80,15 @@ public interface ResumableProjectionExample {
}
public static Behavior<Command> create(String id, ExampleStore store) {
return Behaviors.setup(context -> new TheOneWhoWritesToQueryJournal(store));
return Behaviors.setup(context -> new TheOneWhoWritesToQueryJournal(context, store));
}
private final ExampleStore store;
private ComplexState state = new ComplexState();
private TheOneWhoWritesToQueryJournal(ExampleStore store) {
private TheOneWhoWritesToQueryJournal(ActorContext<Command> context, ExampleStore store) {
super(context);
this.store = store;
}