Merge pull request #25804 from akka/wip-25750-AbstractBehavior-patriknw
Rename MutableBehavior to AbstractBehavior, #25750
This commit is contained in:
commit
abb3429bc8
22 changed files with 212 additions and 138 deletions
|
|
@ -25,8 +25,9 @@ import akka.actor.typed.Behavior;
|
|||
import akka.cluster.ddata.typed.javadsl.Replicator.Command;
|
||||
import akka.actor.typed.javadsl.Behaviors;
|
||||
import akka.actor.typed.javadsl.Adapter;
|
||||
import akka.actor.typed.javadsl.MutableBehavior;
|
||||
import akka.actor.typed.javadsl.AbstractBehavior;
|
||||
import akka.actor.typed.javadsl.ActorContext;
|
||||
import akka.actor.typed.javadsl.Receive;
|
||||
|
||||
// #sample
|
||||
|
||||
|
|
@ -83,7 +84,7 @@ public class ReplicatorTest extends JUnitSuite {
|
|||
|
||||
static final Key<GCounter> Key = GCounterKey.create("counter");
|
||||
|
||||
static class Counter extends MutableBehavior<ClientCommand> {
|
||||
static class Counter extends AbstractBehavior<ClientCommand> {
|
||||
private final ActorRef<Replicator.Command> replicator;
|
||||
private final Cluster node;
|
||||
final ActorRef<Replicator.UpdateResponse<GCounter>> updateResponseAdapter;
|
||||
|
|
@ -132,7 +133,7 @@ public class ReplicatorTest extends JUnitSuite {
|
|||
// #sample
|
||||
|
||||
@Override
|
||||
public Behaviors.Receive<ClientCommand> createReceive() {
|
||||
public Receive<ClientCommand> createReceive() {
|
||||
return receiveBuilder()
|
||||
.onMessage(Increment.class, this::onIncrement)
|
||||
.onMessage(InternalUpdateResponse.class, msg -> Behaviors.same())
|
||||
|
|
|
|||
|
|
@ -10,7 +10,8 @@ import akka.actor.typed.ActorSystem;
|
|||
import akka.actor.typed.Behavior;
|
||||
import akka.actor.typed.javadsl.ActorContext;
|
||||
import akka.actor.typed.javadsl.Behaviors;
|
||||
import akka.actor.typed.javadsl.MutableBehavior;
|
||||
import akka.actor.typed.javadsl.AbstractBehavior;
|
||||
import akka.actor.typed.javadsl.Receive;
|
||||
import akka.actor.typed.receptionist.Receptionist;
|
||||
import akka.actor.typed.receptionist.ServiceKey;
|
||||
import akka.cluster.ClusterEvent;
|
||||
|
|
@ -32,7 +33,7 @@ public class ReceptionistExampleTest extends JUnitSuite {
|
|||
|
||||
static class RandomRouter {
|
||||
|
||||
private static class RouterBehavior<T> extends MutableBehavior<Object> {
|
||||
private static class RouterBehavior<T> extends AbstractBehavior<Object> {
|
||||
private final Class<T> messageClass;
|
||||
private final ServiceKey<T> serviceKey;
|
||||
private final List<ActorRef<T>> routees = new ArrayList<>();
|
||||
|
|
@ -44,7 +45,7 @@ public class ReceptionistExampleTest extends JUnitSuite {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Behaviors.Receive<Object> createReceive() {
|
||||
public Receive<Object> createReceive() {
|
||||
return receiveBuilder()
|
||||
.onMessage(Receptionist.Listing.class, listing -> listing.isForKey(serviceKey), (listing) -> {
|
||||
routees.clear();
|
||||
|
|
@ -74,7 +75,7 @@ public class ReceptionistExampleTest extends JUnitSuite {
|
|||
}
|
||||
}
|
||||
|
||||
private static class ClusterRouterBehavior<T> extends MutableBehavior<Object> {
|
||||
private static class ClusterRouterBehavior<T> extends AbstractBehavior<Object> {
|
||||
private final Class<T> messageClass;
|
||||
private final ServiceKey<T> serviceKey;
|
||||
private final List<ActorRef<T>> routees = new ArrayList<>();
|
||||
|
|
@ -110,7 +111,7 @@ public class ReceptionistExampleTest extends JUnitSuite {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Behaviors.Receive<Object> createReceive() {
|
||||
public Receive<Object> createReceive() {
|
||||
return receiveBuilder()
|
||||
.onMessage(Receptionist.Listing.class, listing -> listing.isForKey(serviceKey), listing -> {
|
||||
routees.clear();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue