From 29f2eba049de55f4f925e532938ce7ccf101c2d4 Mon Sep 17 00:00:00 2001 From: Helena Edelson Date: Thu, 5 Sep 2019 03:30:52 -0700 Subject: [PATCH] Change "Untyped" to "Classic" (#27627) * Untyped to classic naming convention #24717 * Added entry of naming convention change to migration docs. * Rename `toUntyped` to `toClassic` in adapters --- .../typed/internal/ActorSystemStub.scala | 8 +- .../testkit/typed/internal/DebugRef.scala | 4 +- .../typed/internal/StubbedActorContext.scala | 8 +- .../testkit/typed/javadsl/ManualTime.scala | 4 +- .../testkit/typed/scaladsl/ManualTime.scala | 4 +- .../typed/scaladsl/SerializationTestKit.scala | 2 +- .../akka/actor/typed/javadsl/AdapterTest.java | 83 +++++++------ .../jdocs/akka/typed/BubblingSampleTest.java | 2 +- ...est.java => ClassicWatchingTypedTest.java} | 34 +++--- ...est.java => TypedWatchingClassicTest.java} | 20 ++-- .../akka/actor/typed/ActorContextSpec.scala | 2 +- .../test/scala/akka/actor/typed/AskSpec.scala | 14 +-- .../scala/akka/actor/typed/DeferredSpec.scala | 2 +- .../akka/actor/typed/ExtensionsSpec.scala | 16 +-- .../akka/actor/typed/InterceptSpec.scala | 2 +- .../akka/actor/typed/LogMessagesSpec.scala | 2 +- .../actor/typed/MailboxSelectorSpec.scala | 4 +- .../akka/actor/typed/SupervisionSpec.scala | 8 +- .../scala/akka/actor/typed/TimerSpec.scala | 4 +- .../actor/typed/TransformMessagesSpec.scala | 2 +- .../scala/akka/actor/typed/WatchSpec.scala | 2 +- ...cala => ClassicSupervisingTypedSpec.scala} | 70 +++++------ ...cala => TypedSupervisingClassicSpec.scala} | 34 +++--- .../internal/ActorRefSerializationSpec.scala | 2 +- .../typed/internal/ActorSystemSpec.scala | 4 +- .../ServiceKeySerializationSpec.scala | 2 +- .../typed/scaladsl/ActorContextAskSpec.scala | 2 +- .../typed/scaladsl/ActorLoggingSpec.scala | 4 +- .../typed/scaladsl/MessageAdapterSpec.scala | 2 +- .../actor/typed/scaladsl/RoutersSpec.scala | 4 +- .../akka/actor/typed/scaladsl/StashSpec.scala | 6 +- .../typed/scaladsl/adapter/AdapterSpec.scala | 112 +++++++++--------- .../adapter/GuardianStartupSpec.scala | 2 +- ...c.scala => ClassicWatchingTypedSpec.scala} | 46 +++---- ...c.scala => TypedWatchingClassicSpec.scala} | 40 +++---- .../src/main/resources/reference.conf | 2 +- .../scala/akka/actor/typed/ActorRef.scala | 4 +- .../akka/actor/typed/ActorRefResolver.scala | 6 +- .../scala/akka/actor/typed/ActorSystem.scala | 24 ++-- .../akka/actor/typed/SpawnProtocol.scala | 2 +- .../internal/MiscMessageSerializer.scala | 2 +- .../actor/typed/internal/PoisonPill.scala | 2 +- .../typed/internal/StashBufferImpl.scala | 4 +- .../actor/typed/internal/Supervision.scala | 4 +- .../typed/internal/adapter/ActorAdapter.scala | 30 ++--- .../adapter/ActorContextAdapter.scala | 64 +++++----- .../internal/adapter/ActorRefAdapter.scala | 36 +++--- .../internal/adapter/ActorSystemAdapter.scala | 82 ++++++------- .../internal/adapter/EventStreamAdapter.scala | 6 +- .../internal/adapter/LoggerAdapterImpl.scala | 22 ++-- .../typed/internal/adapter/PropsAdapter.scala | 2 +- .../internal/adapter/SchedulerAdapter.scala | 14 +-- .../receptionist/ReceptionistImpl.scala | 2 +- .../internal/routing/GroupRouterImpl.scala | 4 +- .../actor/typed/javadsl/ActorContext.scala | 2 +- .../akka/actor/typed/javadsl/Adapter.scala | 82 ++++++------- .../actor/typed/scaladsl/AskPattern.scala | 4 +- .../typed/scaladsl/adapter/PropsAdapter.scala | 8 +- .../typed/scaladsl/adapter/package.scala | 40 +++---- .../typed/ClusterShardingSettings.scala | 84 ++++++------- .../typed/internal/ClusterShardingImpl.scala | 60 +++++----- .../typed/internal/ShardingState.scala | 6 +- .../typed/scaladsl/ClusterSharding.scala | 4 +- .../typed/ShardingSerializerSpec.scala | 2 +- .../ClusterShardingPersistenceSpec.scala | 6 +- .../typed/scaladsl/ClusterShardingSpec.scala | 6 +- .../typed/internal/ReplicatorBehavior.scala | 38 +++--- .../ddata/typed/javadsl/Replicator.scala | 20 ++-- .../typed/javadsl/ReplicatorSettings.scala | 2 +- .../typed/scaladsl/DistributedData.scala | 12 +- .../typed/scaladsl/ReplicatorSettings.scala | 4 +- .../akka/cluster/typed/ClusterSingleton.scala | 10 +- .../typed/internal/AdaptedClusterImpl.scala | 20 ++-- .../AdaptedClusterSingletonImpl.scala | 10 +- .../receptionist/ClusterReceptionist.scala | 10 +- .../typed/MultiDcClusterSingletonSpec.scala | 2 +- .../akka/cluster/typed/ActorSystemSpec.scala | 4 +- .../akka/cluster/typed/ClusterApiSpec.scala | 2 +- .../typed/ClusterSingletonApiSpec.scala | 2 +- .../ClusterSingletonPersistenceSpec.scala | 6 +- .../ClusterSingletonPoisonPillSpec.scala | 2 +- .../cluster/typed/RemoteMessageSpec.scala | 4 +- .../AkkaClusterTypedSerializerSpec.scala | 6 +- .../ClusterReceptionistSpec.scala | 2 +- akka-docs/src/main/paradox/mailboxes.md | 2 +- .../project/migration-guide-2.5.x-2.6.x.md | 96 ++++++--------- .../src/main/paradox/typed/actor-discovery.md | 2 +- .../src/main/paradox/typed/actor-lifecycle.md | 4 +- .../src/main/paradox/typed/coexisting.md | 84 ++++++------- .../main/paradox/typed/distributed-data.md | 12 +- .../src/main/paradox/typed/fault-tolerance.md | 8 +- akka-docs/src/main/paradox/typed/fsm.md | 6 +- .../src/main/paradox/typed/persistence.md | 4 +- akka-docs/src/main/paradox/typed/testing.md | 10 +- .../test/java/jdocs/actor/MyBoundedActor.java | 4 +- .../typed/EventSourcedSignal.scala | 2 +- .../persistence/typed/SnapshotAdapter.scala | 2 +- .../typed/SnapshotSelectionCriteria.scala | 6 +- .../typed/internal/BehaviorSetup.scala | 4 +- .../internal/EventSourcedBehaviorImpl.scala | 2 +- .../typed/internal/ExternalInteractions.scala | 20 ++-- .../persistence/typed/internal/Running.scala | 16 +-- .../typed/internal/StashManagement.scala | 2 +- .../typed/javadsl/EventSourcedBehavior.scala | 2 +- .../typed/scaladsl/EventSourcedBehavior.scala | 2 +- .../javadsl/EventSourcedActorFailureTest.java | 6 +- .../typed/javadsl/LoggerSourceTest.java | 2 +- .../javadsl/PersistentActorJavaDslTest.java | 6 +- .../typed/ManyRecoveriesSpec.scala | 4 +- .../internal/RecoveryPermitterSpec.scala | 60 +++++----- .../EventSourcedBehaviorFailureSpec.scala | 8 +- .../EventSourcedBehaviorInterceptorSpec.scala | 6 +- ...ntSourcedBehaviorRecoveryTimeoutSpec.scala | 4 +- .../EventSourcedBehaviorRetentionSpec.scala | 4 +- .../scaladsl/EventSourcedBehaviorSpec.scala | 30 ++--- .../EventSourcedBehaviorStashSpec.scala | 30 ++--- .../EventSourcedBehaviorTimersSpec.scala | 6 +- .../EventSourcedEventAdapterSpec.scala | 6 +- .../EventSourcedSequenceNumberSpec.scala | 2 +- .../EventSourcedSnapshotAdapterSpec.scala | 4 +- .../typed/scaladsl/LoggerSourceSpec.scala | 2 +- .../typed/scaladsl/NullEmptyStateSpec.scala | 2 +- .../scaladsl/OptionalSnapshotStoreSpec.scala | 4 +- .../typed/scaladsl/PrimitiveStateSpec.scala | 2 +- .../scaladsl/SnapshotMutableStateSpec.scala | 14 +-- .../PersistentFsmToTypedMigrationSpec.scala | 44 +++---- .../javadsl/ActorMaterializerFactory.scala | 12 +- .../stream/typed/scaladsl/ActorFlow.scala | 6 +- .../typed/scaladsl/ActorMaterializer.scala | 4 +- .../stream/typed/scaladsl/ActorSink.scala | 4 +- .../stream/typed/scaladsl/ActorSource.scala | 2 +- .../stream/typed/scaladsl/ActorFlowSpec.scala | 2 +- .../akka/stream/actor/ActorSubscriber.scala | 4 +- .../main/scala/akka/stream/impl/package.scala | 2 +- .../akka/testkit/TestEventListenerSpec.scala | 4 +- 135 files changed, 940 insertions(+), 965 deletions(-) rename akka-actor-typed-tests/src/test/java/jdocs/akka/typed/coexistence/{UntypedWatchingTypedTest.java => ClassicWatchingTypedTest.java} (76%) rename akka-actor-typed-tests/src/test/java/jdocs/akka/typed/coexistence/{TypedWatchingUntypedTest.java => TypedWatchingClassicTest.java} (85%) rename akka-actor-typed-tests/src/test/scala/akka/actor/typed/coexistence/{UntypedSupervisingTypedSpec.scala => ClassicSupervisingTypedSpec.scala} (59%) rename akka-actor-typed-tests/src/test/scala/akka/actor/typed/coexistence/{TypedSupervisingUntypedSpec.scala => TypedSupervisingClassicSpec.scala} (52%) rename akka-actor-typed-tests/src/test/scala/docs/akka/typed/coexistence/{UntypedWatchingTypedSpec.scala => ClassicWatchingTypedSpec.scala} (66%) rename akka-actor-typed-tests/src/test/scala/docs/akka/typed/coexistence/{TypedWatchingUntypedSpec.scala => TypedWatchingClassicSpec.scala} (64%) diff --git a/akka-actor-testkit-typed/src/main/scala/akka/actor/testkit/typed/internal/ActorSystemStub.scala b/akka-actor-testkit-typed/src/main/scala/akka/actor/testkit/typed/internal/ActorSystemStub.scala index 59477ec16d..f5a3d90739 100644 --- a/akka-actor-testkit-typed/src/main/scala/akka/actor/testkit/typed/internal/ActorSystemStub.scala +++ b/akka-actor-testkit-typed/src/main/scala/akka/actor/testkit/typed/internal/ActorSystemStub.scala @@ -19,7 +19,7 @@ import akka.actor.typed.Props import akka.actor.typed.Scheduler import akka.actor.typed.Settings import akka.annotation.InternalApi -import akka.{ actor => untyped } +import akka.{ actor => classic } import akka.Done import com.typesafe.config.ConfigFactory @@ -39,7 +39,7 @@ import com.github.ghik.silencer.silent with ActorRefImpl[Nothing] with InternalRecipientRef[Nothing] { - override val path: untyped.ActorPath = untyped.RootActorPath(untyped.Address("akka", name)) / "user" + override val path: classic.ActorPath = classic.RootActorPath(classic.Address("akka", name)) / "user" override val settings: Settings = new Settings(getClass.getClassLoader, ConfigFactory.empty, name) @@ -57,7 +57,7 @@ import com.github.ghik.silencer.silent // stream materialization etc. using stub not supported override private[akka] def classicSystem = - throw new UnsupportedOperationException("no untyped actor system available") + throw new UnsupportedOperationException("no classic actor system available") // impl InternalRecipientRef def isTerminated: Boolean = whenTerminated.isCompleted @@ -72,7 +72,7 @@ import com.github.ghik.silencer.silent def shutdown(): Unit = () } - override def dynamicAccess: untyped.DynamicAccess = new untyped.ReflectiveDynamicAccess(getClass.getClassLoader) + override def dynamicAccess: classic.DynamicAccess = new classic.ReflectiveDynamicAccess(getClass.getClassLoader) override def logConfiguration(): Unit = log.info(settings.toString) diff --git a/akka-actor-testkit-typed/src/main/scala/akka/actor/testkit/typed/internal/DebugRef.scala b/akka-actor-testkit-typed/src/main/scala/akka/actor/testkit/typed/internal/DebugRef.scala index aff21f8608..6b6e6072c5 100644 --- a/akka-actor-testkit-typed/src/main/scala/akka/actor/testkit/typed/internal/DebugRef.scala +++ b/akka-actor-testkit-typed/src/main/scala/akka/actor/testkit/typed/internal/DebugRef.scala @@ -9,7 +9,7 @@ import java.util.concurrent.ConcurrentLinkedQueue import akka.actor.typed.ActorRef import akka.actor.typed.internal.{ ActorRefImpl, SystemMessage } import akka.annotation.InternalApi -import akka.{ actor => untyped } +import akka.{ actor => classic } import scala.annotation.tailrec import akka.actor.ActorRefProvider @@ -18,7 +18,7 @@ import akka.actor.typed.internal.InternalRecipientRef /** * INTERNAL API */ -@InternalApi private[akka] final class DebugRef[T](override val path: untyped.ActorPath, override val isLocal: Boolean) +@InternalApi private[akka] final class DebugRef[T](override val path: classic.ActorPath, override val isLocal: Boolean) extends ActorRef[T] with ActorRefImpl[T] with InternalRecipientRef[T] { diff --git a/akka-actor-testkit-typed/src/main/scala/akka/actor/testkit/typed/internal/StubbedActorContext.scala b/akka-actor-testkit-typed/src/main/scala/akka/actor/testkit/typed/internal/StubbedActorContext.scala index 4828375542..537b41bb72 100644 --- a/akka-actor-testkit-typed/src/main/scala/akka/actor/testkit/typed/internal/StubbedActorContext.scala +++ b/akka-actor-testkit-typed/src/main/scala/akka/actor/testkit/typed/internal/StubbedActorContext.scala @@ -13,7 +13,7 @@ import akka.actor.{ ActorPath, InvalidMessageException } import akka.annotation.InternalApi import akka.event.Logging import akka.util.{ Helpers, OptionVal } -import akka.{ actor => untyped } +import akka.{ actor => classic } import java.util.concurrent.ThreadLocalRandom.{ current => rnd } import scala.collection.immutable.TreeMap @@ -194,7 +194,7 @@ private[akka] final class FunctionRef[-T](override val path: ActorPath, send: (T } override def spawn[U](behavior: Behavior[U], name: String, props: Props = Props.empty): ActorRef[U] = _children.get(name) match { - case Some(_) => throw untyped.InvalidActorNameException(s"actor name $name is already taken") + case Some(_) => throw classic.InvalidActorNameException(s"actor name $name is already taken") case None => val btk = new BehaviorTestKitImpl[U]((path / name).withUid(rnd().nextInt()), behavior) _children += name -> btk @@ -221,8 +221,8 @@ private[akka] final class FunctionRef[-T](override val path: ActorPath, send: (T override def setReceiveTimeout(d: FiniteDuration, message: T): Unit = () override def cancelReceiveTimeout(): Unit = () - override def scheduleOnce[U](delay: FiniteDuration, target: ActorRef[U], message: U): untyped.Cancellable = - new untyped.Cancellable { + override def scheduleOnce[U](delay: FiniteDuration, target: ActorRef[U], message: U): classic.Cancellable = + new classic.Cancellable { override def cancel() = false override def isCancelled = true } diff --git a/akka-actor-testkit-typed/src/main/scala/akka/actor/testkit/typed/javadsl/ManualTime.scala b/akka-actor-testkit-typed/src/main/scala/akka/actor/testkit/typed/javadsl/ManualTime.scala index fe80a09052..4638dc29a8 100644 --- a/akka-actor-testkit-typed/src/main/scala/akka/actor/testkit/typed/javadsl/ManualTime.scala +++ b/akka-actor-testkit-typed/src/main/scala/akka/actor/testkit/typed/javadsl/ManualTime.scala @@ -33,7 +33,7 @@ object ManualTime { def get[A](system: ActorSystem[A]): ManualTime = system.scheduler match { case adapter: SchedulerAdapter => - adapter.untypedScheduler match { + adapter.classicScheduler match { case sc: akka.testkit.ExplicitlyTriggeredScheduler => new ManualTime(sc) case _ => throw new IllegalArgumentException( @@ -42,7 +42,7 @@ object ManualTime { } case s => throw new IllegalArgumentException( - s"ActorSystem.scheduler is not an untyped SchedulerAdapter but a ${s.getClass.getName}, this is not supported") + s"ActorSystem.scheduler is not a classic SchedulerAdapter but a ${s.getClass.getName}, this is not supported") } } diff --git a/akka-actor-testkit-typed/src/main/scala/akka/actor/testkit/typed/scaladsl/ManualTime.scala b/akka-actor-testkit-typed/src/main/scala/akka/actor/testkit/typed/scaladsl/ManualTime.scala index b04e785882..f7850fa58b 100644 --- a/akka-actor-testkit-typed/src/main/scala/akka/actor/testkit/typed/scaladsl/ManualTime.scala +++ b/akka-actor-testkit-typed/src/main/scala/akka/actor/testkit/typed/scaladsl/ManualTime.scala @@ -32,7 +32,7 @@ object ManualTime { def apply()(implicit system: ActorSystem[_]): ManualTime = system.scheduler match { case adapter: SchedulerAdapter => - adapter.untypedScheduler match { + adapter.classicScheduler match { case sc: akka.testkit.ExplicitlyTriggeredScheduler => new ManualTime(sc) case _ => throw new IllegalArgumentException( @@ -41,7 +41,7 @@ object ManualTime { } case s => throw new IllegalArgumentException( - s"ActorSystem.scheduler is not an untyped SchedulerAdapter but a ${s.getClass.getName}, this is not supported") + s"ActorSystem.scheduler is not a classic SchedulerAdapter but a ${s.getClass.getName}, this is not supported") } } diff --git a/akka-actor-testkit-typed/src/main/scala/akka/actor/testkit/typed/scaladsl/SerializationTestKit.scala b/akka-actor-testkit-typed/src/main/scala/akka/actor/testkit/typed/scaladsl/SerializationTestKit.scala index 5aef1c52c9..68d27a7eef 100644 --- a/akka-actor-testkit-typed/src/main/scala/akka/actor/testkit/typed/scaladsl/SerializationTestKit.scala +++ b/akka-actor-testkit-typed/src/main/scala/akka/actor/testkit/typed/scaladsl/SerializationTestKit.scala @@ -14,7 +14,7 @@ import akka.serialization.Serializers */ class SerializationTestKit(system: ActorSystem[_]) { - private val serialization = SerializationExtension(system.toUntyped) + private val serialization = SerializationExtension(system.toClassic) /** * Verify serialization roundtrip. diff --git a/akka-actor-typed-tests/src/test/java/akka/actor/typed/javadsl/AdapterTest.java b/akka-actor-typed-tests/src/test/java/akka/actor/typed/javadsl/AdapterTest.java index 141469927a..b87ccdc7b3 100644 --- a/akka-actor-typed-tests/src/test/java/akka/actor/typed/javadsl/AdapterTest.java +++ b/akka-actor-typed-tests/src/test/java/akka/actor/typed/javadsl/AdapterTest.java @@ -5,14 +5,11 @@ package akka.actor.typed.javadsl; import org.junit.ClassRule; -import org.junit.Ignore; import org.junit.Test; import org.scalatest.junit.JUnitSuite; -import scala.concurrent.duration.FiniteDuration; - import java.time.Duration; -import java.util.concurrent.TimeUnit; + import akka.actor.ActorSystem; import akka.testkit.AkkaJUnitActorSystemResource; import akka.testkit.AkkaSpec; @@ -26,11 +23,11 @@ import static akka.actor.typed.javadsl.Behaviors.*; public class AdapterTest extends JUnitSuite { - static akka.actor.Props untyped1() { - return akka.actor.Props.create(Untyped1.class, () -> new Untyped1()); + static akka.actor.Props classic1() { + return akka.actor.Props.create(Classic1.class, () -> new Classic1()); } - static class Untyped1 extends akka.actor.AbstractActor { + static class Classic1 extends akka.actor.AbstractActor { @Override public Receive createReceive() { return receiveBuilder() @@ -60,28 +57,28 @@ public class AdapterTest extends JUnitSuite { Behavior onMessage(ActorContext context, String message) { if (message.equals("send")) { - akka.actor.ActorRef replyTo = Adapter.toUntyped(context.getSelf()); + akka.actor.ActorRef replyTo = Adapter.toClassic(context.getSelf()); ref.tell("ping", replyTo); return same(); } else if (message.equals("pong")) { probe.tell("ok", akka.actor.ActorRef.noSender()); return same(); } else if (message.equals("actorOf")) { - akka.actor.ActorRef child = Adapter.actorOf(context, untyped1()); - child.tell("ping", Adapter.toUntyped(context.getSelf())); + akka.actor.ActorRef child = Adapter.actorOf(context, classic1()); + child.tell("ping", Adapter.toClassic(context.getSelf())); return same(); } else if (message.equals("watch")) { Adapter.watch(context, ref); return same(); } else if (message.equals("supervise-restart")) { // restart is the default, otherwise an intermediate is required - akka.actor.ActorRef child = Adapter.actorOf(context, untyped1()); + akka.actor.ActorRef child = Adapter.actorOf(context, classic1()); Adapter.watch(context, child); - child.tell(new ThrowIt3(), Adapter.toUntyped(context.getSelf())); - child.tell("ping", Adapter.toUntyped(context.getSelf())); + child.tell(new ThrowIt3(), Adapter.toClassic(context.getSelf())); + child.tell("ping", Adapter.toClassic(context.getSelf())); return same(); } else if (message.equals("stop-child")) { - akka.actor.ActorRef child = Adapter.actorOf(context, untyped1()); + akka.actor.ActorRef child = Adapter.actorOf(context, classic1()); Adapter.watch(context, child); Adapter.stop(context, child); return same(); @@ -127,16 +124,16 @@ public class AdapterTest extends JUnitSuite { static class ThrowIt3 extends ThrowIt {} - static akka.actor.Props untyped2(ActorRef ref, akka.actor.ActorRef probe) { - return akka.actor.Props.create(Untyped2.class, () -> new Untyped2(ref, probe)); + static akka.actor.Props classic2(ActorRef ref, akka.actor.ActorRef probe) { + return akka.actor.Props.create(Classic2.class, () -> new Classic2(ref, probe)); } - static class Untyped2 extends akka.actor.AbstractActor { + static class Classic2 extends akka.actor.AbstractActor { private final ActorRef ref; private final akka.actor.ActorRef probe; private final SupervisorStrategy strategy; - Untyped2(ActorRef ref, akka.actor.ActorRef probe) { + Classic2(ActorRef ref, akka.actor.ActorRef probe) { this.ref = ref; this.probe = probe; this.strategy = strategy(); @@ -246,44 +243,44 @@ public class AdapterTest extends JUnitSuite { private final ActorSystem system = actorSystemResource.getSystem(); @Test - public void shouldSendMessageFromTypedToUntyped() { + public void shouldSendMessageFromTypedToClassic() { TestKit probe = new TestKit(system); - akka.actor.ActorRef untypedRef = system.actorOf(untyped1()); + akka.actor.ActorRef classicRef = system.actorOf(classic1()); ActorRef typedRef = - Adapter.spawnAnonymous(system, Typed1.create(untypedRef, probe.getRef())); + Adapter.spawnAnonymous(system, Typed1.create(classicRef, probe.getRef())); typedRef.tell("send"); probe.expectMsg("ok"); } @Test - public void shouldSendMessageFromUntypedToTyped() { + public void shouldSendMessageFromClassicToTyped() { TestKit probe = new TestKit(system); ActorRef typedRef = Adapter.spawnAnonymous(system, typed2()).narrow(); - akka.actor.ActorRef untypedRef = system.actorOf(untyped2(typedRef, probe.getRef())); - untypedRef.tell("send", akka.actor.ActorRef.noSender()); + akka.actor.ActorRef classicRef = system.actorOf(classic2(typedRef, probe.getRef())); + classicRef.tell("send", akka.actor.ActorRef.noSender()); probe.expectMsg("ok"); } @Test - public void shouldSpawnTypedChildFromUntypedParent() { + public void shouldSpawnTypedChildFromClassicParent() { TestKit probe = new TestKit(system); ActorRef ignore = Adapter.spawnAnonymous(system, ignore()); - akka.actor.ActorRef untypedRef = system.actorOf(untyped2(ignore, probe.getRef())); - untypedRef.tell("spawn", akka.actor.ActorRef.noSender()); + akka.actor.ActorRef classicRef = system.actorOf(classic2(ignore, probe.getRef())); + classicRef.tell("spawn", akka.actor.ActorRef.noSender()); probe.expectMsg("ok"); } @Test - public void shouldActorOfTypedChildViaPropsFromUntypedParent() { + public void shouldActorOfTypedChildViaPropsFromClassicParent() { TestKit probe = new TestKit(system); ActorRef ignore = Adapter.spawnAnonymous(system, ignore()); - akka.actor.ActorRef untypedRef = system.actorOf(untyped2(ignore, probe.getRef())); - untypedRef.tell("actorOf-props", akka.actor.ActorRef.noSender()); + akka.actor.ActorRef classicRef = system.actorOf(classic2(ignore, probe.getRef())); + classicRef.tell("actorOf-props", akka.actor.ActorRef.noSender()); probe.expectMsg("ok"); } @Test - public void shouldActorOfUntypedChildFromTypedParent() { + public void shouldActorOfClassicChildFromTypedParent() { TestKit probe = new TestKit(system); akka.actor.ActorRef ignore = system.actorOf(akka.actor.Props.empty()); ActorRef typedRef = @@ -293,29 +290,29 @@ public class AdapterTest extends JUnitSuite { } @Test - public void shouldWatchTypedFromUntyped() { + public void shouldWatchTypedFromClassic() { TestKit probe = new TestKit(system); ActorRef typedRef = Adapter.spawnAnonymous(system, typed2()); ActorRef typedRef2 = typedRef.narrow(); - akka.actor.ActorRef untypedRef = system.actorOf(untyped2(typedRef2, probe.getRef())); - untypedRef.tell("watch", akka.actor.ActorRef.noSender()); + akka.actor.ActorRef classicRef = system.actorOf(classic2(typedRef2, probe.getRef())); + classicRef.tell("watch", akka.actor.ActorRef.noSender()); typedRef.tell(new StopIt()); probe.expectMsg("terminated"); } @Test - public void shouldWatchUntypedFromTyped() { + public void shouldWatchClassicFromTyped() { TestKit probe = new TestKit(system); - akka.actor.ActorRef untypedRef = system.actorOf(untyped1()); + akka.actor.ActorRef classicRef = system.actorOf(classic1()); ActorRef typedRef = - Adapter.spawnAnonymous(system, Typed1.create(untypedRef, probe.getRef())); + Adapter.spawnAnonymous(system, Typed1.create(classicRef, probe.getRef())); typedRef.tell("watch"); - untypedRef.tell(akka.actor.PoisonPill.getInstance(), akka.actor.ActorRef.noSender()); + classicRef.tell(akka.actor.PoisonPill.getInstance(), akka.actor.ActorRef.noSender()); probe.expectMsg("terminated"); } @Test - public void shouldSuperviseUntypedChildAsRestartFromTypedParent() { + public void shouldSuperviseClassicChildAsRestartFromTypedParent() { TestKit probe = new TestKit(system); akka.actor.ActorRef ignore = system.actorOf(akka.actor.Props.empty()); ActorRef typedRef = @@ -335,16 +332,16 @@ public class AdapterTest extends JUnitSuite { } @Test - public void shouldStopTypedChildFromUntypedParent() { + public void shouldStopTypedChildFromClassicParent() { TestKit probe = new TestKit(system); ActorRef ignore = Adapter.spawnAnonymous(system, ignore()); - akka.actor.ActorRef untypedRef = system.actorOf(untyped2(ignore, probe.getRef())); - untypedRef.tell("stop-child", akka.actor.ActorRef.noSender()); + akka.actor.ActorRef classicRef = system.actorOf(classic2(ignore, probe.getRef())); + classicRef.tell("stop-child", akka.actor.ActorRef.noSender()); probe.expectMsg("terminated"); } @Test - public void shouldStopUntypedChildFromTypedParent() { + public void shouldStopClassicChildFromTypedParent() { TestKit probe = new TestKit(system); akka.actor.ActorRef ignore = system.actorOf(akka.actor.Props.empty()); ActorRef typedRef = diff --git a/akka-actor-typed-tests/src/test/java/jdocs/akka/typed/BubblingSampleTest.java b/akka-actor-typed-tests/src/test/java/jdocs/akka/typed/BubblingSampleTest.java index c485d177ec..c8fdf87960 100644 --- a/akka-actor-typed-tests/src/test/java/jdocs/akka/typed/BubblingSampleTest.java +++ b/akka-actor-typed-tests/src/test/java/jdocs/akka/typed/BubblingSampleTest.java @@ -26,7 +26,7 @@ public class BubblingSampleTest extends JUnitSuite { "akka.loggers = [ akka.testkit.TestEventListener ]\n" + "akka.loglevel=warning")); // actual exception and then the deathpacts - new EventFilter(Exception.class, ActorSystemAdapter.toUntyped(system)) + new EventFilter(Exception.class, ActorSystemAdapter.toClassic(system)) .occurrences(4) .intercept( () -> { diff --git a/akka-actor-typed-tests/src/test/java/jdocs/akka/typed/coexistence/UntypedWatchingTypedTest.java b/akka-actor-typed-tests/src/test/java/jdocs/akka/typed/coexistence/ClassicWatchingTypedTest.java similarity index 76% rename from akka-actor-typed-tests/src/test/java/jdocs/akka/typed/coexistence/UntypedWatchingTypedTest.java rename to akka-actor-typed-tests/src/test/java/jdocs/akka/typed/coexistence/ClassicWatchingTypedTest.java index 3aea77d08f..4a7d16a4eb 100644 --- a/akka-actor-typed-tests/src/test/java/jdocs/akka/typed/coexistence/UntypedWatchingTypedTest.java +++ b/akka-actor-typed-tests/src/test/java/jdocs/akka/typed/coexistence/ClassicWatchingTypedTest.java @@ -10,7 +10,7 @@ import akka.actor.typed.ActorSystem; import akka.actor.typed.Behavior; import akka.actor.typed.javadsl.Behaviors; // #adapter-import -// In java use the static methods on Adapter to convert from typed to untyped +// In java use the static methods on Adapter to convert from typed to classic import akka.actor.typed.javadsl.Adapter; // #adapter-import import akka.testkit.TestProbe; @@ -21,12 +21,12 @@ import scala.concurrent.duration.Duration; import static akka.actor.typed.javadsl.Behaviors.same; -public class UntypedWatchingTypedTest extends JUnitSuite { +public class ClassicWatchingTypedTest extends JUnitSuite { - // #untyped-watch - public static class Untyped extends AbstractActor { + // #classic-watch + public static class Classic extends AbstractActor { public static akka.actor.Props props() { - return akka.actor.Props.create(Untyped.class); + return akka.actor.Props.create(Classic.class); } private final akka.actor.typed.ActorRef second = @@ -54,7 +54,7 @@ public class UntypedWatchingTypedTest extends JUnitSuite { .build(); } } - // #untyped-watch + // #classic-watch // #typed public abstract static class Typed { @@ -85,22 +85,22 @@ public class UntypedWatchingTypedTest extends JUnitSuite { @Test public void testItWorks() { - // #create-untyped + // #create-classic akka.actor.ActorSystem as = akka.actor.ActorSystem.create(); - akka.actor.ActorRef untyped = as.actorOf(Untyped.props()); - // #create-untyped + akka.actor.ActorRef classic = as.actorOf(Classic.props()); + // #create-classic TestProbe probe = new TestProbe(as); - probe.watch(untyped); - probe.expectTerminated(untyped, Duration.create(1, "second")); + probe.watch(classic); + probe.expectTerminated(classic, Duration.create(1, "second")); TestKit.shutdownActorSystem(as); } @Test - public void testConversionFromUnTypedSystemToTyped() { - // #convert-untyped - akka.actor.ActorSystem untypedActorSystem = akka.actor.ActorSystem.create(); - ActorSystem typedActorSystem = Adapter.toTyped(untypedActorSystem); - // #convert-untyped - TestKit.shutdownActorSystem(untypedActorSystem); + public void testConversionFromClassicSystemToTyped() { + // #convert-classic + akka.actor.ActorSystem classicActorSystem = akka.actor.ActorSystem.create(); + ActorSystem typedActorSystem = Adapter.toTyped(classicActorSystem); + // #convert-classic + TestKit.shutdownActorSystem(classicActorSystem); } } diff --git a/akka-actor-typed-tests/src/test/java/jdocs/akka/typed/coexistence/TypedWatchingUntypedTest.java b/akka-actor-typed-tests/src/test/java/jdocs/akka/typed/coexistence/TypedWatchingClassicTest.java similarity index 85% rename from akka-actor-typed-tests/src/test/java/jdocs/akka/typed/coexistence/TypedWatchingUntypedTest.java rename to akka-actor-typed-tests/src/test/java/jdocs/akka/typed/coexistence/TypedWatchingClassicTest.java index 718cc89e5f..24a963d767 100644 --- a/akka-actor-typed-tests/src/test/java/jdocs/akka/typed/coexistence/TypedWatchingUntypedTest.java +++ b/akka-actor-typed-tests/src/test/java/jdocs/akka/typed/coexistence/TypedWatchingClassicTest.java @@ -9,7 +9,7 @@ import akka.actor.ActorSystem; import akka.actor.typed.ActorRef; import akka.actor.typed.Behavior; // #adapter-import -// in Java use the static methods on Adapter to convert from untyped to typed +// in Java use the static methods on Adapter to convert from classic to typed import akka.actor.typed.javadsl.Adapter; // #adapter-import import akka.actor.typed.javadsl.AbstractBehavior; @@ -20,7 +20,7 @@ import akka.testkit.javadsl.TestKit; import org.junit.Test; import org.scalatest.junit.JUnitSuite; -public class TypedWatchingUntypedTest extends JUnitSuite { +public class TypedWatchingClassicTest extends JUnitSuite { // #typed public static class Typed extends AbstractBehavior { @@ -50,12 +50,12 @@ public class TypedWatchingUntypedTest extends JUnitSuite { public static Behavior create() { return akka.actor.typed.javadsl.Behaviors.setup( context -> { - akka.actor.ActorRef second = Adapter.actorOf(context, Untyped.props(), "second"); + akka.actor.ActorRef second = Adapter.actorOf(context, Classic.props(), "second"); Adapter.watch(context, second); second.tell( - new Typed.Ping(context.getSelf().narrow()), Adapter.toUntyped(context.getSelf())); + new Typed.Ping(context.getSelf().narrow()), Adapter.toClassic(context.getSelf())); return new Typed(context, second); }); @@ -76,10 +76,10 @@ public class TypedWatchingUntypedTest extends JUnitSuite { } // #typed - // #untyped - public static class Untyped extends AbstractActor { + // #classic + public static class Classic extends AbstractActor { public static akka.actor.Props props() { - return akka.actor.Props.create(Untyped.class); + return akka.actor.Props.create(Classic.class); } @Override @@ -91,7 +91,7 @@ public class TypedWatchingUntypedTest extends JUnitSuite { message.replyTo.tell(Typed.Pong.INSTANCE); } } - // #untyped + // #classic @Test public void testItWorks() { @@ -100,8 +100,8 @@ public class TypedWatchingUntypedTest extends JUnitSuite { ActorRef typed = Adapter.spawn(as, Typed.create(), "Typed"); // #create TestKit probe = new TestKit(as); - probe.watch(Adapter.toUntyped(typed)); - probe.expectTerminated(Adapter.toUntyped(typed)); + probe.watch(Adapter.toClassic(typed)); + probe.expectTerminated(Adapter.toClassic(typed)); TestKit.shutdownActorSystem(as); } } diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/ActorContextSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/ActorContextSpec.scala index 37ddf0aeb7..4b2b93083c 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/ActorContextSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/ActorContextSpec.scala @@ -69,7 +69,7 @@ abstract class ActorContextSpec extends ScalaTestWithActorTestKit(""" // FIXME #24348: eventfilter support in typed testkit import scaladsl.adapter._ - implicit val untypedSystem = system.toUntyped + implicit val classicSystem = system.toClassic import ActorSpecMessages._ diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/AskSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/AskSpec.scala index 4163007caa..7cb0512cbf 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/AskSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/AskSpec.scala @@ -36,7 +36,7 @@ class AskSpec extends ScalaTestWithActorTestKit(""" // FIXME #24348: eventfilter support in typed testkit import scaladsl.adapter._ - implicit val untypedSystem = system.toUntyped + implicit val classicSystem = system.toClassic implicit def executor: ExecutionContext = system.executionContext @@ -95,7 +95,7 @@ class AskSpec extends ScalaTestWithActorTestKit(""" val noSuchActor: ActorRef[Msg] = system match { case adaptedSys: ActorSystemAdapter[_] => import akka.actor.typed.scaladsl.adapter._ - adaptedSys.untypedSystem.provider.resolveActorRef("/foo/bar") + adaptedSys.system.provider.resolveActorRef("/foo/bar") case _ => fail("this test must only run in an adapted actor system") } @@ -113,7 +113,7 @@ class AskSpec extends ScalaTestWithActorTestKit(""" // It's unlikely but possible that this happens, since the receiving actor would // have to accept a message with an actoref that accepts AnyRef or be doing crazy casting // For completeness sake though - implicit val untypedSystem = akka.actor.ActorSystem("AskSpec-untyped-1") + implicit val classicSystem = akka.actor.ActorSystem("AskSpec-classic-1") try { case class Ping(respondTo: ActorRef[AnyRef]) val ex = new RuntimeException("not good!") @@ -124,15 +124,15 @@ class AskSpec extends ScalaTestWithActorTestKit(""" } } - val legacyActor = untypedSystem.actorOf(akka.actor.Props(new LegacyActor)) + val legacyActor = classicSystem.actorOf(akka.actor.Props(new LegacyActor)) import scaladsl.AskPattern._ implicit val timeout: Timeout = 3.seconds - implicit val scheduler = untypedSystem.toTyped.scheduler + implicit val scheduler = classicSystem.toTyped.scheduler val typedLegacy: ActorRef[AnyRef] = legacyActor (typedLegacy.ask(Ping)).failed.futureValue should ===(ex) } finally { - akka.testkit.TestKit.shutdownActorSystem(untypedSystem) + akka.testkit.TestKit.shutdownActorSystem(classicSystem) } } @@ -175,7 +175,7 @@ class AskSpec extends ScalaTestWithActorTestKit(""" EventFilter[RuntimeException](message = "Exception thrown out of adapter. Stopping myself.", occurrences = 1) .intercept { replyRef2 ! 42L - }(system.toUntyped) + }(system.toClassic) probe.expectTerminated(ref, probe.remainingOrDefault) } diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/DeferredSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/DeferredSpec.scala index bdccbb8681..61fffbecf6 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/DeferredSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/DeferredSpec.scala @@ -39,7 +39,7 @@ class DeferredSpec extends ScalaTestWithActorTestKit(""" // FIXME #24348: eventfilter support in typed testkit import scaladsl.adapter._ - implicit val untypedSystem = system.toUntyped + implicit val classicSystem = system.toClassic "Deferred behavior" must { "must create underlying" in { diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/ExtensionsSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/ExtensionsSpec.scala index ff960e7877..32512aca5a 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/ExtensionsSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/ExtensionsSpec.scala @@ -188,13 +188,13 @@ class ExtensionsSpec extends ScalaTestWithActorTestKit with WordSpecLike { (instance1 should be).theSameInstanceAs(instance2) } - "load registered typed extensions eagerly even for untyped system" in { + "load registered extensions eagerly even for classic system" in { import akka.actor.typed.scaladsl.adapter._ val beforeCreation = InstanceCountingExtension.createCount.get() - val untypedSystem = akka.actor.ActorSystem("as", ExtensionsSpec.config) + val classicSystem = akka.actor.ActorSystem("as", ExtensionsSpec.config) try { val before = InstanceCountingExtension.createCount.get() - InstanceCountingExtension(untypedSystem.toTyped) + InstanceCountingExtension(classicSystem.toTyped) val after = InstanceCountingExtension.createCount.get() // should have been loaded even before it was accessed in the test because InstanceCountingExtension is listed @@ -202,21 +202,21 @@ class ExtensionsSpec extends ScalaTestWithActorTestKit with WordSpecLike { before shouldEqual beforeCreation + 1 after shouldEqual before } finally { - untypedSystem.terminate().futureValue + classicSystem.terminate().futureValue } } "not create an extension multiple times when using the ActorSystemAdapter" in { import akka.actor.typed.scaladsl.adapter._ - val untypedSystem = akka.actor.ActorSystem() + val classicSystem = akka.actor.ActorSystem() try { - val ext1 = DummyExtension1(untypedSystem.toTyped) - val ext2 = DummyExtension1(untypedSystem.toTyped) + val ext1 = DummyExtension1(classicSystem.toTyped) + val ext2 = DummyExtension1(classicSystem.toTyped) (ext1 should be).theSameInstanceAs(ext2) } finally { - untypedSystem.terminate().futureValue + classicSystem.terminate().futureValue } } diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/InterceptSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/InterceptSpec.scala index dac6194ae2..521a571770 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/InterceptSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/InterceptSpec.scala @@ -82,7 +82,7 @@ class InterceptSpec extends ScalaTestWithActorTestKit(""" // FIXME #24348: eventfilter support in typed testkit import scaladsl.adapter._ - implicit val untypedSystem = system.toUntyped + implicit val classicSystem = system.toClassic private def snitchingInterceptor(probe: ActorRef[String]) = new BehaviorInterceptor[String, String] { override def aroundReceive( diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/LogMessagesSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/LogMessagesSpec.scala index 375e71eeb7..b80cd695d8 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/LogMessagesSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/LogMessagesSpec.scala @@ -17,7 +17,7 @@ class LogMessagesSpec extends ScalaTestWithActorTestKit(""" akka.loggers = ["akka.testkit.TestEventListener"] """) with WordSpecLike { - implicit val untyped: actor.ActorSystem = system.toUntyped + implicit val classic: actor.ActorSystem = system.toClassic "The log messages behavior" should { diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/MailboxSelectorSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/MailboxSelectorSpec.scala index d3ecaf2717..a3c28b014d 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/MailboxSelectorSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/MailboxSelectorSpec.scala @@ -30,7 +30,7 @@ class MailboxSelectorSpec extends ScalaTestWithActorTestKit(""" // FIXME #24348: eventfilter support in typed testkit import scaladsl.adapter._ - implicit val untypedSystem = system.toUntyped + implicit val classicSystem = system.toClassic case class WhatsYourMailbox(replyTo: ActorRef[MessageQueue]) private def behavior: Behavior[WhatsYourMailbox] = @@ -39,7 +39,7 @@ class MailboxSelectorSpec extends ScalaTestWithActorTestKit(""" case WhatsYourMailbox(replyTo) => val mailbox = context match { case adapter: ActorContextAdapter[_] => - adapter.untypedContext match { + adapter.classicContext match { case cell: ActorCell => cell.mailbox.messageQueue } diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/SupervisionSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/SupervisionSpec.scala index 939b3e8e6a..f2a9db5836 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/SupervisionSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/SupervisionSpec.scala @@ -261,7 +261,7 @@ class SupervisionSpec extends ScalaTestWithActorTestKit(""" // FIXME #24348: eventfilter support in typed testkit import akka.actor.typed.scaladsl.adapter._ - implicit val untypedSystem = system.toUntyped + implicit val classicSystem = system.toClassic class FailingConstructorTestSetup(failCount: Int) { val failCounter = new AtomicInteger(0) @@ -782,7 +782,7 @@ class SupervisionSpec extends ScalaTestWithActorTestKit(""" .onFailure[Exception](strategy) val droppedMessagesProbe = TestProbe[Dropped]() - system.toUntyped.eventStream.subscribe(droppedMessagesProbe.ref.toUntyped, classOf[Dropped]) + system.toClassic.eventStream.subscribe(droppedMessagesProbe.ref.toClassic, classOf[Dropped]) val ref = spawn(behv) EventFilter[Exc1](occurrences = 1).intercept { startedProbe.expectMessage(Started) @@ -796,8 +796,8 @@ class SupervisionSpec extends ScalaTestWithActorTestKit(""" ref ! Ping(4) probe.expectMessage(Pong(1)) probe.expectMessage(Pong(2)) - droppedMessagesProbe.expectMessage(Dropped(Ping(3), "Stash is full in [RestartSupervisor]", ref.toUntyped)) - droppedMessagesProbe.expectMessage(Dropped(Ping(4), "Stash is full in [RestartSupervisor]", ref.toUntyped)) + droppedMessagesProbe.expectMessage(Dropped(Ping(3), "Stash is full in [RestartSupervisor]", ref.toClassic)) + droppedMessagesProbe.expectMessage(Dropped(Ping(4), "Stash is full in [RestartSupervisor]", ref.toClassic)) } } diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/TimerSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/TimerSpec.scala index 2fa77bd277..cc2bc4b4c3 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/TimerSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/TimerSpec.scala @@ -25,7 +25,7 @@ class TimerSpec extends ScalaTestWithActorTestKit(""" // FIXME #24348: eventfilter support in typed testkit import scaladsl.adapter._ - implicit val untypedSystem = system.toUntyped + implicit val classicSystem = system.toClassic sealed trait Command case class Tick(n: Int) extends Command @@ -313,7 +313,7 @@ class TimerSpec extends ScalaTestWithActorTestKit(""" ref ! "stop" } probe.expectTerminated(ref) - system.toUntyped.eventStream.subscribe(probe.ref.toUntyped, classOf[DeadLetter]) + system.toClassic.eventStream.subscribe(probe.ref.toClassic, classOf[DeadLetter]) probe.expectNoMessage(1.second) } } diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/TransformMessagesSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/TransformMessagesSpec.scala index dd920168d5..b48fda98b4 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/TransformMessagesSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/TransformMessagesSpec.scala @@ -35,7 +35,7 @@ class TransformMessagesSpec extends ScalaTestWithActorTestKit(""" akka.loggers = [akka.testkit.TestEventListener] """) with WordSpecLike { - implicit val untypedSystem = system.toUntyped + implicit val classicSystem = system.toClassic def intToString(probe: ActorRef[String]): Behavior[Int] = { Behaviors diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/WatchSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/WatchSpec.scala index 29db4f7fff..ef26168619 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/WatchSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/WatchSpec.scala @@ -46,7 +46,7 @@ object WatchSpec { class WatchSpec extends ScalaTestWithActorTestKit(WatchSpec.config) with WordSpecLike { - implicit def untypedSystem = system.toUntyped + implicit def classicSystem = system.toClassic import WatchSpec._ diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/coexistence/UntypedSupervisingTypedSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/coexistence/ClassicSupervisingTypedSpec.scala similarity index 59% rename from akka-actor-typed-tests/src/test/scala/akka/actor/typed/coexistence/UntypedSupervisingTypedSpec.scala rename to akka-actor-typed-tests/src/test/scala/akka/actor/typed/coexistence/ClassicSupervisingTypedSpec.scala index dec3ff7e42..811972ee23 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/coexistence/UntypedSupervisingTypedSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/coexistence/ClassicSupervisingTypedSpec.scala @@ -7,11 +7,11 @@ import akka.actor.Actor import akka.actor.testkit.typed.TestException import akka.actor.typed.scaladsl.Behaviors import akka.actor.typed._ -import akka.actor.typed.coexistence.UntypedSupervisingTypedSpec.{ - SpawnAnonFromUntyped, - SpawnFromUntyped, - TypedSpawnedFromUntypedConext, - UntypedToTyped +import akka.actor.typed.coexistence.ClassicSupervisingTypedSpec.{ + ClassicToTyped, + SpawnAnonFromClassic, + SpawnFromClassic, + TypedSpawnedFromClassicContext } import akka.testkit.{ AkkaSpec, ImplicitSender, TestProbe } import akka.actor.typed.scaladsl.adapter._ @@ -31,55 +31,55 @@ object ProbedBehavior { } } -object UntypedSupervisingTypedSpec { +object ClassicSupervisingTypedSpec { - case class SpawnFromUntyped(behav: Behavior[String], name: String) - case class SpawnAnonFromUntyped(behav: Behavior[String]) - case class TypedSpawnedFromUntypedConext(actorRef: ActorRef[String]) + case class SpawnFromClassic(behav: Behavior[String], name: String) + case class SpawnAnonFromClassic(behav: Behavior[String]) + case class TypedSpawnedFromClassicContext(actorRef: ActorRef[String]) - class UntypedToTyped extends Actor { + class ClassicToTyped extends Actor { override def receive: Receive = { - case SpawnFromUntyped(behav, name) => - sender() ! TypedSpawnedFromUntypedConext(context.spawn(behav, name)) - case SpawnAnonFromUntyped(behav) => - sender() ! TypedSpawnedFromUntypedConext(context.spawnAnonymous(behav)) + case SpawnFromClassic(behav, name) => + sender() ! TypedSpawnedFromClassicContext(context.spawn(behav, name)) + case SpawnAnonFromClassic(behav) => + sender() ! TypedSpawnedFromClassicContext(context.spawnAnonymous(behav)) } } } -class UntypedSupervisingTypedSpec +class ClassicSupervisingTypedSpec extends AkkaSpec("akka.actor.testkit.typed.expect-no-message-default = 50 ms") with ImplicitSender { implicit val typedActorSystem: ActorSystem[Nothing] = system.toTyped - "An untyped actor system that spawns typed actors" should { + "A classic actor system that spawns typed actors" should { "default to stop for supervision" in { val probe = TestProbe() val underTest = system.spawn(ProbedBehavior.behavior(probe.ref), "a1") - watch(underTest.toUntyped) + watch(underTest.toClassic) underTest ! "throw" probe.expectMsg(PostStop) probe.expectNoMessage() - expectTerminated(underTest.toUntyped) + expectTerminated(underTest.toClassic) } "default to stop for supervision for spawn anonymous" in { val probe = TestProbe() val underTest = system.spawnAnonymous(ProbedBehavior.behavior(probe.ref)) - watch(underTest.toUntyped) + watch(underTest.toClassic) underTest ! "throw" probe.expectMsg(PostStop) probe.expectNoMessage() - expectTerminated(underTest.toUntyped) + expectTerminated(underTest.toClassic) } "allows overriding the default" in { val probe = TestProbe() val value = Behaviors.supervise(ProbedBehavior.behavior(probe.ref)).onFailure(SupervisorStrategy.restart) val underTest = system.spawn(value, "a2") - watch(underTest.toUntyped) + watch(underTest.toClassic) underTest ! "throw" probe.expectMsg(PreRestart) probe.expectNoMessage() @@ -87,24 +87,24 @@ class UntypedSupervisingTypedSpec } "default to stop supervision (from context)" in { - val untyped = system.actorOf(u.Props(new UntypedToTyped())) + val classic = system.actorOf(u.Props(new ClassicToTyped())) val probe = TestProbe() - untyped ! SpawnFromUntyped(ProbedBehavior.behavior(probe.ref), "a3") - val underTest = expectMsgType[TypedSpawnedFromUntypedConext].actorRef - watch(underTest.toUntyped) + classic ! SpawnFromClassic(ProbedBehavior.behavior(probe.ref), "a3") + val underTest = expectMsgType[TypedSpawnedFromClassicContext].actorRef + watch(underTest.toClassic) underTest ! "throw" probe.expectMsg(PostStop) probe.expectNoMessage() - expectTerminated(underTest.toUntyped) + expectTerminated(underTest.toClassic) } "allow overriding the default (from context)" in { - val untyped = system.actorOf(u.Props(new UntypedToTyped())) + val classic = system.actorOf(u.Props(new ClassicToTyped())) val probe = TestProbe() val behavior = Behaviors.supervise(ProbedBehavior.behavior(probe.ref)).onFailure(SupervisorStrategy.restart) - untyped ! SpawnFromUntyped(behavior, "a4") - val underTest = expectMsgType[TypedSpawnedFromUntypedConext].actorRef - watch(underTest.toUntyped) + classic ! SpawnFromClassic(behavior, "a4") + val underTest = expectMsgType[TypedSpawnedFromClassicContext].actorRef + watch(underTest.toClassic) underTest ! "throw" probe.expectMsg(PreRestart) probe.expectNoMessage() @@ -112,15 +112,15 @@ class UntypedSupervisingTypedSpec } "default to stop supervision for spawn anonymous (from context)" in { - val untyped = system.actorOf(u.Props(new UntypedToTyped())) + val classic = system.actorOf(u.Props(new ClassicToTyped())) val probe = TestProbe() - untyped ! SpawnAnonFromUntyped(ProbedBehavior.behavior(probe.ref)) - val underTest = expectMsgType[TypedSpawnedFromUntypedConext].actorRef - watch(underTest.toUntyped) + classic ! SpawnAnonFromClassic(ProbedBehavior.behavior(probe.ref)) + val underTest = expectMsgType[TypedSpawnedFromClassicContext].actorRef + watch(underTest.toClassic) underTest ! "throw" probe.expectMsg(PostStop) probe.expectNoMessage() - expectTerminated(underTest.toUntyped) + expectTerminated(underTest.toClassic) } } diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/coexistence/TypedSupervisingUntypedSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/coexistence/TypedSupervisingClassicSpec.scala similarity index 52% rename from akka-actor-typed-tests/src/test/scala/akka/actor/typed/coexistence/TypedSupervisingUntypedSpec.scala rename to akka-actor-typed-tests/src/test/scala/akka/actor/typed/coexistence/TypedSupervisingClassicSpec.scala index bf617abb1a..7f82a9d1fa 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/coexistence/TypedSupervisingUntypedSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/coexistence/TypedSupervisingClassicSpec.scala @@ -10,21 +10,21 @@ import akka.actor.typed.ActorRef import akka.actor.typed.scaladsl.Behaviors import org.scalatest.WordSpecLike import akka.actor.typed.scaladsl.adapter._ -import akka.{ actor => untyped } +import akka.{ actor => classic } -object TypedSupervisingUntypedSpec { +object TypedSupervisingClassicSpec { sealed trait Protocol - final case class SpawnUntypedActor(props: untyped.Props, replyTo: ActorRef[SpawnedUntypedActor]) extends Protocol - final case class SpawnedUntypedActor(ref: untyped.ActorRef) + final case class SpawnClassicActor(props: classic.Props, replyTo: ActorRef[SpawnedClassicActor]) extends Protocol + final case class SpawnedClassicActor(ref: classic.ActorRef) - def untypedActorOf() = Behaviors.receive[Protocol] { - case (ctx, SpawnUntypedActor(props, replyTo)) => - replyTo ! SpawnedUntypedActor(ctx.actorOf(props)) + def classicActorOf() = Behaviors.receive[Protocol] { + case (ctx, SpawnClassicActor(props, replyTo)) => + replyTo ! SpawnedClassicActor(ctx.actorOf(props)) Behaviors.same } - class UntypedActor(lifecycleProbe: ActorRef[String]) extends Actor { + class CLassicActor(lifecycleProbe: ActorRef[String]) extends Actor { override def receive: Receive = { case "throw" => throw TestException("oh dear") } @@ -40,22 +40,22 @@ object TypedSupervisingUntypedSpec { } -class TypedSupervisingUntypedSpec extends ScalaTestWithActorTestKit(""" +class TypedSupervisingClassicSpec extends ScalaTestWithActorTestKit(""" akka.loglevel = INFO """.stripMargin) with WordSpecLike { - import TypedSupervisingUntypedSpec._ + import TypedSupervisingClassicSpec._ - "Typed supervising untyped" should { + "Typed supervising classic" should { "default to restart" in { - val ref: ActorRef[Protocol] = spawn(untypedActorOf()) + val ref: ActorRef[Protocol] = spawn(classicActorOf()) val lifecycleProbe = TestProbe[String] - val probe = TestProbe[SpawnedUntypedActor] - ref ! SpawnUntypedActor(untyped.Props(new UntypedActor(lifecycleProbe.ref)), probe.ref) - val spawnedUntyped = probe.expectMessageType[SpawnedUntypedActor].ref + val probe = TestProbe[SpawnedClassicActor] + ref ! SpawnClassicActor(classic.Props(new CLassicActor(lifecycleProbe.ref)), probe.ref) + val spawnedClassic = probe.expectMessageType[SpawnedClassicActor].ref lifecycleProbe.expectMessage("preStart") - spawnedUntyped ! "throw" + spawnedClassic ! "throw" lifecycleProbe.expectMessage("postStop") - // should be restarted because it is an untyped actor + // should be restarted because it is a classic actor lifecycleProbe.expectMessage("preStart") } } diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/internal/ActorRefSerializationSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/internal/ActorRefSerializationSpec.scala index 2d35a6a427..27f79fed56 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/internal/ActorRefSerializationSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/internal/ActorRefSerializationSpec.scala @@ -29,7 +29,7 @@ object ActorRefSerializationSpec { class ActorRefSerializationSpec extends ScalaTestWithActorTestKit(ActorRefSerializationSpec.config) with WordSpecLike { - val serialization = SerializationExtension(system.toUntyped) + val serialization = SerializationExtension(system.toClassic) "ActorRef[T]" must { "be serialized and deserialized by MiscMessageSerializer" in { diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/internal/ActorSystemSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/internal/ActorSystemSpec.scala index 8b1407c813..2515b420e5 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/internal/ActorSystemSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/internal/ActorSystemSpec.scala @@ -57,7 +57,7 @@ class ActorSystemSpec extends WordSpec with Matchers with BeforeAndAfterAll with } inbox.receiveAll() should ===("hello" :: Nil) sys.whenTerminated.futureValue - CoordinatedShutdown(sys.toUntyped).shutdownReason() should ===( + CoordinatedShutdown(sys.toClassic).shutdownReason() should ===( Some(CoordinatedShutdown.ActorSystemTerminateReason)) } } @@ -93,7 +93,7 @@ class ActorSystemSpec extends WordSpec with Matchers with BeforeAndAfterAll with // now we know that the guardian has started, and should receive PostStop sys.terminate() sys.whenTerminated.futureValue - CoordinatedShutdown(sys.toUntyped).shutdownReason() should ===( + CoordinatedShutdown(sys.toClassic).shutdownReason() should ===( Some(CoordinatedShutdown.ActorSystemTerminateReason)) inbox.receiveAll() should ===("done" :: Nil) } diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/internal/receptionist/ServiceKeySerializationSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/internal/receptionist/ServiceKeySerializationSpec.scala index d069bc8c8d..9736978dc7 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/internal/receptionist/ServiceKeySerializationSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/internal/receptionist/ServiceKeySerializationSpec.scala @@ -15,7 +15,7 @@ class ServiceKeySerializationSpec extends ScalaTestWithActorTestKit(ActorRefSerializationSpec.config) with WordSpecLike { - val serialization = SerializationExtension(system.toUntyped) + val serialization = SerializationExtension(system.toClassic) "ServiceKey[T]" must { "be serialized and deserialized by ServiceKeySerializer" in { diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/ActorContextAskSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/ActorContextAskSpec.scala index 75c4ba6a75..26d66ed8fd 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/ActorContextAskSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/ActorContextAskSpec.scala @@ -33,7 +33,7 @@ object ActorContextAskSpec { class ActorContextAskSpec extends ScalaTestWithActorTestKit(ActorContextAskSpec.config) with WordSpecLike { - implicit val untyped = system.toUntyped // FIXME #24348: eventfilter support in typed testkit + implicit val classic = system.toClassic // FIXME #24348: eventfilter support in testkit "The Scala DSL ActorContext" must { diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/ActorLoggingSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/ActorLoggingSpec.scala index 438ad6bb21..ae78c663fd 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/ActorLoggingSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/ActorLoggingSpec.scala @@ -44,9 +44,9 @@ class ActorLoggingSpec extends ScalaTestWithActorTestKit(""" val marker = LogMarker("marker") val cause = new TestException("böö") - implicit val untyped = system.toUntyped + implicit val classic = system.toClassic - "Logging in a typed actor" must { + "Logging in an actor" must { "be conveniently available from the context" in { val actor = diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/MessageAdapterSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/MessageAdapterSpec.scala index 8ba38c912d..ae90d30315 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/MessageAdapterSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/MessageAdapterSpec.scala @@ -33,7 +33,7 @@ object MessageAdapterSpec { class MessageAdapterSpec extends ScalaTestWithActorTestKit(MessageAdapterSpec.config) with WordSpecLike { - implicit val untyped = system.toUntyped // FIXME #24348: eventfilter support in typed testkit + implicit val classic = system.toClassic // FIXME #24348: eventfilter support in testkit "Message adapters" must { diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/RoutersSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/RoutersSpec.scala index 9d2111c567..96cb451bd3 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/RoutersSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/RoutersSpec.scala @@ -25,7 +25,7 @@ class RoutersSpec extends ScalaTestWithActorTestKit(""" """) with WordSpecLike with Matchers { // needed for the event filter - implicit val untypedSystem = system.toUntyped + implicit val classicSystem = system.toClassic def compileOnlyApiCoverage(): Unit = { Routers.group(ServiceKey[String]("key")).withRandomRouting().withRoundRobinRouting() @@ -152,7 +152,7 @@ class RoutersSpec extends ScalaTestWithActorTestKit(""" val serviceKey = ServiceKey[String]("group-routing-2") val group = spawn(Routers.group(serviceKey), "group-router-2") val probe = TestProbe[Dropped]() - system.toUntyped.eventStream.subscribe(probe.ref.toUntyped, classOf[Dropped]) + system.toClassic.eventStream.subscribe(probe.ref.toClassic, classOf[Dropped]) (0 to 3).foreach { n => val msg = s"message-$n" diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/StashSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/StashSpec.scala index bc81e3c25a..155b83b040 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/StashSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/StashSpec.scala @@ -257,9 +257,9 @@ class UnstashingSpec extends ScalaTestWithActorTestKit(""" """) with WordSpecLike { // needed for EventFilter - private implicit val untypedSys: akka.actor.ActorSystem = { + private implicit val classicSys: akka.actor.ActorSystem = { import akka.actor.typed.scaladsl.adapter._ - system.toUntyped + system.toClassic } private def slowStoppingChild(latch: CountDownLatch): Behavior[String] = @@ -638,7 +638,7 @@ class UnstashingSpec extends ScalaTestWithActorTestKit(""" "deal with stop" in { val probe = TestProbe[Any] import akka.actor.typed.scaladsl.adapter._ - untypedSys.eventStream.subscribe(probe.ref.toUntyped, classOf[DeadLetter]) + classicSys.eventStream.subscribe(probe.ref.toClassic, classOf[DeadLetter]) val ref = spawn(Behaviors.withStash[String](10) { stash => stash.stash("one") stash.stash("two") diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/adapter/AdapterSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/adapter/AdapterSpec.scala index 5a92999a16..71378c5489 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/adapter/AdapterSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/adapter/AdapterSpec.scala @@ -16,53 +16,53 @@ import akka.actor.typed.Terminated import akka.testkit._ import akka.Done import akka.NotUsed -import akka.{ actor => untyped } +import akka.{ actor => classic } object AdapterSpec { - val untyped1: untyped.Props = untyped.Props(new Untyped1) + val classic1: classic.Props = classic.Props(new Classic1) - class Untyped1 extends untyped.Actor { + class Classic1 extends classic.Actor { def receive = { case "ping" => sender() ! "pong" case t: ThrowIt => throw t } } - def untypedForwarder(ref: untyped.ActorRef): untyped.Props = untyped.Props(new UntypedForwarder(ref)) + def classicForwarder(ref: classic.ActorRef): classic.Props = classic.Props(new ClassicForwarder(ref)) - class UntypedForwarder(ref: untyped.ActorRef) extends untyped.Actor { + class ClassicForwarder(ref: classic.ActorRef) extends classic.Actor { def receive = { case a: String => ref ! a } } - def typed1(ref: untyped.ActorRef, probe: ActorRef[String]): Behavior[String] = + def typed1(ref: classic.ActorRef, probe: ActorRef[String]): Behavior[String] = Behaviors .receive[String] { (context, message) => message match { case "send" => - val replyTo = context.self.toUntyped + val replyTo = context.self.toClassic ref.tell("ping", replyTo) Behaviors.same case "pong" => probe ! "ok" Behaviors.same case "actorOf" => - val child = context.actorOf(untyped1) - child.tell("ping", context.self.toUntyped) + val child = context.actorOf(classic1) + child.tell("ping", context.self.toClassic) Behaviors.same case "watch" => context.watch(ref) Behaviors.same case "supervise-restart" => // restart is the default - val child = context.actorOf(untyped1) + val child = context.actorOf(classic1) context.watch(child) child ! ThrowIt3 - child.tell("ping", context.self.toUntyped) + child.tell("ping", context.self.toClassic) Behaviors.same case "stop-child" => - val child = context.actorOf(untyped1) + val child = context.actorOf(classic1) context.watch(child) context.stop(child) Behaviors.same @@ -90,24 +90,24 @@ object AdapterSpec { case object ThrowIt2 extends ThrowIt case object ThrowIt3 extends ThrowIt - def untyped2(ref: ActorRef[Ping], probe: ActorRef[String]): untyped.Props = - untyped.Props(new Untyped2(ref, probe)) + def classic2(ref: ActorRef[Ping], probe: ActorRef[String]): classic.Props = + classic.Props(new Classic2(ref, probe)) - class Untyped2(ref: ActorRef[Ping], probe: ActorRef[String]) extends untyped.Actor { + class Classic2(ref: ActorRef[Ping], probe: ActorRef[String]) extends classic.Actor { - override val supervisorStrategy = untyped.OneForOneStrategy() { + override val supervisorStrategy = classic.OneForOneStrategy() { ({ case ThrowIt1 => probe ! "thrown-stop" - untyped.SupervisorStrategy.Stop + classic.SupervisorStrategy.Stop case ThrowIt2 => probe ! "thrown-resume" - untyped.SupervisorStrategy.Resume + classic.SupervisorStrategy.Resume case ThrowIt3 => probe ! "thrown-restart" // TODO Restart will not really restart the behavior - untyped.SupervisorStrategy.Restart - }: untyped.SupervisorStrategy.Decider).orElse(untyped.SupervisorStrategy.defaultDecider) + classic.SupervisorStrategy.Restart + }: classic.SupervisorStrategy.Decider).orElse(classic.SupervisorStrategy.defaultDecider) } def receive = { @@ -122,7 +122,7 @@ object AdapterSpec { child ! Ping(self) case "watch" => context.watch(ref) - case untyped.Terminated(_) => + case classic.Terminated(_) => probe ! "terminated" case "supervise-stop" => testSupervice(ThrowIt1) @@ -157,7 +157,7 @@ object AdapterSpec { } } - def typed2Props: untyped.Props = PropsAdapter(typed2) + def typed2Props: classic.Props = PropsAdapter(typed2) } @@ -181,7 +181,7 @@ class AdapterSpec extends AkkaSpec(""" system = ActorSystem.create( Behaviors.setup[NotUsed](_ => Behaviors.stopped[NotUsed]), "AdapterSpec-stopping-guardian") - } finally if (system != null) shutdown(system.toUntyped) + } finally if (system != null) shutdown(system.toClassic) } } @@ -197,84 +197,84 @@ class AdapterSpec extends AkkaSpec(""" }, "AdapterSpec-stopping-guardian-2") - } finally if (system != null) shutdown(system.toUntyped) + } finally if (system != null) shutdown(system.toClassic) } } } "Adapted actors" must { - "send message from typed to untyped" in { + "send message from typed to classic" in { val probe = TestProbe() - val untypedRef = system.actorOf(untyped1) - val typedRef = system.spawnAnonymous(typed1(untypedRef, probe.ref)) + val classicRef = system.actorOf(classic1) + val typedRef = system.spawnAnonymous(typed1(classicRef, probe.ref)) typedRef ! "send" probe.expectMsg("ok") } - "not send null message from typed to untyped" in { + "not send null message from typed to classic" in { val probe = TestProbe() - val untypedRef = system.actorOf(untyped1) - val typedRef = system.spawnAnonymous(typed1(untypedRef, probe.ref)) + val classicRef = system.actorOf(classic1) + val typedRef = system.spawnAnonymous(typed1(classicRef, probe.ref)) intercept[InvalidMessageException] { typedRef ! null } } - "send message from untyped to typed" in { + "send message from classic to typed" in { val probe = TestProbe() val typedRef = system.spawnAnonymous(typed2) - val untypedRef = system.actorOf(untyped2(typedRef, probe.ref)) - untypedRef ! "send" + val classicRef = system.actorOf(classic2(typedRef, probe.ref)) + classicRef ! "send" probe.expectMsg("ok") } - "spawn typed child from untyped parent" in { + "spawn typed child from classic parent" in { val probe = TestProbe() val ign = system.spawnAnonymous(Behaviors.ignore[Ping]) - val untypedRef = system.actorOf(untyped2(ign, probe.ref)) - untypedRef ! "spawn" + val classicRef = system.actorOf(classic2(ign, probe.ref)) + classicRef ! "spawn" probe.expectMsg("ok") } - "actorOf typed child via Props from untyped parent" in { + "actorOf typed child via Props from classic parent" in { val probe = TestProbe() val ign = system.spawnAnonymous(Behaviors.ignore[Ping]) - val untypedRef = system.actorOf(untyped2(ign, probe.ref)) - untypedRef ! "actorOf-props" + val classicRef = system.actorOf(classic2(ign, probe.ref)) + classicRef ! "actorOf-props" probe.expectMsg("ok") } - "actorOf untyped child from typed parent" in { + "actorOf classic child from typed parent" in { val probe = TestProbe() - val ignore = system.actorOf(untyped.Props.empty) + val ignore = system.actorOf(classic.Props.empty) val typedRef = system.spawnAnonymous(typed1(ignore, probe.ref)) typedRef ! "actorOf" probe.expectMsg("ok") } - "watch typed from untyped" in { + "watch typed from classic" in { val probe = TestProbe() val typedRef = system.spawnAnonymous(typed2) - val untypedRef = system.actorOf(untyped2(typedRef, probe.ref)) - untypedRef ! "watch" + val classicRef = system.actorOf(classic2(typedRef, probe.ref)) + classicRef ! "watch" typedRef ! StopIt probe.expectMsg("terminated") } - "watch untyped from typed" in { + "watch classic from typed" in { val probe = TestProbe() - val untypedRef = system.actorOf(untyped1) - val typedRef = system.spawnAnonymous(typed1(untypedRef, probe.ref)) + val classicRef = system.actorOf(classic1) + val typedRef = system.spawnAnonymous(typed1(classicRef, probe.ref)) typedRef ! "watch" - untypedRef ! untyped.PoisonPill + classicRef ! classic.PoisonPill probe.expectMsg("terminated") } - "supervise untyped child from typed parent" in { - // FIXME there's a warning with null logged from the untyped empty child here, where does that come from? + "supervise classic child from typed parent" in { + // FIXME there's a warning with null logged from the classic empty child here, where does that come from? val probe = TestProbe() - val ignore = system.actorOf(untyped.Props.empty) + val ignore = system.actorOf(classic.Props.empty) val typedRef = system.spawnAnonymous(typed1(ignore, probe.ref)) // only stop supervisorStrategy @@ -284,17 +284,17 @@ class AdapterSpec extends AkkaSpec(""" } } - "stop typed child from untyped parent" in { + "stop typed child from classic parent" in { val probe = TestProbe() val ignore = system.spawnAnonymous(Behaviors.ignore[Ping]) - val untypedRef = system.actorOf(untyped2(ignore, probe.ref)) - untypedRef ! "stop-child" + val classicRef = system.actorOf(classic2(ignore, probe.ref)) + classicRef ! "stop-child" probe.expectMsg("terminated") } - "stop untyped child from typed parent" in { + "stop classic child from typed parent" in { val probe = TestProbe() - val ignore = system.actorOf(untyped.Props.empty) + val ignore = system.actorOf(classic.Props.empty) val typedRef = system.spawnAnonymous(typed1(ignore, probe.ref)) typedRef ! "stop-child" probe.expectMsg("terminated") diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/adapter/GuardianStartupSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/adapter/GuardianStartupSpec.scala index 9cffa424c0..2eeaf099d3 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/adapter/GuardianStartupSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/adapter/GuardianStartupSpec.scala @@ -42,7 +42,7 @@ class GuardianStartupSpec extends WordSpec with Matchers with ScalaFutures { var system: ActorSystem[String] = null val initialized = new CountDownLatch(1) val guardianBehavior = Behaviors.setup[String] { ctx => - ctx.system.toUntyped.asInstanceOf[ActorSystemImpl].assertInitialized() + ctx.system.toClassic.asInstanceOf[ActorSystemImpl].assertInitialized() initialized.countDown() Behaviors.empty } diff --git a/akka-actor-typed-tests/src/test/scala/docs/akka/typed/coexistence/UntypedWatchingTypedSpec.scala b/akka-actor-typed-tests/src/test/scala/docs/akka/typed/coexistence/ClassicWatchingTypedSpec.scala similarity index 66% rename from akka-actor-typed-tests/src/test/scala/docs/akka/typed/coexistence/UntypedWatchingTypedSpec.scala rename to akka-actor-typed-tests/src/test/scala/docs/akka/typed/coexistence/ClassicWatchingTypedSpec.scala index 165c245929..55051293cf 100644 --- a/akka-actor-typed-tests/src/test/scala/docs/akka/typed/coexistence/UntypedWatchingTypedSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/docs/akka/typed/coexistence/ClassicWatchingTypedSpec.scala @@ -9,24 +9,24 @@ import akka.actor.typed._ import akka.actor.typed.scaladsl.Behaviors import akka.testkit.TestKit //#adapter-import -// adds support for typed actors to an untyped actor system and context +// adds support for actors to a classic actor system and context import akka.actor.typed.scaladsl.adapter._ //#adapter-import import akka.testkit.TestProbe //#import-alias -import akka.{ actor => untyped } +import akka.{ actor => classic } //#import-alias import org.scalatest.WordSpec import scala.concurrent.duration._ -object UntypedWatchingTypedSpec { - object Untyped { - def props() = untyped.Props(new Untyped) +object ClassicWatchingTypedSpec { + object Classic { + def props() = classic.Props(new Classic) } - //#untyped-watch - class Untyped extends untyped.Actor with ActorLogging { + //#classic-watch + class Classic extends classic.Actor with ActorLogging { // context.spawn is an implicit extension method val second: ActorRef[Typed.Command] = context.spawn(Typed(), "second") @@ -44,12 +44,12 @@ object UntypedWatchingTypedSpec { log.info(s"$self got Pong from ${sender()}") // context.stop is an implicit extension method context.stop(second) - case untyped.Terminated(ref) => + case classic.Terminated(ref) => log.info(s"$self observed termination of $ref") context.stop(self) } } - //#untyped-watch + //#classic-watch //#typed object Typed { @@ -62,7 +62,7 @@ object UntypedWatchingTypedSpec { message match { case Ping(replyTo) => context.log.info(s"${context.self} got Ping from $replyTo") - // replyTo is an untyped actor that has been converted for coexistence + // replyTo is a classic actor that has been converted for coexistence replyTo ! Pong Behaviors.same } @@ -71,28 +71,28 @@ object UntypedWatchingTypedSpec { //#typed } -class UntypedWatchingTypedSpec extends WordSpec { +class ClassicWatchingTypedSpec extends WordSpec { - import UntypedWatchingTypedSpec._ + import ClassicWatchingTypedSpec._ - "Untyped -> Typed" must { + "Classic -> Typed" must { "support creating, watching and messaging" in { - val system = untyped.ActorSystem("Coexistence") - //#create-untyped - val untypedActor = system.actorOf(Untyped.props()) - //#create-untyped + val system = classic.ActorSystem("Coexistence") + //#create-classic + val classicActor = system.actorOf(Classic.props()) + //#create-classic val probe = TestProbe()(system) - probe.watch(untypedActor) - probe.expectTerminated(untypedActor, 200.millis) + probe.watch(classicActor) + probe.expectTerminated(classicActor, 200.millis) TestKit.shutdownActorSystem(system) } - "support converting an untyped actor system to a typed actor system" in { - //#convert-untyped + "support converting a classic actor system to an actor system" in { + //#convert-classic - val system = akka.actor.ActorSystem("UntypedToTypedSystem") + val system = akka.actor.ActorSystem("ClassicToTypedSystem") val typedSystem: ActorSystem[Nothing] = system.toTyped - //#convert-untyped + //#convert-classic typedSystem.scheduler // remove compile warning TestKit.shutdownActorSystem(system) } diff --git a/akka-actor-typed-tests/src/test/scala/docs/akka/typed/coexistence/TypedWatchingUntypedSpec.scala b/akka-actor-typed-tests/src/test/scala/docs/akka/typed/coexistence/TypedWatchingClassicSpec.scala similarity index 64% rename from akka-actor-typed-tests/src/test/scala/docs/akka/typed/coexistence/TypedWatchingUntypedSpec.scala rename to akka-actor-typed-tests/src/test/scala/docs/akka/typed/coexistence/TypedWatchingClassicSpec.scala index 93b90de460..4765819414 100644 --- a/akka-actor-typed-tests/src/test/scala/docs/akka/typed/coexistence/TypedWatchingUntypedSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/docs/akka/typed/coexistence/TypedWatchingClassicSpec.scala @@ -7,19 +7,19 @@ package docs.akka.typed.coexistence import akka.actor.typed._ import akka.actor.typed.scaladsl.Behaviors import akka.testkit.TestKit -import docs.akka.typed.coexistence.TypedWatchingUntypedSpec.Typed +import docs.akka.typed.coexistence.TypedWatchingClassicSpec.Typed //#adapter-import -// adds support for typed actors to an untyped actor system and context +// adds support for typed actors to a classic actor system and context import akka.actor.typed.scaladsl.adapter._ //#adapter-import import akka.testkit.TestProbe //#import-alias -import akka.{ actor => untyped } +import akka.{ actor => classic } //#import-alias import org.scalatest.WordSpec import scala.concurrent.duration._ -object TypedWatchingUntypedSpec { +object TypedWatchingClassicSpec { //#typed object Typed { @@ -30,20 +30,20 @@ object TypedWatchingUntypedSpec { val behavior: Behavior[Command] = Behaviors.setup { context => // context.actorOf is an implicit extension method - val untyped = context.actorOf(Untyped.props(), "second") + val classic = context.actorOf(Classic.props(), "second") // context.watch is an implicit extension method - context.watch(untyped) + context.watch(classic) - // illustrating how to pass sender, toUntyped is an implicit extension method - untyped.tell(Typed.Ping(context.self), context.self.toUntyped) + // illustrating how to pass sender, toClassic is an implicit extension method + classic.tell(Typed.Ping(context.self), context.self.toClassic) Behaviors .receivePartial[Command] { case (context, Pong) => // it's not possible to get the sender, that must be sent in message // context.stop is an implicit extension method - context.stop(untyped) + context.stop(classic) Behaviors.same } .receiveSignal { @@ -54,32 +54,32 @@ object TypedWatchingUntypedSpec { } //#typed - //#untyped - object Untyped { - def props(): untyped.Props = untyped.Props(new Untyped) + //#classic + object Classic { + def props(): classic.Props = classic.Props(new Classic) } - class Untyped extends untyped.Actor { + class Classic extends classic.Actor { override def receive = { case Typed.Ping(replyTo) => replyTo ! Typed.Pong } } - //#untyped + //#classic } -class TypedWatchingUntypedSpec extends WordSpec { +class TypedWatchingClassicSpec extends WordSpec { - import TypedWatchingUntypedSpec._ + import TypedWatchingClassicSpec._ - "Typed -> Untyped" must { + "Typed -> Classic" must { "support creating, watching and messaging" in { //#create - val system = untyped.ActorSystem("TypedWatchingUntyped") + val system = classic.ActorSystem("TypedWatchingClassic") val typed = system.spawn(Typed.behavior, "Typed") //#create val probe = TestProbe()(system) - probe.watch(typed.toUntyped) - probe.expectTerminated(typed.toUntyped, 200.millis) + probe.watch(typed.toClassic) + probe.expectTerminated(typed.toClassic, 200.millis) TestKit.shutdownActorSystem(system) } } diff --git a/akka-actor-typed/src/main/resources/reference.conf b/akka-actor-typed/src/main/resources/reference.conf index 30d424ccff..ba101309c0 100644 --- a/akka-actor-typed/src/main/resources/reference.conf +++ b/akka-actor-typed/src/main/resources/reference.conf @@ -25,7 +25,7 @@ akka.actor.typed { restart-stash-capacity = 1000 } -# Load typed extensions by an untyped unextension. +# Load typed extensions by a classic extension. akka.library-extensions += "akka.actor.typed.internal.adapter.ActorSystemAdapter$LoadTypedExtensions" akka.actor { diff --git a/akka-actor-typed/src/main/scala/akka/actor/typed/ActorRef.scala b/akka-actor-typed/src/main/scala/akka/actor/typed/ActorRef.scala index 554d222fbc..6777ce3001 100644 --- a/akka-actor-typed/src/main/scala/akka/actor/typed/ActorRef.scala +++ b/akka-actor-typed/src/main/scala/akka/actor/typed/ActorRef.scala @@ -5,7 +5,7 @@ package akka.actor.typed import akka.annotation.DoNotInherit -import akka.{ actor => untyped } +import akka.{ actor => classic } import scala.annotation.unchecked.uncheckedVariance import akka.actor.typed.internal.InternalRecipientRef @@ -50,7 +50,7 @@ trait ActorRef[-T] extends RecipientRef[T] with java.lang.Comparable[ActorRef[_] * and more than one Actor instance can exist with the same path at different * points in time, but not concurrently. */ - def path: untyped.ActorPath + def path: classic.ActorPath @throws(classOf[java.io.ObjectStreamException]) private def writeReplace(): AnyRef = SerializedActorRef[T](this) diff --git a/akka-actor-typed/src/main/scala/akka/actor/typed/ActorRefResolver.scala b/akka-actor-typed/src/main/scala/akka/actor/typed/ActorRefResolver.scala index ceb401d066..2df0b953db 100644 --- a/akka-actor-typed/src/main/scala/akka/actor/typed/ActorRefResolver.scala +++ b/akka-actor-typed/src/main/scala/akka/actor/typed/ActorRefResolver.scala @@ -47,13 +47,13 @@ abstract class ActorRefResolver extends Extension { @InternalApi private[akka] class ActorRefResolverImpl(system: ActorSystem[_]) extends ActorRefResolver { import akka.actor.typed.scaladsl.adapter._ - private val untypedSystem = system.toUntyped.asInstanceOf[ExtendedActorSystem] + private val classicSystem = system.toClassic.asInstanceOf[ExtendedActorSystem] override def toSerializationFormat[T](ref: ActorRef[T]): String = - ref.path.toSerializationFormatWithAddress(untypedSystem.provider.getDefaultAddress) + ref.path.toSerializationFormatWithAddress(classicSystem.provider.getDefaultAddress) override def resolveActorRef[T](serializedActorRef: String): ActorRef[T] = - untypedSystem.provider.resolveActorRef(serializedActorRef) + classicSystem.provider.resolveActorRef(serializedActorRef) } object ActorRefResolverSetup { diff --git a/akka-actor-typed/src/main/scala/akka/actor/typed/ActorSystem.scala b/akka-actor-typed/src/main/scala/akka/actor/typed/ActorSystem.scala index 0514a1a780..6f90acaf22 100644 --- a/akka-actor-typed/src/main/scala/akka/actor/typed/ActorSystem.scala +++ b/akka-actor-typed/src/main/scala/akka/actor/typed/ActorSystem.scala @@ -15,7 +15,7 @@ import akka.actor.typed.internal.adapter.{ ActorSystemAdapter, GuardianStartupBe import akka.actor.typed.receptionist.Receptionist import akka.annotation.DoNotInherit import akka.util.Helpers.Requiring -import akka.{ Done, actor => untyped } +import akka.{ Done, actor => classic } import com.typesafe.config.{ Config, ConfigFactory } import scala.concurrent.{ ExecutionContextExecutor, Future } @@ -79,7 +79,7 @@ abstract class ActorSystem[-T] extends ActorRef[T] with Extensions with ClassicA * set on all threads created by the ActorSystem, if one was set during * creation. */ - def dynamicAccess: untyped.DynamicAccess + def dynamicAccess: classic.DynamicAccess /** * A generic scheduler that can initiate the execution of tasks after some delay. @@ -227,9 +227,9 @@ object ActorSystem { create(guardianBehavior, name, ActorSystemSetup.create(bootstrapSetup)) /** - * Create an ActorSystem based on the untyped [[akka.actor.ActorSystem]] + * Create an ActorSystem based on the classic [[akka.actor.ActorSystem]] * which runs Akka Typed [[Behavior]] on an emulation layer. In this - * system typed and untyped actors can coexist. + * system typed and classic actors can coexist. */ private def createInternal[T]( name: String, @@ -245,7 +245,7 @@ object ActorSystem { val appConfig = bootstrapSettings.flatMap(_.config).getOrElse(ConfigFactory.load(cl)) val executionContext = bootstrapSettings.flatMap(_.defaultExecutionContext) - val system = new untyped.ActorSystemImpl( + val system = new classic.ActorSystemImpl( name, appConfig, cl, @@ -259,28 +259,28 @@ object ActorSystem { } /** - * Wrap an untyped [[akka.actor.ActorSystem]] such that it can be used from + * Wrap a classic [[akka.actor.ActorSystem]] such that it can be used from * Akka Typed [[Behavior]]. */ - def wrap(system: untyped.ActorSystem): ActorSystem[Nothing] = - ActorSystemAdapter.AdapterExtension(system.asInstanceOf[untyped.ActorSystemImpl]).adapter + def wrap(system: classic.ActorSystem): ActorSystem[Nothing] = + ActorSystemAdapter.AdapterExtension(system.asInstanceOf[classic.ActorSystemImpl]).adapter } /** * The configuration settings that were parsed from the config by an [[ActorSystem]]. * This class is immutable. */ -final class Settings(val config: Config, val untypedSettings: untyped.ActorSystem.Settings, val name: String) { +final class Settings(val config: Config, val classicSettings: classic.ActorSystem.Settings, val name: String) { def this(classLoader: ClassLoader, config: Config, name: String) = this({ val cfg = config.withFallback(ConfigFactory.defaultReference(classLoader)) cfg.checkValid(ConfigFactory.defaultReference(classLoader), "akka") cfg - }, new untyped.ActorSystem.Settings(classLoader, config, name), name) + }, new classic.ActorSystem.Settings(classLoader, config, name), name) - def this(settings: untyped.ActorSystem.Settings) = this(settings.config, settings, settings.name) + def this(settings: classic.ActorSystem.Settings) = this(settings.config, settings, settings.name) - def setup: ActorSystemSetup = untypedSettings.setup + def setup: ActorSystemSetup = classicSettings.setup /** * Returns the String representation of the Config that this Settings is backed by diff --git a/akka-actor-typed/src/main/scala/akka/actor/typed/SpawnProtocol.scala b/akka-actor-typed/src/main/scala/akka/actor/typed/SpawnProtocol.scala index dc7bc5db6b..df46ddf374 100644 --- a/akka-actor-typed/src/main/scala/akka/actor/typed/SpawnProtocol.scala +++ b/akka-actor-typed/src/main/scala/akka/actor/typed/SpawnProtocol.scala @@ -16,7 +16,7 @@ import akka.annotation.DoNotInherit * The typical usage of this is to use it as the guardian actor of the [[ActorSystem]], possibly combined with * `Behaviors.setup` to starts some initial tasks or actors. Child actors can then be started from the outside * by telling or asking [[SpawnProtocol#Spawn]] to the actor reference of the system. When using `ask` this is - * similar to how [[akka.actor.ActorSystem#actorOf]] can be used in untyped actors with the difference that + * similar to how [[akka.actor.ActorSystem#actorOf]] can be used in classic actors with the difference that * a `Future` / `CompletionStage` of the `ActorRef` is returned. * * Stopping children is done through specific support in the protocol of the children, or stopping the entire diff --git a/akka-actor-typed/src/main/scala/akka/actor/typed/internal/MiscMessageSerializer.scala b/akka-actor-typed/src/main/scala/akka/actor/typed/internal/MiscMessageSerializer.scala index b1ae772d99..ba445d2180 100644 --- a/akka-actor-typed/src/main/scala/akka/actor/typed/internal/MiscMessageSerializer.scala +++ b/akka-actor-typed/src/main/scala/akka/actor/typed/internal/MiscMessageSerializer.scala @@ -17,7 +17,7 @@ class MiscMessageSerializer(val system: akka.actor.ExtendedActorSystem) extends SerializerWithStringManifest with BaseSerializer { - // Serializers are initialized early on. `toTyped` might then try to initialize the untyped ActorSystemAdapter extension. + // Serializers are initialized early on. `toTyped` might then try to initialize the classic ActorSystemAdapter extension. private lazy val resolver = ActorRefResolver(system.toTyped) private val ActorRefManifest = "a" diff --git a/akka-actor-typed/src/main/scala/akka/actor/typed/internal/PoisonPill.scala b/akka-actor-typed/src/main/scala/akka/actor/typed/internal/PoisonPill.scala index 17406e2f9d..069f054b96 100644 --- a/akka-actor-typed/src/main/scala/akka/actor/typed/internal/PoisonPill.scala +++ b/akka-actor-typed/src/main/scala/akka/actor/typed/internal/PoisonPill.scala @@ -14,7 +14,7 @@ import akka.annotation.InternalApi /** * INTERNAL API * - * Note that this is a `Signal` poison pill, not a universal poison pill like the untyped actor one. + * Note that this is a `Signal` poison pill, not a universal poison pill like the classic actor one. * This requires special handling on the receiving side where it is used (for example with the interceptor below). */ @InternalApi private[akka] sealed abstract class PoisonPill extends Signal diff --git a/akka-actor-typed/src/main/scala/akka/actor/typed/internal/StashBufferImpl.scala b/akka-actor-typed/src/main/scala/akka/actor/typed/internal/StashBufferImpl.scala index 307372ae1e..d6edb93333 100644 --- a/akka-actor-typed/src/main/scala/akka/actor/typed/internal/StashBufferImpl.scala +++ b/akka-actor-typed/src/main/scala/akka/actor/typed/internal/StashBufferImpl.scala @@ -186,9 +186,9 @@ import akka.util.{ unused, ConstantFun } private def unstashRestToDeadLetters(ctx: TypedActorContext[T], messages: Iterator[T]): Unit = { val scalaCtx = ctx.asScala import akka.actor.typed.scaladsl.adapter._ - val untypedDeadLetters = scalaCtx.system.deadLetters.toUntyped + val classicDeadLetters = scalaCtx.system.deadLetters.toClassic messages.foreach(msg => - scalaCtx.system.deadLetters ! DeadLetter(msg, untypedDeadLetters, ctx.asScala.self.toUntyped)) + scalaCtx.system.deadLetters ! DeadLetter(msg, classicDeadLetters, ctx.asScala.self.toClassic)) } override def unstash(behavior: Behavior[T], numberOfMessages: Int, wrap: JFunction[T, T]): Behavior[T] = diff --git a/akka-actor-typed/src/main/scala/akka/actor/typed/internal/Supervision.scala b/akka-actor-typed/src/main/scala/akka/actor/typed/internal/Supervision.scala index f4cff625c5..ebfad48073 100644 --- a/akka-actor-typed/src/main/scala/akka/actor/typed/internal/Supervision.scala +++ b/akka-actor-typed/src/main/scala/akka/actor/typed/internal/Supervision.scala @@ -91,8 +91,8 @@ private abstract class AbstractSupervisor[I, Thr <: Throwable](strategy: Supervi def dropped(ctx: TypedActorContext[_], signalOrMessage: Any): Unit = { import akka.actor.typed.scaladsl.adapter._ - ctx.asScala.system.toUntyped.eventStream - .publish(Dropped(signalOrMessage, s"Stash is full in [${getClass.getSimpleName}]", ctx.asScala.self.toUntyped)) + ctx.asScala.system.toClassic.eventStream + .publish(Dropped(signalOrMessage, s"Stash is full in [${getClass.getSimpleName}]", ctx.asScala.self.toClassic)) } protected def handleExceptionOnStart(ctx: TypedActorContext[Any], target: PreStartTarget[I]): Catcher[Behavior[I]] diff --git a/akka-actor-typed/src/main/scala/akka/actor/typed/internal/adapter/ActorAdapter.scala b/akka-actor-typed/src/main/scala/akka/actor/typed/internal/adapter/ActorAdapter.scala index 837be21968..25794370b2 100644 --- a/akka-actor-typed/src/main/scala/akka/actor/typed/internal/adapter/ActorAdapter.scala +++ b/akka-actor-typed/src/main/scala/akka/actor/typed/internal/adapter/ActorAdapter.scala @@ -9,7 +9,7 @@ package adapter import java.lang.reflect.InvocationTargetException import akka.actor.{ ActorInitializationException, ActorRefWithCell } -import akka.{ actor => untyped } +import akka.{ actor => classic } import akka.actor.typed.internal.BehaviorImpl.DeferredBehavior import akka.actor.typed.internal.BehaviorImpl.StoppedBehavior import akka.actor.typed.internal.adapter.ActorAdapter.TypedActorFailedException @@ -39,7 +39,7 @@ import akka.util.OptionVal */ final case class TypedActorFailedException(cause: Throwable) extends RuntimeException - private val DummyReceive: untyped.Actor.Receive = { + private val DummyReceive: classic.Actor.Receive = { case _ => throw new RuntimeException("receive should never be called on the typed ActorAdapter") } @@ -49,8 +49,8 @@ import akka.util.OptionVal * INTERNAL API */ @InternalApi private[typed] final class ActorAdapter[T](_initialBehavior: Behavior[T], rethrowTypedFailure: Boolean) - extends untyped.Actor - with untyped.ActorLogging { + extends classic.Actor + with classic.ActorLogging { private var behavior: Behavior[T] = _initialBehavior def currentBehavior: Behavior[T] = behavior @@ -64,19 +64,19 @@ import akka.util.OptionVal } /** - * Failures from failed children, that were stopped through untyped supervision, this is what allows us to pass + * Failures from failed children, that were stopped through classic supervision, this is what allows us to pass * child exception in Terminated for direct children. */ - private var failures: Map[untyped.ActorRef, Throwable] = Map.empty + private var failures: Map[classic.ActorRef, Throwable] = Map.empty def receive: Receive = ActorAdapter.DummyReceive override protected[akka] def aroundReceive(receive: Receive, msg: Any): Unit = { // as we know we never become in "normal" typed actors, it is just the current behavior that - // changes, we can avoid some overhead with the partial function/behavior stack of untyped entirely + // changes, we can avoid some overhead with the partial function/behavior stack of classic entirely // we also know that the receive is total, so we can avoid the orElse part as well. msg match { - case untyped.Terminated(ref) => + case classic.Terminated(ref) => val msg = if (failures contains ref) { val ex = failures(ref) @@ -84,7 +84,7 @@ import akka.util.OptionVal ChildFailed(ActorRefAdapter(ref), ex) } else Terminated(ActorRefAdapter(ref)) handleSignal(msg) - case untyped.ReceiveTimeout => + case classic.ReceiveTimeout => handleMessage(ctx.receiveTimeoutMsg) case wrapped: AdaptMessage[Any, T] @unchecked => withSafelyAdapted(() => wrapped.adapt()) { @@ -146,7 +146,7 @@ import akka.util.OptionVal unhandled(msg) case BehaviorTags.FailedBehavior => val f = b.asInstanceOf[BehaviorImpl.FailedBehavior] - // For the parent untyped supervisor to pick up the exception + // For the parent classic supervisor to pick up the exception if (rethrowTypedFailure) throw TypedActorFailedException(f.cause) else context.stop(self) case BehaviorTags.StoppedBehavior => @@ -196,11 +196,11 @@ import akka.util.OptionVal super.unhandled(other) } - override val supervisorStrategy = untyped.OneForOneStrategy(loggingEnabled = false) { + override val supervisorStrategy = classic.OneForOneStrategy(loggingEnabled = false) { case TypedActorFailedException(cause) => // These have already been optionally logged by typed supervision recordChildFailure(cause) - untyped.SupervisorStrategy.Stop + classic.SupervisorStrategy.Stop case ex => val isTypedActor = sender() match { case afwc: ActorRefWithCell => @@ -220,14 +220,14 @@ import akka.util.OptionVal // log at Error as that is what the supervision strategy would have done. log.error(ex, logMessage) if (isTypedActor) - untyped.SupervisorStrategy.Stop + classic.SupervisorStrategy.Stop else - untyped.SupervisorStrategy.Restart + classic.SupervisorStrategy.Restart } private def recordChildFailure(ex: Throwable): Unit = { val ref = sender() - if (context.asInstanceOf[untyped.ActorCell].isWatching(ref)) { + if (context.asInstanceOf[classic.ActorCell].isWatching(ref)) { failures = failures.updated(ref, ex) } } diff --git a/akka-actor-typed/src/main/scala/akka/actor/typed/internal/adapter/ActorContextAdapter.scala b/akka-actor-typed/src/main/scala/akka/actor/typed/internal/adapter/ActorContextAdapter.scala index 4024253162..3adff583e7 100644 --- a/akka-actor-typed/src/main/scala/akka/actor/typed/internal/adapter/ActorContextAdapter.scala +++ b/akka-actor-typed/src/main/scala/akka/actor/typed/internal/adapter/ActorContextAdapter.scala @@ -11,34 +11,34 @@ import akka.annotation.InternalApi import akka.event.LoggingFilterWithMarker import akka.util.OptionVal -import akka.{ actor => untyped } +import akka.{ actor => classic } import scala.concurrent.ExecutionContextExecutor import scala.concurrent.duration._ @InternalApi private[akka] object ActorContextAdapter { - private def toUntypedImp[U](context: TypedActorContext[_]): untyped.ActorContext = + private def toClassicImp[U](context: TypedActorContext[_]): classic.ActorContext = context match { - case adapter: ActorContextAdapter[_] => adapter.untypedContext + case adapter: ActorContextAdapter[_] => adapter.classicContext case _ => throw new UnsupportedOperationException( - "only adapted untyped ActorContext permissible " + + "Only adapted classic ActorContext permissible " + s"($context of class ${context.getClass.getName})") } - def toUntyped[U](context: scaladsl.ActorContext[_]): untyped.ActorContext = + def toClassic[U](context: scaladsl.ActorContext[_]): classic.ActorContext = context match { - case c: TypedActorContext[_] => toUntypedImp(c) + case c: TypedActorContext[_] => toClassicImp(c) case _ => throw new UnsupportedOperationException( "unknown ActorContext type " + s"($context of class ${context.getClass.getName})") } - def toUntyped[U](context: javadsl.ActorContext[_]): untyped.ActorContext = + def toClassic[U](context: javadsl.ActorContext[_]): classic.ActorContext = context match { - case c: TypedActorContext[_] => toUntypedImp(c) + case c: TypedActorContext[_] => toClassicImp(c) case _ => throw new UnsupportedOperationException( "unknown ActorContext type " + @@ -50,35 +50,35 @@ private[akka] object ActorContextAdapter { * INTERNAL API. Wrapping an [[akka.actor.ActorContext]] as an [[TypedActorContext]]. */ @InternalApi private[akka] final class ActorContextAdapter[T]( - val untypedContext: untyped.ActorContext, + val classicContext: classic.ActorContext, adapter: ActorAdapter[T]) extends ActorContextImpl[T] { - import ActorRefAdapter.toUntyped + import ActorRefAdapter.toClassic private[akka] override def currentBehavior: Behavior[T] = adapter.currentBehavior // lazily initialized private var actorLogger: OptionVal[Logger] = OptionVal.None - final override val self = ActorRefAdapter(untypedContext.self) - final override val system = ActorSystemAdapter(untypedContext.system) - override def children: Iterable[ActorRef[Nothing]] = untypedContext.children.map(ActorRefAdapter(_)) - override def child(name: String): Option[ActorRef[Nothing]] = untypedContext.child(name).map(ActorRefAdapter(_)) + final override val self = ActorRefAdapter(classicContext.self) + final override val system = ActorSystemAdapter(classicContext.system) + override def children: Iterable[ActorRef[Nothing]] = classicContext.children.map(ActorRefAdapter(_)) + override def child(name: String): Option[ActorRef[Nothing]] = classicContext.child(name).map(ActorRefAdapter(_)) override def spawnAnonymous[U](behavior: Behavior[U], props: Props = Props.empty): ActorRef[U] = - ActorRefFactoryAdapter.spawnAnonymous(untypedContext, behavior, props, rethrowTypedFailure = true) + ActorRefFactoryAdapter.spawnAnonymous(classicContext, behavior, props, rethrowTypedFailure = true) override def spawn[U](behavior: Behavior[U], name: String, props: Props = Props.empty): ActorRef[U] = - ActorRefFactoryAdapter.spawn(untypedContext, behavior, name, props, rethrowTypedFailure = true) + ActorRefFactoryAdapter.spawn(classicContext, behavior, name, props, rethrowTypedFailure = true) override def stop[U](child: ActorRef[U]): Unit = if (child.path.parent == self.path) { // only if a direct child - toUntyped(child) match { + toClassic(child) match { case f: akka.actor.FunctionRef => - val cell = untypedContext.asInstanceOf[akka.actor.ActorCell] + val cell = classicContext.asInstanceOf[akka.actor.ActorCell] cell.removeFunctionRef(f) case c => - untypedContext.child(child.path.name) match { + classicContext.child(child.path.name) match { case Some(`c`) => - untypedContext.stop(c) + classicContext.stop(c) case _ => // child that was already stopped } @@ -96,33 +96,33 @@ private[akka] object ActorContextAdapter { "an explicit stop message that the actor accepts.") } - override def watch[U](other: ActorRef[U]): Unit = { untypedContext.watch(toUntyped(other)) } - override def watchWith[U](other: ActorRef[U], msg: T): Unit = { untypedContext.watchWith(toUntyped(other), msg) } - override def unwatch[U](other: ActorRef[U]): Unit = { untypedContext.unwatch(toUntyped(other)) } + override def watch[U](other: ActorRef[U]): Unit = { classicContext.watch(toClassic(other)) } + override def watchWith[U](other: ActorRef[U], msg: T): Unit = { classicContext.watchWith(toClassic(other), msg) } + override def unwatch[U](other: ActorRef[U]): Unit = { classicContext.unwatch(toClassic(other)) } var receiveTimeoutMsg: T = null.asInstanceOf[T] override def setReceiveTimeout(d: FiniteDuration, msg: T): Unit = { receiveTimeoutMsg = msg - untypedContext.setReceiveTimeout(d) + classicContext.setReceiveTimeout(d) } override def cancelReceiveTimeout(): Unit = { receiveTimeoutMsg = null.asInstanceOf[T] - untypedContext.setReceiveTimeout(Duration.Undefined) + classicContext.setReceiveTimeout(Duration.Undefined) } - override def executionContext: ExecutionContextExecutor = untypedContext.dispatcher - override def scheduleOnce[U](delay: FiniteDuration, target: ActorRef[U], msg: U): untyped.Cancellable = { - import untypedContext.dispatcher - untypedContext.system.scheduler.scheduleOnce(delay, toUntyped(target), msg) + override def executionContext: ExecutionContextExecutor = classicContext.dispatcher + override def scheduleOnce[U](delay: FiniteDuration, target: ActorRef[U], msg: U): classic.Cancellable = { + import classicContext.dispatcher + classicContext.system.scheduler.scheduleOnce(delay, toClassic(target), msg) } override private[akka] def internalSpawnMessageAdapter[U](f: U => T, _name: String): ActorRef[U] = { - val cell = untypedContext.asInstanceOf[akka.actor.ActorCell] + val cell = classicContext.asInstanceOf[akka.actor.ActorCell] // apply the function inside the actor by wrapping the msg and f, handled by ActorAdapter - val ref = cell.addFunctionRef((_, msg) => untypedContext.self ! AdaptMessage[U, T](msg.asInstanceOf[U], f), _name) + val ref = cell.addFunctionRef((_, msg) => classicContext.self ! AdaptMessage[U, T](msg.asInstanceOf[U], f), _name) ActorRefAdapter[U](ref) } private def initLoggerWithClass(logClass: Class[_]): LoggerAdapterImpl = { val logSource = self.path.toString - val system = untypedContext.system.asInstanceOf[ExtendedActorSystem] + val system = classicContext.system.asInstanceOf[ExtendedActorSystem] val logger = new LoggerAdapterImpl(system.eventStream, logClass, logSource, LoggingFilterWithMarker.wrap(system.logFilter)) actorLogger = OptionVal.Some(logger) diff --git a/akka-actor-typed/src/main/scala/akka/actor/typed/internal/adapter/ActorRefAdapter.scala b/akka-actor-typed/src/main/scala/akka/actor/typed/internal/adapter/ActorRefAdapter.scala index ff6e11b3e1..ceeb0b4981 100644 --- a/akka-actor-typed/src/main/scala/akka/actor/typed/internal/adapter/ActorRefAdapter.scala +++ b/akka-actor-typed/src/main/scala/akka/actor/typed/internal/adapter/ActorRefAdapter.scala @@ -8,63 +8,63 @@ package adapter import akka.actor.ActorRefProvider import akka.actor.InvalidMessageException -import akka.{ actor => untyped } +import akka.{ actor => classic } import akka.annotation.InternalApi import akka.dispatch.sysmsg /** * INTERNAL API */ -@InternalApi private[typed] class ActorRefAdapter[-T](val untypedRef: untyped.InternalActorRef) +@InternalApi private[typed] class ActorRefAdapter[-T](val classicRef: classic.InternalActorRef) extends ActorRef[T] with internal.ActorRefImpl[T] with internal.InternalRecipientRef[T] { - override def path: untyped.ActorPath = untypedRef.path + override def path: classic.ActorPath = classicRef.path override def tell(msg: T): Unit = { if (msg == null) throw new InvalidMessageException("[null] is not an allowed message") - untypedRef ! msg + classicRef ! msg } // impl ActorRefImpl - override def isLocal: Boolean = untypedRef.isLocal + override def isLocal: Boolean = classicRef.isLocal // impl ActorRefImpl override def sendSystem(signal: internal.SystemMessage): Unit = - ActorRefAdapter.sendSystemMessage(untypedRef, signal) + ActorRefAdapter.sendSystemMessage(classicRef, signal) // impl InternalRecipientRef - override def provider: ActorRefProvider = untypedRef.provider + override def provider: ActorRefProvider = classicRef.provider // impl InternalRecipientRef - def isTerminated: Boolean = untypedRef.isTerminated + def isTerminated: Boolean = classicRef.isTerminated @throws(classOf[java.io.ObjectStreamException]) private def writeReplace(): AnyRef = SerializedActorRef[T](this) } private[akka] object ActorRefAdapter { - def apply[T](ref: untyped.ActorRef): ActorRef[T] = new ActorRefAdapter(ref.asInstanceOf[untyped.InternalActorRef]) + def apply[T](ref: classic.ActorRef): ActorRef[T] = new ActorRefAdapter(ref.asInstanceOf[classic.InternalActorRef]) - def toUntyped[U](ref: ActorRef[U]): akka.actor.InternalActorRef = + def toClassic[U](ref: ActorRef[U]): akka.actor.InternalActorRef = ref match { - case adapter: ActorRefAdapter[_] => adapter.untypedRef - case system: ActorSystemAdapter[_] => system.untypedSystem.guardian + case adapter: ActorRefAdapter[_] => adapter.classicRef + case adapter: ActorSystemAdapter[_] => adapter.system.guardian case _ => throw new UnsupportedOperationException( - "only adapted untyped ActorRefs permissible " + + "Only adapted classic ActorRefs permissible " + s"($ref of class ${ref.getClass.getName})") } - def sendSystemMessage(untypedRef: akka.actor.InternalActorRef, signal: internal.SystemMessage): Unit = + def sendSystemMessage(classicRef: akka.actor.InternalActorRef, signal: internal.SystemMessage): Unit = signal match { case internal.Create() => throw new IllegalStateException("WAT? No, seriously.") - case internal.Terminate() => untypedRef.stop() + case internal.Terminate() => classicRef.stop() case internal.Watch(watchee, watcher) => - untypedRef.sendSystemMessage(sysmsg.Watch(toUntyped(watchee), toUntyped(watcher))) + classicRef.sendSystemMessage(sysmsg.Watch(toClassic(watchee), toClassic(watcher))) case internal.Unwatch(watchee, watcher) => - untypedRef.sendSystemMessage(sysmsg.Unwatch(toUntyped(watchee), toUntyped(watcher))) + classicRef.sendSystemMessage(sysmsg.Unwatch(toClassic(watchee), toClassic(watcher))) case internal.DeathWatchNotification(ref, _) => - untypedRef.sendSystemMessage(sysmsg.DeathWatchNotification(toUntyped(ref), true, false)) + classicRef.sendSystemMessage(sysmsg.DeathWatchNotification(toClassic(ref), true, false)) case internal.NoMessage => // just to suppress the warning } } diff --git a/akka-actor-typed/src/main/scala/akka/actor/typed/internal/adapter/ActorSystemAdapter.scala b/akka-actor-typed/src/main/scala/akka/actor/typed/internal/adapter/ActorSystemAdapter.scala index 0b93edfceb..56ef53c160 100644 --- a/akka-actor-typed/src/main/scala/akka/actor/typed/internal/adapter/ActorSystemAdapter.scala +++ b/akka-actor-typed/src/main/scala/akka/actor/typed/internal/adapter/ActorSystemAdapter.scala @@ -32,104 +32,104 @@ import akka.actor.typed.internal.PropsImpl.DispatcherSameAsParent import akka.actor.typed.internal.SystemMessage import akka.annotation.InternalApi import akka.event.LoggingFilterWithMarker -import akka.{ actor => untyped } +import akka.{ actor => classic } /** - * INTERNAL API. Lightweight wrapper for presenting an untyped ActorSystem to a Behavior (via the context). + * INTERNAL API. Lightweight wrapper for presenting a classic ActorSystem to a Behavior (via the context). * Therefore it does not have a lot of vals, only the whenTerminated Future is cached after * its transformation because redoing that every time will add extra objects that persist for * a longer time; in all other cases the wrapper will just be spawned for a single call in * most circumstances. */ -@InternalApi private[akka] class ActorSystemAdapter[-T](val untypedSystem: untyped.ActorSystemImpl) +@InternalApi private[akka] class ActorSystemAdapter[-T](val system: classic.ActorSystemImpl) extends ActorSystem[T] with ActorRef[T] with ActorRefImpl[T] with InternalRecipientRef[T] with ExtensionsImpl { - // note that the untypedSystem may not be initialized yet here, and that is fine because + // note that the (classic) system may not be initialized yet here, and that is fine because // it is unlikely that anything gets a hold of the extension until the system is started import ActorRefAdapter.sendSystemMessage - override private[akka] def classicSystem: untyped.ActorSystem = untypedSystem + override private[akka] def classicSystem: classic.ActorSystem = system // Members declared in akka.actor.typed.ActorRef override def tell(msg: T): Unit = { if (msg == null) throw InvalidMessageException("[null] is not an allowed message") - untypedSystem.guardian ! msg + system.guardian ! msg } // impl ActorRefImpl override def isLocal: Boolean = true // impl ActorRefImpl - override def sendSystem(signal: SystemMessage): Unit = sendSystemMessage(untypedSystem.guardian, signal) + override def sendSystem(signal: SystemMessage): Unit = sendSystemMessage(system.guardian, signal) // impl InternalRecipientRef - override def provider: ActorRefProvider = untypedSystem.provider + override def provider: ActorRefProvider = system.provider // impl InternalRecipientRef def isTerminated: Boolean = whenTerminated.isCompleted - final override val path: untyped.ActorPath = - untyped.RootActorPath(untyped.Address("akka", untypedSystem.name)) / "user" + final override val path: classic.ActorPath = + classic.RootActorPath(classic.Address("akka", system.name)) / "user" - override def toString: String = untypedSystem.toString + override def toString: String = system.toString // Members declared in akka.actor.typed.ActorSystem - override def deadLetters[U]: ActorRef[U] = ActorRefAdapter(untypedSystem.deadLetters) + override def deadLetters[U]: ActorRef[U] = ActorRefAdapter(system.deadLetters) override def dispatchers: Dispatchers = new Dispatchers { override def lookup(selector: DispatcherSelector): ExecutionContextExecutor = selector match { - case DispatcherDefault(_) => untypedSystem.dispatcher - case DispatcherFromConfig(str, _) => untypedSystem.dispatchers.lookup(str) - case DispatcherSameAsParent(_) => untypedSystem.dispatcher + case DispatcherDefault(_) => system.dispatcher + case DispatcherFromConfig(str, _) => system.dispatchers.lookup(str) + case DispatcherSameAsParent(_) => system.dispatcher } - override def shutdown(): Unit = () // there was no shutdown in untyped Akka + override def shutdown(): Unit = () // there was no shutdown in classic Akka } - override def dynamicAccess: untyped.DynamicAccess = untypedSystem.dynamicAccess - implicit override def executionContext: scala.concurrent.ExecutionContextExecutor = untypedSystem.dispatcher + override def dynamicAccess: classic.DynamicAccess = system.dynamicAccess + implicit override def executionContext: scala.concurrent.ExecutionContextExecutor = system.dispatcher override val log: Logger = new LoggerAdapterImpl( - untypedSystem.eventStream, + system.eventStream, classOf[ActorSystem[_]], name, - LoggingFilterWithMarker.wrap(untypedSystem.logFilter)) - override def logConfiguration(): Unit = untypedSystem.logConfiguration() - override def name: String = untypedSystem.name - override val scheduler: Scheduler = new SchedulerAdapter(untypedSystem.scheduler) - override def settings: Settings = new Settings(untypedSystem.settings) - override def startTime: Long = untypedSystem.startTime - override def threadFactory: java.util.concurrent.ThreadFactory = untypedSystem.threadFactory - override def uptime: Long = untypedSystem.uptime - override def printTree: String = untypedSystem.printTree + LoggingFilterWithMarker.wrap(system.logFilter)) + override def logConfiguration(): Unit = system.logConfiguration() + override def name: String = system.name + override val scheduler: Scheduler = new SchedulerAdapter(system.scheduler) + override def settings: Settings = new Settings(system.settings) + override def startTime: Long = system.startTime + override def threadFactory: java.util.concurrent.ThreadFactory = system.threadFactory + override def uptime: Long = system.uptime + override def printTree: String = system.printTree import akka.dispatch.ExecutionContexts.sameThreadExecutionContext - override def terminate(): Unit = untypedSystem.terminate() + override def terminate(): Unit = system.terminate() override lazy val whenTerminated: scala.concurrent.Future[akka.Done] = - untypedSystem.whenTerminated.map(_ => Done)(sameThreadExecutionContext) + system.whenTerminated.map(_ => Done)(sameThreadExecutionContext) override lazy val getWhenTerminated: CompletionStage[akka.Done] = FutureConverters.toJava(whenTerminated) override def systemActorOf[U](behavior: Behavior[U], name: String, props: Props): ActorRef[U] = { - val ref = untypedSystem.systemActorOf(PropsAdapter(() => behavior, props), name) + val ref = system.systemActorOf(PropsAdapter(() => behavior, props), name) ActorRefAdapter(ref) } } private[akka] object ActorSystemAdapter { - def apply(system: untyped.ActorSystem): ActorSystem[Nothing] = AdapterExtension(system).adapter + def apply(system: classic.ActorSystem): ActorSystem[Nothing] = AdapterExtension(system).adapter // to make sure we do never create more than one adapter for the same actor system - class AdapterExtension(system: untyped.ExtendedActorSystem) extends untyped.Extension { - val adapter = new ActorSystemAdapter(system.asInstanceOf[untyped.ActorSystemImpl]) + class AdapterExtension(system: classic.ExtendedActorSystem) extends classic.Extension { + val adapter = new ActorSystemAdapter(system.asInstanceOf[classic.ActorSystemImpl]) } - object AdapterExtension extends untyped.ExtensionId[AdapterExtension] with untyped.ExtensionIdProvider { - override def get(system: untyped.ActorSystem): AdapterExtension = super.get(system) + object AdapterExtension extends classic.ExtensionId[AdapterExtension] with classic.ExtensionIdProvider { + override def get(system: classic.ActorSystem): AdapterExtension = super.get(system) override def lookup() = AdapterExtension - override def createExtension(system: untyped.ExtendedActorSystem): AdapterExtension = + override def createExtension(system: classic.ExtendedActorSystem): AdapterExtension = new AdapterExtension(system) } @@ -140,19 +140,19 @@ private[akka] object ActorSystemAdapter { * * When on the classpath typed extensions will be loaded for classic ActorSystems as well. */ - class LoadTypedExtensions(system: untyped.ExtendedActorSystem) extends untyped.Extension { + class LoadTypedExtensions(system: classic.ExtendedActorSystem) extends classic.Extension { ActorSystemAdapter.AdapterExtension(system).adapter.loadExtensions() } - object LoadTypedExtensions extends untyped.ExtensionId[LoadTypedExtensions] with untyped.ExtensionIdProvider { + object LoadTypedExtensions extends classic.ExtensionId[LoadTypedExtensions] with classic.ExtensionIdProvider { override def lookup(): actor.ExtensionId[_ <: actor.Extension] = this override def createExtension(system: ExtendedActorSystem): LoadTypedExtensions = new LoadTypedExtensions(system) } - def toUntyped[U](sys: ActorSystem[_]): untyped.ActorSystem = + def toClassic[U](sys: ActorSystem[_]): classic.ActorSystem = sys match { - case adapter: ActorSystemAdapter[_] => adapter.untypedSystem + case adapter: ActorSystemAdapter[_] => adapter.classicSystem case _ => throw new UnsupportedOperationException( "Only adapted classic ActorSystem permissible " + diff --git a/akka-actor-typed/src/main/scala/akka/actor/typed/internal/adapter/EventStreamAdapter.scala b/akka-actor-typed/src/main/scala/akka/actor/typed/internal/adapter/EventStreamAdapter.scala index a1e225347c..6b424907ea 100644 --- a/akka-actor-typed/src/main/scala/akka/actor/typed/internal/adapter/EventStreamAdapter.scala +++ b/akka-actor-typed/src/main/scala/akka/actor/typed/internal/adapter/EventStreamAdapter.scala @@ -18,7 +18,7 @@ import akka.annotation.InternalApi private[akka] val behavior: Behavior[EventStream.Command] = Behaviors.setup { ctx => - val eventStream = ctx.system.toUntyped.eventStream + val eventStream = ctx.system.toClassic.eventStream eventStreamBehavior(eventStream) } @@ -28,10 +28,10 @@ import akka.annotation.InternalApi eventStream.publish(event) Behaviors.same case s @ EventStream.Subscribe(subscriber) => - eventStream.subscribe(subscriber.toUntyped, s.topic) + eventStream.subscribe(subscriber.toClassic, s.topic) Behaviors.same case EventStream.Unsubscribe(subscriber) => - eventStream.unsubscribe(subscriber.toUntyped) + eventStream.unsubscribe(subscriber.toClassic) Behaviors.same } diff --git a/akka-actor-typed/src/main/scala/akka/actor/typed/internal/adapter/LoggerAdapterImpl.scala b/akka-actor-typed/src/main/scala/akka/actor/typed/internal/adapter/LoggerAdapterImpl.scala index 9f8588e661..4b66374809 100644 --- a/akka-actor-typed/src/main/scala/akka/actor/typed/internal/adapter/LoggerAdapterImpl.scala +++ b/akka-actor-typed/src/main/scala/akka/actor/typed/internal/adapter/LoggerAdapterImpl.scala @@ -7,7 +7,7 @@ package akka.actor.typed.internal.adapter import akka.actor.typed.{ LogMarker, Logger } import akka.annotation.InternalApi import akka.event.Logging._ -import akka.event.{ LoggingBus, LoggingFilterWithMarker, LogMarker => UntypedLM } +import akka.event.{ LoggingBus, LoggingFilterWithMarker, LogMarker => ClassicLM } import akka.util.OptionVal import akka.util.ccompat.JavaConverters._ @@ -397,13 +397,13 @@ private[akka] final class LoggerAdapterImpl( override def isDebugEnabled = loggingFilter.isDebugEnabled(logClass, logSource) override def isErrorEnabled(marker: LogMarker): Boolean = - loggingFilter.isErrorEnabled(logClass, logSource, marker.asInstanceOf[UntypedLM]) + loggingFilter.isErrorEnabled(logClass, logSource, marker.asInstanceOf[ClassicLM]) override def isWarningEnabled(marker: LogMarker): Boolean = - loggingFilter.isWarningEnabled(logClass, logSource, marker.asInstanceOf[UntypedLM]) + loggingFilter.isWarningEnabled(logClass, logSource, marker.asInstanceOf[ClassicLM]) override def isInfoEnabled(marker: LogMarker): Boolean = - loggingFilter.isInfoEnabled(logClass, logSource, marker.asInstanceOf[UntypedLM]) + loggingFilter.isInfoEnabled(logClass, logSource, marker.asInstanceOf[ClassicLM]) override def isDebugEnabled(marker: LogMarker): Boolean = - loggingFilter.isDebugEnabled(logClass, logSource, marker.asInstanceOf[UntypedLM]) + loggingFilter.isDebugEnabled(logClass, logSource, marker.asInstanceOf[ClassicLM]) override def withMdc(mdc: Map[String, Any]): Logger = { val mdcAdapter = new LoggerAdapterImpl(bus, logClass, logSource, loggingFilter) @@ -427,12 +427,12 @@ private[akka] final class LoggerAdapterImpl( val error = cause match { case OptionVal.Some(cause) => marker match { - case OptionVal.Some(m) => Error(cause, logSource, logClass, message, mdc, m.asInstanceOf[UntypedLM]) + case OptionVal.Some(m) => Error(cause, logSource, logClass, message, mdc, m.asInstanceOf[ClassicLM]) case OptionVal.None => Error(cause, logSource, logClass, message, mdc) } case OptionVal.None => marker match { - case OptionVal.Some(m) => Error(logSource, logClass, message, mdc, m.asInstanceOf[UntypedLM]) + case OptionVal.Some(m) => Error(logSource, logClass, message, mdc, m.asInstanceOf[ClassicLM]) case OptionVal.None => Error(logSource, logClass, message, mdc) } } @@ -441,10 +441,10 @@ private[akka] final class LoggerAdapterImpl( private[akka] def notifyWarning(message: String, cause: OptionVal[Throwable], marker: OptionVal[LogMarker]): Unit = { val warning = - if (cause.isDefined) Warning(cause.get, logSource, logClass, message, mdc, marker.orNull.asInstanceOf[UntypedLM]) + if (cause.isDefined) Warning(cause.get, logSource, logClass, message, mdc, marker.orNull.asInstanceOf[ClassicLM]) else marker match { - case OptionVal.Some(m) => Warning(logSource, logClass, message, mdc, m.asInstanceOf[UntypedLM]) + case OptionVal.Some(m) => Warning(logSource, logClass, message, mdc, m.asInstanceOf[ClassicLM]) case OptionVal.None => Warning(logSource, logClass, message, mdc) } bus.publish(warning) @@ -452,7 +452,7 @@ private[akka] final class LoggerAdapterImpl( private[akka] def notifyInfo(message: String, marker: OptionVal[LogMarker]): Unit = { val info = marker match { - case OptionVal.Some(m) => Info(logSource, logClass, message, mdc, m.asInstanceOf[UntypedLM]) + case OptionVal.Some(m) => Info(logSource, logClass, message, mdc, m.asInstanceOf[ClassicLM]) case OptionVal.None => Info(logSource, logClass, message, mdc) } bus.publish(info) @@ -460,7 +460,7 @@ private[akka] final class LoggerAdapterImpl( private[akka] def notifyDebug(message: String, marker: OptionVal[LogMarker]): Unit = { val debug = marker match { - case OptionVal.Some(m) => Debug(logSource, logClass, message, mdc, m.asInstanceOf[UntypedLM]) + case OptionVal.Some(m) => Debug(logSource, logClass, message, mdc, m.asInstanceOf[ClassicLM]) case OptionVal.None => Debug(logSource, logClass, message, mdc) } bus.publish(debug) diff --git a/akka-actor-typed/src/main/scala/akka/actor/typed/internal/adapter/PropsAdapter.scala b/akka-actor-typed/src/main/scala/akka/actor/typed/internal/adapter/PropsAdapter.scala index eafc90bdff..7f32a122b3 100644 --- a/akka-actor-typed/src/main/scala/akka/actor/typed/internal/adapter/PropsAdapter.scala +++ b/akka-actor-typed/src/main/scala/akka/actor/typed/internal/adapter/PropsAdapter.scala @@ -32,7 +32,7 @@ import akka.dispatch.Mailboxes val p2 = deploy.firstOrElse[MailboxSelector](MailboxSelector.default()) match { case _: DefaultMailboxSelector => p1 case BoundedMailboxSelector(capacity, _) => - // specific support in untyped Mailboxes + // specific support in classic Mailboxes p1.withMailbox(s"${Mailboxes.BoundedCapacityPrefix}$capacity") case MailboxFromConfigSelector(path, _) => props.withMailbox(path) diff --git a/akka-actor-typed/src/main/scala/akka/actor/typed/internal/adapter/SchedulerAdapter.scala b/akka-actor-typed/src/main/scala/akka/actor/typed/internal/adapter/SchedulerAdapter.scala index 3ced2e33ab..a4e2b18a53 100644 --- a/akka-actor-typed/src/main/scala/akka/actor/typed/internal/adapter/SchedulerAdapter.scala +++ b/akka-actor-typed/src/main/scala/akka/actor/typed/internal/adapter/SchedulerAdapter.scala @@ -17,34 +17,34 @@ import scala.concurrent.duration.FiniteDuration * INTERNAL API */ @InternalApi -private[akka] final class SchedulerAdapter(private[akka] val untypedScheduler: akka.actor.Scheduler) extends Scheduler { +private[akka] final class SchedulerAdapter(private[akka] val classicScheduler: akka.actor.Scheduler) extends Scheduler { override def scheduleOnce(delay: FiniteDuration, runnable: Runnable)( implicit executor: ExecutionContext): Cancellable = - untypedScheduler.scheduleOnce(delay, runnable) + classicScheduler.scheduleOnce(delay, runnable) override def scheduleOnce(delay: Duration, runnable: Runnable, executor: ExecutionContext): Cancellable = - untypedScheduler.scheduleOnce(delay, runnable)(executor) + classicScheduler.scheduleOnce(delay, runnable)(executor) override def scheduleWithFixedDelay(initialDelay: FiniteDuration, delay: FiniteDuration)(runnable: Runnable)( implicit executor: ExecutionContext): Cancellable = - untypedScheduler.scheduleWithFixedDelay(initialDelay, delay)(runnable) + classicScheduler.scheduleWithFixedDelay(initialDelay, delay)(runnable) override def scheduleWithFixedDelay( initialDelay: Duration, delay: Duration, runnable: Runnable, executor: ExecutionContext): Cancellable = - untypedScheduler.scheduleWithFixedDelay(initialDelay, delay, runnable, executor) + classicScheduler.scheduleWithFixedDelay(initialDelay, delay, runnable, executor) override def scheduleAtFixedRate(initialDelay: FiniteDuration, interval: FiniteDuration)(runnable: Runnable)( implicit executor: ExecutionContext): Cancellable = - untypedScheduler.scheduleAtFixedRate(initialDelay, interval)(runnable) + classicScheduler.scheduleAtFixedRate(initialDelay, interval)(runnable) override def scheduleAtFixedRate( initialDelay: Duration, interval: Duration, runnable: Runnable, executor: ExecutionContext): Cancellable = - untypedScheduler.scheduleAtFixedRate(initialDelay, interval, runnable, executor) + classicScheduler.scheduleAtFixedRate(initialDelay, interval, runnable, executor) } diff --git a/akka-actor-typed/src/main/scala/akka/actor/typed/internal/receptionist/ReceptionistImpl.scala b/akka-actor-typed/src/main/scala/akka/actor/typed/internal/receptionist/ReceptionistImpl.scala index 23c31bec05..ba486321e4 100644 --- a/akka-actor-typed/src/main/scala/akka/actor/typed/internal/receptionist/ReceptionistImpl.scala +++ b/akka-actor-typed/src/main/scala/akka/actor/typed/internal/receptionist/ReceptionistImpl.scala @@ -18,7 +18,7 @@ import akka.annotation.InternalApi override val ref: ActorRef[Receptionist.Command] = { val provider: ReceptionistBehaviorProvider = - if (system.settings.untypedSettings.ProviderSelectionType.hasCluster) { + if (system.settings.classicSettings.ProviderSelectionType.hasCluster) { system.dynamicAccess .getObjectFor[ReceptionistBehaviorProvider]("akka.cluster.typed.internal.receptionist.ClusterReceptionist") .recover { diff --git a/akka-actor-typed/src/main/scala/akka/actor/typed/internal/routing/GroupRouterImpl.scala b/akka-actor-typed/src/main/scala/akka/actor/typed/internal/routing/GroupRouterImpl.scala index 459a54070e..b39e68e0fe 100644 --- a/akka-actor-typed/src/main/scala/akka/actor/typed/internal/routing/GroupRouterImpl.scala +++ b/akka-actor-typed/src/main/scala/akka/actor/typed/internal/routing/GroupRouterImpl.scala @@ -64,7 +64,7 @@ private final class InitialGroupRouterImpl[T]( ctx.system.eventStream ! EventStream.Publish(Dropped( msg, s"Stash is full in group router for [$serviceKey]", - ctx.self.toUntyped)) // don't fail on full stash + ctx.self.toClassic)) // don't fail on full stash this } } @@ -99,7 +99,7 @@ private[akka] final class GroupRouterImpl[T]( if (!routeesEmpty) routingLogic.selectRoutee() ! msg else ctx.system.eventStream ! EventStream.Publish( - Dropped(msg, s"No routees in group router for [$serviceKey]", ctx.self.toUntyped)) + Dropped(msg, s"No routees in group router for [$serviceKey]", ctx.self.toClassic)) this } } diff --git a/akka-actor-typed/src/main/scala/akka/actor/typed/javadsl/ActorContext.scala b/akka-actor-typed/src/main/scala/akka/actor/typed/javadsl/ActorContext.scala index 9bef3c7292..fe4be0a595 100644 --- a/akka-actor-typed/src/main/scala/akka/actor/typed/javadsl/ActorContext.scala +++ b/akka-actor-typed/src/main/scala/akka/actor/typed/javadsl/ActorContext.scala @@ -269,7 +269,7 @@ trait ActorContext[T] extends TypedActorContext[T] { * the other actor can send a message back through. * @param applyToResponse Transforms the response from the `target` into a message this actor understands. * Will be invoked with either the response message or an AskTimeoutException failed or - * potentially another exception if the remote actor is untyped and sent a + * potentially another exception if the remote actor is classic and sent a * [[akka.actor.Status.Failure]] as response. The returned message of type `T` is then * fed into this actor as a message. Should be a pure function but is executed inside * the actor when the response arrives so can safely touch the actor internals. If this diff --git a/akka-actor-typed/src/main/scala/akka/actor/typed/javadsl/Adapter.scala b/akka-actor-typed/src/main/scala/akka/actor/typed/javadsl/Adapter.scala index 59dd19972d..7dd594c1f7 100644 --- a/akka-actor-typed/src/main/scala/akka/actor/typed/javadsl/Adapter.scala +++ b/akka-actor-typed/src/main/scala/akka/actor/typed/javadsl/Adapter.scala @@ -14,80 +14,80 @@ import akka.actor.typed.internal.adapter.ActorContextAdapter import akka.japi.Creator /** - * Java API: Adapters between typed and untyped actors and actor systems. - * The underlying `ActorSystem` is the untyped [[akka.actor.ActorSystem]] - * which runs Akka Typed [[akka.actor.typed.Behavior]] on an emulation layer. In this - * system typed and untyped actors can coexist. + * Java API: Adapters between typed and classic actors and actor systems. + * The underlying `ActorSystem` is the classic [[akka.actor.ActorSystem]] + * which runs Akka [[akka.actor.typed.Behavior]] on an emulation layer. In this + * system typed and classic actors can coexist. * - * These methods make it possible to create typed child actor from untyped - * parent actor, and the opposite untyped child from typed parent. + * These methods make it possible to create a child actor from classic + * parent actor, and the opposite classic child from typed parent. * `watch` is also supported in both directions. * - * There are also converters (`toTyped`, `toUntyped`) between untyped - * [[akka.actor.ActorRef]] and typed [[akka.actor.typed.ActorRef]], and between untyped - * [[akka.actor.ActorSystem]] and typed [[akka.actor.typed.ActorSystem]]. + * There are also converters (`toTyped`, `toClassic`) between classic + * [[akka.actor.ActorRef]] and [[akka.actor.typed.ActorRef]], and between classic + * [[akka.actor.ActorSystem]] and [[akka.actor.typed.ActorSystem]]. */ object Adapter { /** - * Spawn the given behavior as a child of the user actor in an untyped ActorSystem. - * Typed actors default supervision strategy is to stop. Can be overridden with + * Spawn the given behavior as a child of the user actor in a classic ActorSystem. + * Actor default supervision strategy is to stop. Can be overridden with * `Behaviors.supervise`. */ def spawnAnonymous[T](sys: akka.actor.ActorSystem, behavior: Behavior[T]): ActorRef[T] = spawnAnonymous(sys, behavior, Props.empty) /** - * Spawn the given behavior as a child of the user actor in an untyped ActorSystem. - * Typed actors default supervision strategy is to stop. Can be overridden with + * Spawn the given behavior as a child of the user actor in a classic ActorSystem. + * Actor default supervision strategy is to stop. Can be overridden with * `Behaviors.supervise`. */ def spawnAnonymous[T](sys: akka.actor.ActorSystem, behavior: Behavior[T], props: Props): ActorRef[T] = sys.spawnAnonymous(behavior, props) /** - * Spawn the given behavior as a child of the user actor in an untyped ActorSystem. - * Typed actors default supervision strategy is to stop. Can be overridden with + * Spawn the given behavior as a child of the user actor in a classic ActorSystem. + * Actor default supervision strategy is to stop. Can be overridden with * `Behaviors.supervise`. */ def spawn[T](sys: akka.actor.ActorSystem, behavior: Behavior[T], name: String): ActorRef[T] = spawn(sys, behavior, name, Props.empty) /** - * Spawn the given behavior as a child of the user actor in an untyped ActorSystem. - * Typed actors default supervision strategy is to stop. Can be overridden with + * Spawn the given behavior as a child of the user actor in a classic ActorSystem. + * Actor default supervision strategy is to stop. Can be overridden with * `Behaviors.supervise`. */ def spawn[T](sys: akka.actor.ActorSystem, behavior: Behavior[T], name: String, props: Props): ActorRef[T] = sys.spawn(behavior, name, props) /** - * Spawn the given behavior as a child of the user actor in an untyped ActorContext. - * Typed actors default supervision strategy is to stop. Can be overridden with + * Spawn the given behavior as a child of the user actor in a classic ActorContext. + * Actor default supervision strategy is to stop. Can be overridden with * `Behaviors.supervise`. */ def spawnAnonymous[T](ctx: akka.actor.ActorContext, behavior: Behavior[T]): ActorRef[T] = spawnAnonymous(ctx, behavior, Props.empty) /** - * Spawn the given behavior as a child of the user actor in an untyped ActorContext. - * Typed actors default supervision strategy is to stop. Can be overridden with + * Spawn the given behavior as a child of the user actor in a classic ActorContext. + * Actor default supervision strategy is to stop. Can be overridden with * `Behaviors.supervise`. */ def spawnAnonymous[T](ctx: akka.actor.ActorContext, behavior: Behavior[T], props: Props): ActorRef[T] = ctx.spawnAnonymous(behavior, props) /** - * Spawn the given behavior as a child of the user actor in an untyped ActorContext. - * Typed actors default supervision strategy is to stop. Can be overridden with + * Spawn the given behavior as a child of the user actor in a classic ActorContext. + * Actor default supervision strategy is to stop. Can be overridden with * `Behaviors.supervise`. */ def spawn[T](ctx: akka.actor.ActorContext, behavior: Behavior[T], name: String): ActorRef[T] = spawn(ctx, behavior, name, Props.empty) /** - * Spawn the given behavior as a child of the user actor in an untyped ActorContext. - * Typed actors default supervision strategy is to stop. Can be overridden with + * Spawn the given behavior as a child of the user actor in a classic ActorContext. + * Actor default supervision strategy is to stop. Can be overridden with * `Behaviors.supervise`. */ def spawn[T](ctx: akka.actor.ActorContext, behavior: Behavior[T], name: String, props: Props): ActorRef[T] = @@ -96,11 +96,11 @@ object Adapter { def toTyped(sys: akka.actor.ActorSystem): ActorSystem[Void] = sys.toTyped.asInstanceOf[ActorSystem[Void]] - def toUntyped(sys: ActorSystem[_]): akka.actor.ActorSystem = - sys.toUntyped + def toClassic(sys: ActorSystem[_]): akka.actor.ActorSystem = + sys.toClassic - def toUntyped(ctx: ActorContext[_]): actor.ActorContext = - ActorContextAdapter.toUntyped(ctx) + def toClassic(ctx: ActorContext[_]): actor.ActorContext = + ActorContextAdapter.toClassic(ctx) def watch[U](ctx: akka.actor.ActorContext, other: ActorRef[U]): Unit = ctx.watch(other) @@ -121,36 +121,36 @@ object Adapter { ctx.stop(child) def actorOf(ctx: ActorContext[_], props: akka.actor.Props): akka.actor.ActorRef = - ActorContextAdapter.toUntyped(ctx).actorOf(props) + ActorContextAdapter.toClassic(ctx).actorOf(props) def actorOf(ctx: ActorContext[_], props: akka.actor.Props, name: String): akka.actor.ActorRef = - ActorContextAdapter.toUntyped(ctx).actorOf(props, name) + ActorContextAdapter.toClassic(ctx).actorOf(props, name) - def toUntyped(ref: ActorRef[_]): akka.actor.ActorRef = - ref.toUntyped + def toClassic(ref: ActorRef[_]): akka.actor.ActorRef = + ref.toClassic def toTyped[T](ref: akka.actor.ActorRef): ActorRef[T] = ref /** - * Wrap [[akka.actor.typed.Behavior]] in an untyped [[akka.actor.Props]], i.e. when - * spawning a typed child actor from an untyped parent actor. + * Wrap [[akka.actor.typed.Behavior]] in a classic [[akka.actor.Props]], i.e. when + * spawning a typed child actor from a classic parent actor. * This is normally not needed because you can use the extension methods - * `spawn` and `spawnAnonymous` with an untyped `ActorContext`, but it's needed + * `spawn` and `spawnAnonymous` with a classic `ActorContext`, but it's needed * when using typed actors with an existing library/tool that provides an API that - * takes an untyped [[akka.actor.Props]] parameter. Cluster Sharding is an + * takes a classic [[akka.actor.Props]] parameter. Cluster Sharding is an * example of that. */ def props[T](behavior: Creator[Behavior[T]], deploy: Props): akka.actor.Props = akka.actor.typed.internal.adapter.PropsAdapter(() => behavior.create(), deploy) /** - * Wrap [[akka.actor.typed.Behavior]] in an untyped [[akka.actor.Props]], i.e. when - * spawning a typed child actor from an untyped parent actor. + * Wrap [[akka.actor.typed.Behavior]] in a classic [[akka.actor.Props]], i.e. when + * spawning a typed child actor from a classic parent actor. * This is normally not needed because you can use the extension methods - * `spawn` and `spawnAnonymous` with an untyped `ActorContext`, but it's needed + * `spawn` and `spawnAnonymous` with a classic `ActorContext`, but it's needed * when using typed actors with an existing library/tool that provides an API that - * takes an untyped [[akka.actor.Props]] parameter. Cluster Sharding is an + * takes a classic [[akka.actor.Props]] parameter. Cluster Sharding is an * example of that. */ def props[T](behavior: Creator[Behavior[T]]): akka.actor.Props = diff --git a/akka-actor-typed/src/main/scala/akka/actor/typed/scaladsl/AskPattern.scala b/akka-actor-typed/src/main/scala/akka/actor/typed/scaladsl/AskPattern.scala index 1fa9fb4ef1..664ac1baec 100644 --- a/akka-actor-typed/src/main/scala/akka/actor/typed/scaladsl/AskPattern.scala +++ b/akka-actor-typed/src/main/scala/akka/actor/typed/scaladsl/AskPattern.scala @@ -101,7 +101,7 @@ object AskPattern { // We do not currently use the implicit sched, but want to require it // because it might be needed when we move to a 'native' typed runtime, see #24219 ref match { - case a: InternalRecipientRef[_] => askUntyped(a, timeout, replyTo) + case a: InternalRecipientRef[_] => askClassic(a, timeout, replyTo) case a => throw new IllegalStateException( "Only expect references to be RecipientRef, ActorRefAdapter or ActorSystemAdapter until " + @@ -139,7 +139,7 @@ object AskPattern { val promiseRef: PromiseActorRef = _promiseRef } - private def askUntyped[T, U](target: InternalRecipientRef[T], timeout: Timeout, f: ActorRef[U] => T): Future[U] = { + private def askClassic[T, U](target: InternalRecipientRef[T], timeout: Timeout, f: ActorRef[U] => T): Future[U] = { val p = new PromiseRef[U](target, timeout) val m = f(p.ref) if (p.promiseRef ne null) p.promiseRef.messageClassName = m.getClass.getName diff --git a/akka-actor-typed/src/main/scala/akka/actor/typed/scaladsl/adapter/PropsAdapter.scala b/akka-actor-typed/src/main/scala/akka/actor/typed/scaladsl/adapter/PropsAdapter.scala index dde13cf318..8998714678 100644 --- a/akka-actor-typed/src/main/scala/akka/actor/typed/scaladsl/adapter/PropsAdapter.scala +++ b/akka-actor-typed/src/main/scala/akka/actor/typed/scaladsl/adapter/PropsAdapter.scala @@ -8,12 +8,12 @@ import akka.actor.typed.Behavior import akka.actor.typed.Props /** - * Wrap [[akka.actor.typed.Behavior]] in an untyped [[akka.actor.Props]], i.e. when - * spawning a typed child actor from an untyped parent actor. + * Wrap [[akka.actor.typed.Behavior]] in a classic [[akka.actor.Props]], i.e. when + * spawning a typed child actor from a classic parent actor. * This is normally not needed because you can use the extension methods - * `spawn` and `spawnAnonymous` on an untyped `ActorContext`, but it's needed + * `spawn` and `spawnAnonymous` on a classic `ActorContext`, but it's needed * when using typed actors with an existing library/tool that provides an API that - * takes an untyped [[akka.actor.Props]] parameter. Cluster Sharding is an + * takes a classic [[akka.actor.Props]] parameter. Cluster Sharding is an * example of that. */ object PropsAdapter { diff --git a/akka-actor-typed/src/main/scala/akka/actor/typed/scaladsl/adapter/package.scala b/akka-actor-typed/src/main/scala/akka/actor/typed/scaladsl/adapter/package.scala index 3a726e668a..e8c1d576a1 100644 --- a/akka-actor-typed/src/main/scala/akka/actor/typed/scaladsl/adapter/package.scala +++ b/akka-actor-typed/src/main/scala/akka/actor/typed/scaladsl/adapter/package.scala @@ -19,13 +19,13 @@ import akka.annotation.InternalApi * * Implicit extension methods are added to classic and typed `ActorSystem`, * `ActorContext`. Such methods make it possible to create typed child actor - * from classic parent actor, and the opposite untyped child from typed parent. + * from classic parent actor, and the opposite classic child from typed parent. * `watch` is also supported in both directions. * * There is an implicit conversion from classic [[akka.actor.ActorRef]] to * typed [[akka.actor.typed.ActorRef]]. * - * There are also converters (`toTyped`, `toUntyped`) from typed + * There are also converters (`toTyped`, `toClassic`) from typed * [[akka.actor.typed.ActorRef]] to classic [[akka.actor.ActorRef]], and between classic * [[akka.actor.ActorSystem]] and typed [[akka.actor.typed.ActorSystem]]. */ @@ -36,10 +36,10 @@ package object adapter { /** * Extension methods added to [[akka.actor.ActorSystem]]. */ - implicit class UntypedActorSystemOps(val sys: akka.actor.ActorSystem) extends AnyVal { + implicit class ClassicActorSystemOps(val sys: akka.actor.ActorSystem) extends AnyVal { /** - * Spawn the given behavior as a child of the user actor in an untyped ActorSystem. + * Spawn the given behavior as a child of the user actor in a classic ActorSystem. * * Typed actors default supervision strategy is to stop. Can be overridden with * `Behaviors.supervise`. @@ -53,7 +53,7 @@ package object adapter { } /** - * Spawn the given behavior as a child of the user actor in an untyped ActorSystem. + * Spawn the given behavior as a child of the user actor in a classic ActorSystem. * * Typed actors default supervision strategy is to stop. Can be overridden with * `Behaviors.supervise`. @@ -74,7 +74,7 @@ package object adapter { * Extension methods added to [[akka.actor.typed.ActorSystem]]. */ implicit class TypedActorSystemOps(val sys: ActorSystem[_]) extends AnyVal { - def toUntyped: akka.actor.ActorSystem = ActorSystemAdapter.toUntyped(sys) + def toClassic: akka.actor.ActorSystem = ActorSystemAdapter.toClassic(sys) /** * INTERNAL API @@ -83,17 +83,17 @@ package object adapter { behavior: Behavior[U], name: String, props: Props): ActorRef[U] = { - toUntyped.asInstanceOf[ExtendedActorSystem].systemActorOf(PropsAdapter(behavior, props), name) + toClassic.asInstanceOf[ExtendedActorSystem].systemActorOf(PropsAdapter(behavior, props), name) } } /** * Extension methods added to [[akka.actor.ActorContext]]. */ - implicit class UntypedActorContextOps(val ctx: akka.actor.ActorContext) extends AnyVal { + implicit class ClassicActorContextOps(val ctx: akka.actor.ActorContext) extends AnyVal { /** - * Spawn the given behavior as a child of the user actor in an untyped ActorContext. + * Spawn the given behavior as a child of the user actor in a classic ActorContext. * * Typed actors default supervision strategy is to stop. Can be overridden with * `Behaviors.supervise`. @@ -106,7 +106,7 @@ package object adapter { rethrowTypedFailure = false) /** - * Spawn the given behavior as a child of the user actor in an untyped ActorContext. + * Spawn the given behavior as a child of the user actor in a classic ActorContext. * * Typed actors default supervision strategy is to stop. Can be overridden with * `Behaviors.supervise`. @@ -119,11 +119,11 @@ package object adapter { props, rethrowTypedFailure = false) - def watch[U](other: ActorRef[U]): Unit = ctx.watch(ActorRefAdapter.toUntyped(other)) - def unwatch[U](other: ActorRef[U]): Unit = ctx.unwatch(ActorRefAdapter.toUntyped(other)) + def watch[U](other: ActorRef[U]): Unit = ctx.watch(ActorRefAdapter.toClassic(other)) + def unwatch[U](other: ActorRef[U]): Unit = ctx.unwatch(ActorRefAdapter.toClassic(other)) def stop(child: ActorRef[_]): Unit = - ctx.stop(ActorRefAdapter.toUntyped(child)) + ctx.stop(ActorRefAdapter.toClassic(child)) } /** @@ -131,12 +131,12 @@ package object adapter { */ implicit class TypedActorContextOps(val ctx: scaladsl.ActorContext[_]) extends AnyVal { def actorOf(props: akka.actor.Props): akka.actor.ActorRef = - ActorContextAdapter.toUntyped(ctx).actorOf(props) + ActorContextAdapter.toClassic(ctx).actorOf(props) def actorOf(props: akka.actor.Props, name: String): akka.actor.ActorRef = - ActorContextAdapter.toUntyped(ctx).actorOf(props, name) + ActorContextAdapter.toClassic(ctx).actorOf(props, name) - def toUntyped: akka.actor.ActorContext = ActorContextAdapter.toUntyped(ctx) + def toClassic: akka.actor.ActorContext = ActorContextAdapter.toClassic(ctx) // watch, unwatch and stop not needed here because of the implicit ActorRef conversion } @@ -145,16 +145,16 @@ package object adapter { * Extension methods added to [[akka.actor.typed.ActorRef]]. */ implicit class TypedActorRefOps(val ref: ActorRef[_]) extends AnyVal { - def toUntyped: akka.actor.ActorRef = ActorRefAdapter.toUntyped(ref) + def toClassic: akka.actor.ActorRef = ActorRefAdapter.toClassic(ref) } /** * Extension methods added to [[akka.actor.ActorRef]]. */ - implicit class UntypedActorRefOps(val ref: akka.actor.ActorRef) extends AnyVal { + implicit class ClassicActorRefOps(val ref: akka.actor.ActorRef) extends AnyVal { /** - * Adapt the untyped `ActorRef` to typed `ActorRef[T]`. There is also an + * Adapt the classic `ActorRef` to `akka.actor.typed.ActorRef[T]`. There is also an * automatic implicit conversion for this, but this more explicit variant might * sometimes be preferred. */ @@ -162,7 +162,7 @@ package object adapter { } /** - * Implicit conversion from untyped [[akka.actor.ActorRef]] to typed [[akka.actor.typed.ActorRef]]. + * Implicit conversion from classic [[akka.actor.ActorRef]] to [[akka.actor.typed.ActorRef]]. */ implicit def actorRefAdapter[T](ref: akka.actor.ActorRef): ActorRef[T] = ActorRefAdapter(ref) diff --git a/akka-cluster-sharding-typed/src/main/scala/akka/cluster/sharding/typed/ClusterShardingSettings.scala b/akka-cluster-sharding-typed/src/main/scala/akka/cluster/sharding/typed/ClusterShardingSettings.scala index bc2cfcbb2e..71891b78f4 100644 --- a/akka-cluster-sharding-typed/src/main/scala/akka/cluster/sharding/typed/ClusterShardingSettings.scala +++ b/akka-cluster-sharding-typed/src/main/scala/akka/cluster/sharding/typed/ClusterShardingSettings.scala @@ -9,8 +9,8 @@ import akka.actor.NoSerializationVerificationNeeded import akka.actor.typed.ActorSystem import akka.annotation.InternalApi import akka.cluster.ClusterSettings.DataCenter -import akka.cluster.sharding.{ ClusterShardingSettings => UntypedShardingSettings } -import akka.cluster.singleton.{ ClusterSingletonManagerSettings => UntypedClusterSingletonManagerSettings } +import akka.cluster.sharding.{ ClusterShardingSettings => ClassicShardingSettings } +import akka.cluster.singleton.{ ClusterSingletonManagerSettings => ClassicClusterSingletonManagerSettings } import akka.cluster.typed.Cluster import akka.cluster.typed.ClusterSingletonManagerSettings import com.typesafe.config.Config @@ -23,40 +23,40 @@ object ClusterShardingSettings { fromConfig(system.settings.config.getConfig("akka.cluster.sharding")) def fromConfig(config: Config): ClusterShardingSettings = { - val untypedSettings = UntypedShardingSettings(config) + val classicSettings = ClassicShardingSettings(config) val numberOfShards = config.getInt("number-of-shards") - fromUntypedSettings(numberOfShards, untypedSettings) + fromClassicSettings(numberOfShards, classicSettings) } /** Java API: Creates new cluster sharding settings object */ def create(system: ActorSystem[_]): ClusterShardingSettings = apply(system) - /** INTERNAL API: Indended only for internal use, it is not recommended to keep converting between the setting types */ - private[akka] def fromUntypedSettings( + /** INTERNAL API: Intended only for internal use, it is not recommended to keep converting between the setting types */ + private[akka] def fromClassicSettings( numberOfShards: Int, - untypedSettings: UntypedShardingSettings): ClusterShardingSettings = { + classicSettings: ClassicShardingSettings): ClusterShardingSettings = { new ClusterShardingSettings( numberOfShards, - role = untypedSettings.role, + role = classicSettings.role, dataCenter = None, - rememberEntities = untypedSettings.rememberEntities, - journalPluginId = untypedSettings.journalPluginId, - snapshotPluginId = untypedSettings.snapshotPluginId, - passivateIdleEntityAfter = untypedSettings.passivateIdleEntityAfter, - shardRegionQueryTimeout = untypedSettings.shardRegionQueryTimeout, - stateStoreMode = StateStoreMode.byName(untypedSettings.stateStoreMode), - new TuningParameters(untypedSettings.tuningParameters), + rememberEntities = classicSettings.rememberEntities, + journalPluginId = classicSettings.journalPluginId, + snapshotPluginId = classicSettings.snapshotPluginId, + passivateIdleEntityAfter = classicSettings.passivateIdleEntityAfter, + shardRegionQueryTimeout = classicSettings.shardRegionQueryTimeout, + stateStoreMode = StateStoreMode.byName(classicSettings.stateStoreMode), + new TuningParameters(classicSettings.tuningParameters), new ClusterSingletonManagerSettings( - untypedSettings.coordinatorSingletonSettings.singletonName, - untypedSettings.coordinatorSingletonSettings.role, - untypedSettings.coordinatorSingletonSettings.removalMargin, - untypedSettings.coordinatorSingletonSettings.handOverRetryInterval)) + classicSettings.coordinatorSingletonSettings.singletonName, + classicSettings.coordinatorSingletonSettings.role, + classicSettings.coordinatorSingletonSettings.removalMargin, + classicSettings.coordinatorSingletonSettings.handOverRetryInterval)) } - /** INTERNAL API: Indended only for internal use, it is not recommended to keep converting between the setting types */ - private[akka] def toUntypedSettings(settings: ClusterShardingSettings): UntypedShardingSettings = { - new UntypedShardingSettings( + /** INTERNAL API: Intended only for internal use, it is not recommended to keep converting between the setting types */ + private[akka] def toClassicSettings(settings: ClusterShardingSettings): ClassicShardingSettings = { + new ClassicShardingSettings( role = settings.role, rememberEntities = settings.rememberEntities, journalPluginId = settings.journalPluginId, @@ -64,7 +64,7 @@ object ClusterShardingSettings { stateStoreMode = settings.stateStoreMode.name, passivateIdleEntityAfter = settings.passivateIdleEntityAfter, shardRegionQueryTimeout = settings.shardRegionQueryTimeout, - new UntypedShardingSettings.TuningParameters( + new ClassicShardingSettings.TuningParameters( bufferSize = settings.tuningParameters.bufferSize, coordinatorFailureBackoff = settings.tuningParameters.coordinatorFailureBackoff, retryInterval = settings.tuningParameters.retryInterval, @@ -85,7 +85,7 @@ object ClusterShardingSettings { settings.tuningParameters.entityRecoveryConstantRateStrategyFrequency, entityRecoveryConstantRateStrategyNumberOfEntities = settings.tuningParameters.entityRecoveryConstantRateStrategyNumberOfEntities), - new UntypedClusterSingletonManagerSettings( + new ClassicClusterSingletonManagerSettings( settings.coordinatorSingletonSettings.singletonName, settings.coordinatorSingletonSettings.role, settings.coordinatorSingletonSettings.removalMargin, @@ -128,25 +128,25 @@ object ClusterShardingSettings { val updatingStateTimeout: FiniteDuration, val waitingForStateTimeout: FiniteDuration) { - def this(untyped: UntypedShardingSettings.TuningParameters) { + def this(classic: ClassicShardingSettings.TuningParameters) { this( - bufferSize = untyped.bufferSize, - coordinatorFailureBackoff = untyped.coordinatorFailureBackoff, - retryInterval = untyped.retryInterval, - handOffTimeout = untyped.handOffTimeout, - shardStartTimeout = untyped.shardStartTimeout, - shardFailureBackoff = untyped.shardFailureBackoff, - entityRestartBackoff = untyped.entityRestartBackoff, - rebalanceInterval = untyped.rebalanceInterval, - snapshotAfter = untyped.snapshotAfter, - keepNrOfBatches = untyped.keepNrOfBatches, - leastShardAllocationRebalanceThreshold = untyped.leastShardAllocationRebalanceThreshold, // TODO extract it a bit - leastShardAllocationMaxSimultaneousRebalance = untyped.leastShardAllocationMaxSimultaneousRebalance, - waitingForStateTimeout = untyped.waitingForStateTimeout, - updatingStateTimeout = untyped.updatingStateTimeout, - entityRecoveryStrategy = untyped.entityRecoveryStrategy, - entityRecoveryConstantRateStrategyFrequency = untyped.entityRecoveryConstantRateStrategyFrequency, - entityRecoveryConstantRateStrategyNumberOfEntities = untyped.entityRecoveryConstantRateStrategyNumberOfEntities) + bufferSize = classic.bufferSize, + coordinatorFailureBackoff = classic.coordinatorFailureBackoff, + retryInterval = classic.retryInterval, + handOffTimeout = classic.handOffTimeout, + shardStartTimeout = classic.shardStartTimeout, + shardFailureBackoff = classic.shardFailureBackoff, + entityRestartBackoff = classic.entityRestartBackoff, + rebalanceInterval = classic.rebalanceInterval, + snapshotAfter = classic.snapshotAfter, + keepNrOfBatches = classic.keepNrOfBatches, + leastShardAllocationRebalanceThreshold = classic.leastShardAllocationRebalanceThreshold, // TODO extract it a bit + leastShardAllocationMaxSimultaneousRebalance = classic.leastShardAllocationMaxSimultaneousRebalance, + waitingForStateTimeout = classic.waitingForStateTimeout, + updatingStateTimeout = classic.updatingStateTimeout, + entityRecoveryStrategy = classic.entityRecoveryStrategy, + entityRecoveryConstantRateStrategyFrequency = classic.entityRecoveryConstantRateStrategyFrequency, + entityRecoveryConstantRateStrategyNumberOfEntities = classic.entityRecoveryConstantRateStrategyNumberOfEntities) } diff --git a/akka-cluster-sharding-typed/src/main/scala/akka/cluster/sharding/typed/internal/ClusterShardingImpl.scala b/akka-cluster-sharding-typed/src/main/scala/akka/cluster/sharding/typed/internal/ClusterShardingImpl.scala index fb41962e42..a38a666a9a 100644 --- a/akka-cluster-sharding-typed/src/main/scala/akka/cluster/sharding/typed/internal/ClusterShardingImpl.scala +++ b/akka-cluster-sharding-typed/src/main/scala/akka/cluster/sharding/typed/internal/ClusterShardingImpl.scala @@ -31,7 +31,7 @@ import akka.annotation.InternalApi import akka.cluster.sharding.ShardCoordinator.LeastShardAllocationStrategy import akka.cluster.sharding.ShardCoordinator.ShardAllocationStrategy import akka.cluster.sharding.ShardRegion -import akka.cluster.sharding.ShardRegion.{ StartEntity => UntypedStartEntity } +import akka.cluster.sharding.ShardRegion.{ StartEntity => ClassicStartEntity } import akka.cluster.sharding.typed.scaladsl.EntityContext import akka.cluster.typed.Cluster import akka.event.Logging @@ -52,8 +52,8 @@ import akka.util.Timeout extends ShardingMessageExtractor[Any, M] { override def entityId(message: Any): String = { message match { - case ShardingEnvelope(entityId, _) => entityId //also covers UntypedStartEntity in ShardingEnvelope - case UntypedStartEntity(entityId) => entityId + case ShardingEnvelope(entityId, _) => entityId //also covers ClassicStartEntity in ShardingEnvelope + case ClassicStartEntity(entityId) => entityId case msg: E @unchecked => delegate.entityId(msg) } } @@ -63,9 +63,9 @@ import akka.util.Timeout override def unwrapMessage(message: Any): M = { message match { case ShardingEnvelope(_, msg: M @unchecked) => - //also covers UntypedStartEntity in ShardingEnvelope + //also covers ClassicStartEntity in ShardingEnvelope msg - case msg: UntypedStartEntity => + case msg: ClassicStartEntity => // not really of type M, but erased and StartEntity is only handled internally, not delivered to the entity msg.asInstanceOf[M] case msg: E @unchecked => @@ -132,9 +132,9 @@ import akka.util.Timeout "only adapted classic actor systems can be used for cluster features") private val cluster = Cluster(system) - private val untypedSystem: ExtendedActorSystem = system.toUntyped.asInstanceOf[ExtendedActorSystem] - private val untypedSharding = akka.cluster.sharding.ClusterSharding(untypedSystem) - private val log: LoggingAdapter = Logging(untypedSystem, classOf[scaladsl.ClusterSharding]) + private val classicSystem: ExtendedActorSystem = system.toClassic.asInstanceOf[ExtendedActorSystem] + private val classicSharding = akka.cluster.sharding.ClusterSharding(classicSystem) + private val log: LoggingAdapter = Logging(classicSystem, classOf[scaladsl.ClusterSharding]) // typeKey.name to messageClassName private val regions: ConcurrentHashMap[String, String] = new ConcurrentHashMap @@ -212,8 +212,8 @@ import akka.util.Timeout typeKey.name, new java.util.function.Function[String, ActorRef[scaladsl.ClusterSharding.ShardCommand]] { override def apply(t: String): ActorRef[scaladsl.ClusterSharding.ShardCommand] = { - // using untyped.systemActorOf to avoid the Future[ActorRef] - system.toUntyped + // using classic.systemActorOf to avoid the Future[ActorRef] + system.toClassic .asInstanceOf[ExtendedActorSystem] .systemActorOf( PropsAdapter(ShardCommandActor.behavior(stopMessage.getOrElse(PoisonPill))), @@ -228,14 +228,14 @@ import akka.util.Timeout } } - val untypedEntityPropsFactory: String => akka.actor.Props = { entityId => + val classicEntityPropsFactory: String => akka.actor.Props = { entityId => val behv = behavior(new EntityContext(entityId, shardCommandDelegator)) PropsAdapter(poisonPillInterceptor(behv), entityProps) } - untypedSharding.internalStart( + classicSharding.internalStart( typeKey.name, - untypedEntityPropsFactory, - ClusterShardingSettings.toUntypedSettings(settings), + classicEntityPropsFactory, + ClusterShardingSettings.toClassicSettings(settings), extractEntityId, extractShardId, allocationStrategy.getOrElse(defaultShardAllocationStrategy(settings)), @@ -248,7 +248,7 @@ import akka.util.Timeout settings.role, settings.dataCenter) - untypedSharding.startProxy( + classicSharding.startProxy( typeKey.name, settings.role, dataCenter = settings.dataCenter, @@ -271,14 +271,14 @@ import akka.util.Timeout override def entityRefFor[M](typeKey: scaladsl.EntityTypeKey[M], entityId: String): scaladsl.EntityRef[M] = { new EntityRefImpl[M]( - untypedSharding.shardRegion(typeKey.name), + classicSharding.shardRegion(typeKey.name), entityId, typeKey.asInstanceOf[EntityTypeKeyImpl[M]]) } override def entityRefFor[M](typeKey: javadsl.EntityTypeKey[M], entityId: String): javadsl.EntityRef[M] = { new EntityRefImpl[M]( - untypedSharding.shardRegion(typeKey.name), + classicSharding.shardRegion(typeKey.name), entityId, typeKey.asInstanceOf[EntityTypeKeyImpl[M]]) } @@ -291,8 +291,8 @@ import akka.util.Timeout override lazy val shardState: ActorRef[ClusterShardingQuery] = { import akka.actor.typed.scaladsl.adapter._ - val behavior = ShardingState.behavior(untypedSharding) - untypedSystem.systemActorOf(PropsAdapter(behavior), "typedShardState") + val behavior = ShardingState.behavior(classicSharding) + classicSystem.systemActorOf(PropsAdapter(behavior), "typedShardState") } } @@ -324,20 +324,20 @@ import akka.util.Timeout /** Similar to [[akka.actor.typed.scaladsl.AskPattern.PromiseRef]] but for an `EntityRef` target. */ @InternalApi - private final class EntityPromiseRef[U](untyped: InternalActorRef, timeout: Timeout) { + private final class EntityPromiseRef[U](classic: InternalActorRef, timeout: Timeout) { import akka.actor.typed.internal.{ adapter => adapt } // Note: _promiseRef mustn't have a type pattern, since it can be null private[this] val (_ref: ActorRef[U], _future: Future[U], _promiseRef) = - if (untyped.isTerminated) + if (classic.isTerminated) ( - adapt.ActorRefAdapter[U](untyped.provider.deadLetters), + adapt.ActorRefAdapter[U](classic.provider.deadLetters), Future.failed[U]( new AskTimeoutException(s"Recipient shard region of [${EntityRefImpl.this}] had already been terminated.")), null) else if (timeout.duration.length <= 0) ( - adapt.ActorRefAdapter[U](untyped.provider.deadLetters), + adapt.ActorRefAdapter[U](classic.provider.deadLetters), Future.failed[U]( new IllegalArgumentException( s"Timeout length must be positive, question not sent to [${EntityRefImpl.this}]")), @@ -345,7 +345,7 @@ import akka.util.Timeout else { // note that the real messageClassName will be set afterwards, replyTo pattern val a = - PromiseActorRef(untyped.provider, timeout, targetName = EntityRefImpl.this, messageClassName = "unknown") + PromiseActorRef(classic.provider, timeout, targetName = EntityRefImpl.this, messageClassName = "unknown") val b = adapt.ActorRefAdapter[U](a) (b, a.result.future.asInstanceOf[Future[U]], a) } @@ -376,21 +376,21 @@ import akka.util.Timeout */ @InternalApi private[akka] object ShardCommandActor { import akka.actor.typed.scaladsl.adapter._ - import akka.cluster.sharding.ShardRegion.{ Passivate => UntypedPassivate } + import akka.cluster.sharding.ShardRegion.{ Passivate => ClassicPassivate } def behavior(stopMessage: Any): Behavior[scaladsl.ClusterSharding.ShardCommand] = { - def sendUntypedPassivate(entity: ActorRef[_], ctx: TypedActorContext[_]): Unit = { - val pathToShard = entity.toUntyped.path.elements.take(4).mkString("/") - ctx.asScala.system.toUntyped.actorSelection(pathToShard).tell(UntypedPassivate(stopMessage), entity.toUntyped) + def sendClassicPassivate(entity: ActorRef[_], ctx: TypedActorContext[_]): Unit = { + val pathToShard = entity.toClassic.path.elements.take(4).mkString("/") + ctx.asScala.system.toClassic.actorSelection(pathToShard).tell(ClassicPassivate(stopMessage), entity.toClassic) } Behaviors.receive { (ctx, msg) => msg match { case scaladsl.ClusterSharding.Passivate(entity) => - sendUntypedPassivate(entity, ctx) + sendClassicPassivate(entity, ctx) Behaviors.same case javadsl.ClusterSharding.Passivate(entity) => - sendUntypedPassivate(entity, ctx) + sendClassicPassivate(entity, ctx) Behaviors.same case _ => Behaviors.unhandled diff --git a/akka-cluster-sharding-typed/src/main/scala/akka/cluster/sharding/typed/internal/ShardingState.scala b/akka-cluster-sharding-typed/src/main/scala/akka/cluster/sharding/typed/internal/ShardingState.scala index 2de118316e..a6109ae4da 100644 --- a/akka-cluster-sharding-typed/src/main/scala/akka/cluster/sharding/typed/internal/ShardingState.scala +++ b/akka-cluster-sharding-typed/src/main/scala/akka/cluster/sharding/typed/internal/ShardingState.scala @@ -17,10 +17,10 @@ import akka.cluster.sharding.typed.{ ClusterShardingQuery, GetShardRegionState } @InternalApi object ShardingState { - def behavior(untypedSharding: ClusterSharding): Behavior[ClusterShardingQuery] = Behaviors.receiveMessage { + def behavior(classicSharding: ClusterSharding): Behavior[ClusterShardingQuery] = Behaviors.receiveMessage { case GetShardRegionState(key, replyTo) => - if (untypedSharding.getShardTypeNames.contains(key.name)) { - untypedSharding.shardRegion(key.name).tell(ShardRegion.GetShardRegionState, replyTo.toUntyped) + if (classicSharding.getShardTypeNames.contains(key.name)) { + classicSharding.shardRegion(key.name).tell(ShardRegion.GetShardRegionState, replyTo.toClassic) } else { replyTo ! CurrentShardRegionState(Set.empty) } diff --git a/akka-cluster-sharding-typed/src/main/scala/akka/cluster/sharding/typed/scaladsl/ClusterSharding.scala b/akka-cluster-sharding-typed/src/main/scala/akka/cluster/sharding/typed/scaladsl/ClusterSharding.scala index 58470d9f45..2ee9822aa9 100644 --- a/akka-cluster-sharding-typed/src/main/scala/akka/cluster/sharding/typed/scaladsl/ClusterSharding.scala +++ b/akka-cluster-sharding-typed/src/main/scala/akka/cluster/sharding/typed/scaladsl/ClusterSharding.scala @@ -23,7 +23,7 @@ import akka.annotation.InternalApi import akka.cluster.sharding.ShardCoordinator.ShardAllocationStrategy import akka.cluster.sharding.typed.internal.ClusterShardingImpl import akka.cluster.sharding.typed.internal.EntityTypeKeyImpl -import akka.cluster.sharding.ShardRegion.{ StartEntity => UntypedStartEntity } +import akka.cluster.sharding.ShardRegion.{ StartEntity => ClassicStartEntity } import akka.persistence.typed.PersistenceId object ClusterSharding extends ExtensionId[ClusterSharding] { @@ -303,7 +303,7 @@ object StartEntity { */ def apply[M](entityId: String): ShardingEnvelope[M] = { // StartEntity isn't really of type M, but erased and StartEntity is only handled internally, not delivered to the entity - new ShardingEnvelope[M](entityId, UntypedStartEntity(entityId).asInstanceOf[M]) + new ShardingEnvelope[M](entityId, ClassicStartEntity(entityId).asInstanceOf[M]) } } diff --git a/akka-cluster-sharding-typed/src/test/scala/akka/cluster/sharding/typed/ShardingSerializerSpec.scala b/akka-cluster-sharding-typed/src/test/scala/akka/cluster/sharding/typed/ShardingSerializerSpec.scala index 0762232141..7c530a0506 100644 --- a/akka-cluster-sharding-typed/src/test/scala/akka/cluster/sharding/typed/ShardingSerializerSpec.scala +++ b/akka-cluster-sharding-typed/src/test/scala/akka/cluster/sharding/typed/ShardingSerializerSpec.scala @@ -14,7 +14,7 @@ class ShardingSerializerSpec extends ScalaTestWithActorTestKit with WordSpecLike "The typed ShardingSerializer" must { - val serialization = SerializationExtension(ActorSystemAdapter.toUntyped(system)) + val serialization = SerializationExtension(ActorSystemAdapter.toClassic(system)) def checkSerialization(obj: AnyRef): Unit = { serialization.findSerializerFor(obj) match { diff --git a/akka-cluster-sharding-typed/src/test/scala/akka/cluster/sharding/typed/scaladsl/ClusterShardingPersistenceSpec.scala b/akka-cluster-sharding-typed/src/test/scala/akka/cluster/sharding/typed/scaladsl/ClusterShardingPersistenceSpec.scala index 7b01a12943..a42eb8a10a 100644 --- a/akka-cluster-sharding-typed/src/test/scala/akka/cluster/sharding/typed/scaladsl/ClusterShardingPersistenceSpec.scala +++ b/akka-cluster-sharding-typed/src/test/scala/akka/cluster/sharding/typed/scaladsl/ClusterShardingPersistenceSpec.scala @@ -24,7 +24,7 @@ import akka.cluster.sharding.ShardRegion.CurrentShardRegionState import akka.cluster.sharding.ShardRegion.GetShardRegionState import akka.cluster.sharding.typed.scaladsl.ClusterSharding.Passivate import akka.cluster.sharding.typed.scaladsl.ClusterSharding.ShardCommand -import akka.cluster.sharding.{ ClusterSharding => UntypedClusterSharding } +import akka.cluster.sharding.{ ClusterSharding => ClassicClusterSharding } import akka.cluster.typed.Cluster import akka.cluster.typed.Join import akka.persistence.typed.ExpectingReply @@ -164,9 +164,9 @@ class ClusterShardingPersistenceSpec // FIXME #24466: rewrite this with Typed API when region queries are supported import akka.actor.typed.scaladsl.adapter._ val regionStateProbe = TestProbe[CurrentShardRegionState]() - val untypedRegion = UntypedClusterSharding(system.toUntyped) + val classicRegion = ClassicClusterSharding(system.toClassic) regionStateProbe.awaitAssert { - untypedRegion.shardRegion(typeKey.name).tell(GetShardRegionState, regionStateProbe.ref.toUntyped) + classicRegion.shardRegion(typeKey.name).tell(GetShardRegionState, regionStateProbe.ref.toClassic) regionStateProbe.receiveMessage().shards.foreach { shardState => shardState.entityIds should not contain entityId } diff --git a/akka-cluster-sharding-typed/src/test/scala/akka/cluster/sharding/typed/scaladsl/ClusterShardingSpec.scala b/akka-cluster-sharding-typed/src/test/scala/akka/cluster/sharding/typed/scaladsl/ClusterShardingSpec.scala index 6e8c3342ed..ecef47b48f 100644 --- a/akka-cluster-sharding-typed/src/test/scala/akka/cluster/sharding/typed/scaladsl/ClusterShardingSpec.scala +++ b/akka-cluster-sharding-typed/src/test/scala/akka/cluster/sharding/typed/scaladsl/ClusterShardingSpec.scala @@ -217,7 +217,7 @@ class ClusterShardingSpec extends ScalaTestWithActorTestKit(ClusterShardingSpec. import akka.pattern.ask implicit val timeout: Timeout = Timeout(6.seconds) val statsBefore = - (shardingRefSystem1WithEnvelope.toUntyped ? akka.cluster.sharding.ShardRegion.GetClusterShardingStats(5.seconds)) + (shardingRefSystem1WithEnvelope.toClassic ? akka.cluster.sharding.ShardRegion.GetClusterShardingStats(5.seconds)) .mapTo[akka.cluster.sharding.ShardRegion.ClusterShardingStats] val totalCount = statsBefore.futureValue.regions.values.flatMap(_.stats.values).sum totalCount @@ -402,8 +402,8 @@ class ClusterShardingSpec extends ScalaTestWithActorTestKit(ClusterShardingSpec. val totalCountBefore = totalEntityCount1() val p = TestProbe[Any]() - shardingRefSystem1WithEnvelope.toUntyped - .tell(akka.cluster.sharding.ShardRegion.StartEntity("startEntity-1"), p.ref.toUntyped) + shardingRefSystem1WithEnvelope.toClassic + .tell(akka.cluster.sharding.ShardRegion.StartEntity("startEntity-1"), p.ref.toClassic) p.expectMessageType[akka.cluster.sharding.ShardRegion.StartEntityAck] eventually { diff --git a/akka-cluster-typed/src/main/scala/akka/cluster/ddata/typed/internal/ReplicatorBehavior.scala b/akka-cluster-typed/src/main/scala/akka/cluster/ddata/typed/internal/ReplicatorBehavior.scala index ca692b6fef..9c39f09a45 100644 --- a/akka-cluster-typed/src/main/scala/akka/cluster/ddata/typed/internal/ReplicatorBehavior.scala +++ b/akka-cluster-typed/src/main/scala/akka/cluster/ddata/typed/internal/ReplicatorBehavior.scala @@ -38,12 +38,12 @@ import akka.actor.typed.Terminated underlyingReplicator: Option[akka.actor.ActorRef]): Behavior[SReplicator.Command] = { Behaviors.setup { ctx => - val untypedReplicator = underlyingReplicator match { + val classicReplicator = underlyingReplicator match { case Some(ref) => ref case None => // FIXME perhaps add supervisor for restarting, see PR https://github.com/akka/akka/pull/25988 - val untypedReplicatorProps = dd.Replicator.props(settings) - ctx.actorOf(untypedReplicatorProps, name = "underlying") + val classicReplicatorProps = dd.Replicator.props(settings) + ctx.actorOf(classicReplicatorProps, name = "underlying") } def withState( @@ -55,7 +55,7 @@ import akka.actor.typed.Terminated subscriber: ActorRef[JReplicator.Changed[ReplicatedData]]): Behavior[SReplicator.Command] = { subscribeAdapters.get(subscriber) match { case Some(adapter) => - // will be unsubscribed from untypedReplicator via Terminated + // will be unsubscribed from classicReplicator via Terminated ctx.stop(adapter) withState(subscribeAdapters - subscriber) case None => // already unsubscribed or terminated @@ -67,7 +67,7 @@ import akka.actor.typed.Terminated .receive[SReplicator.Command] { (ctx, msg) => msg match { case cmd: SReplicator.Get[_] => - untypedReplicator.tell(dd.Replicator.Get(cmd.key, cmd.consistency), sender = cmd.replyTo.toUntyped) + classicReplicator.tell(dd.Replicator.Get(cmd.key, cmd.consistency), sender = cmd.replyTo.toClassic) Behaviors.same case cmd: JReplicator.Get[d] => @@ -77,7 +77,7 @@ import akka.actor.typed.Terminated }) import ctx.executionContext val reply = - (untypedReplicator ? dd.Replicator.Get(cmd.key, cmd.consistency.toUntyped)) + (classicReplicator ? dd.Replicator.Get(cmd.key, cmd.consistency.toClassic)) .mapTo[dd.Replicator.GetResponse[d]] .map { case rsp: dd.Replicator.GetSuccess[d] => @@ -92,9 +92,9 @@ import akka.actor.typed.Terminated Behaviors.same case cmd: SReplicator.Update[_] => - untypedReplicator.tell( + classicReplicator.tell( dd.Replicator.Update(cmd.key, cmd.writeConsistency, None)(cmd.modify), - sender = cmd.replyTo.toUntyped) + sender = cmd.replyTo.toClassic) Behaviors.same case cmd: JReplicator.Update[d] => @@ -104,7 +104,7 @@ import akka.actor.typed.Terminated }) import ctx.executionContext val reply = - (untypedReplicator ? dd.Replicator.Update(cmd.key, cmd.writeConsistency.toUntyped, None)(cmd.modify)) + (classicReplicator ? dd.Replicator.Update(cmd.key, cmd.writeConsistency.toClassic, None)(cmd.modify)) .mapTo[dd.Replicator.UpdateResponse[d]] .map { case rsp: dd.Replicator.UpdateSuccess[d] => JReplicator.UpdateSuccess(rsp.key) @@ -121,9 +121,9 @@ import akka.actor.typed.Terminated case cmd: SReplicator.Subscribe[_] => // For the Scala API the Changed messages can be sent directly to the subscriber - untypedReplicator.tell( - dd.Replicator.Subscribe(cmd.key, cmd.subscriber.toUntyped), - sender = cmd.subscriber.toUntyped) + classicReplicator.tell( + dd.Replicator.Subscribe(cmd.key, cmd.subscriber.toClassic), + sender = cmd.subscriber.toClassic) Behaviors.same case cmd: JReplicator.Subscribe[ReplicatedData] @unchecked => @@ -134,8 +134,8 @@ import akka.actor.typed.Terminated InternalChanged(chg, cmd.subscriber) } - untypedReplicator.tell( - dd.Replicator.Subscribe(cmd.key, adapter.toUntyped), + classicReplicator.tell( + dd.Replicator.Subscribe(cmd.key, adapter.toClassic), sender = akka.actor.ActorRef.noSender) ctx.watch(cmd.subscriber) @@ -150,7 +150,7 @@ import akka.actor.typed.Terminated stopSubscribeAdapter(cmd.subscriber) case cmd: SReplicator.Delete[_] => - untypedReplicator.tell(dd.Replicator.Delete(cmd.key, cmd.consistency), sender = cmd.replyTo.toUntyped) + classicReplicator.tell(dd.Replicator.Delete(cmd.key, cmd.consistency), sender = cmd.replyTo.toClassic) Behaviors.same case cmd: JReplicator.Delete[d] => @@ -160,7 +160,7 @@ import akka.actor.typed.Terminated }) import ctx.executionContext val reply = - (untypedReplicator ? dd.Replicator.Delete(cmd.key, cmd.consistency.toUntyped)) + (classicReplicator ? dd.Replicator.Delete(cmd.key, cmd.consistency.toClassic)) .mapTo[dd.Replicator.DeleteResponse[d]] .map { case rsp: dd.Replicator.DeleteSuccess[d] => JReplicator.DeleteSuccess(rsp.key) @@ -176,21 +176,21 @@ import akka.actor.typed.Terminated Behaviors.same case SReplicator.GetReplicaCount(replyTo) => - untypedReplicator.tell(dd.Replicator.GetReplicaCount, sender = replyTo.toUntyped) + classicReplicator.tell(dd.Replicator.GetReplicaCount, sender = replyTo.toClassic) Behaviors.same case JReplicator.GetReplicaCount(replyTo) => implicit val timeout = Timeout(localAskTimeout) import ctx.executionContext val reply = - (untypedReplicator ? dd.Replicator.GetReplicaCount) + (classicReplicator ? dd.Replicator.GetReplicaCount) .mapTo[dd.Replicator.ReplicaCount] .map(rsp => JReplicator.ReplicaCount(rsp.n)) reply.foreach { replyTo ! _ } Behaviors.same case SReplicator.FlushChanges | JReplicator.FlushChanges => - untypedReplicator.tell(dd.Replicator.FlushChanges, sender = akka.actor.ActorRef.noSender) + classicReplicator.tell(dd.Replicator.FlushChanges, sender = akka.actor.ActorRef.noSender) Behaviors.same } diff --git a/akka-cluster-typed/src/main/scala/akka/cluster/ddata/typed/javadsl/Replicator.scala b/akka-cluster-typed/src/main/scala/akka/cluster/ddata/typed/javadsl/Replicator.scala index 186a33ccf2..70b7224d99 100644 --- a/akka-cluster-typed/src/main/scala/akka/cluster/ddata/typed/javadsl/Replicator.scala +++ b/akka-cluster-typed/src/main/scala/akka/cluster/ddata/typed/javadsl/Replicator.scala @@ -46,60 +46,60 @@ object Replicator { def timeout: Duration /** INTERNAL API */ - @InternalApi private[akka] def toUntyped: dd.Replicator.ReadConsistency + @InternalApi private[akka] def toClassic: dd.Replicator.ReadConsistency } case object ReadLocal extends ReadConsistency { override def timeout: Duration = Duration.ZERO /** INTERNAL API */ - @InternalApi private[akka] override def toUntyped = dd.Replicator.ReadLocal + @InternalApi private[akka] override def toClassic = dd.Replicator.ReadLocal } final case class ReadFrom(n: Int, timeout: Duration) extends ReadConsistency { require(n >= 2, "ReadFrom n must be >= 2, use ReadLocal for n=1") /** INTERNAL API */ - @InternalApi private[akka] override def toUntyped = dd.Replicator.ReadFrom(n, timeout.asScala) + @InternalApi private[akka] override def toClassic = dd.Replicator.ReadFrom(n, timeout.asScala) } final case class ReadMajority(timeout: Duration, minCap: Int = DefaultMajorityMinCap) extends ReadConsistency { def this(timeout: Duration) = this(timeout, DefaultMajorityMinCap) /** INTERNAL API */ - @InternalApi private[akka] override def toUntyped = dd.Replicator.ReadMajority(timeout.asScala, minCap) + @InternalApi private[akka] override def toClassic = dd.Replicator.ReadMajority(timeout.asScala, minCap) } final case class ReadAll(timeout: Duration) extends ReadConsistency { /** INTERNAL API */ - @InternalApi private[akka] override def toUntyped = dd.Replicator.ReadAll(timeout.asScala) + @InternalApi private[akka] override def toClassic = dd.Replicator.ReadAll(timeout.asScala) } sealed trait WriteConsistency { def timeout: Duration /** INTERNAL API */ - @InternalApi private[akka] def toUntyped: dd.Replicator.WriteConsistency + @InternalApi private[akka] def toClassic: dd.Replicator.WriteConsistency } case object WriteLocal extends WriteConsistency { override def timeout: Duration = Duration.ZERO /** INTERNAL API */ - @InternalApi private[akka] override def toUntyped = dd.Replicator.WriteLocal + @InternalApi private[akka] override def toClassic = dd.Replicator.WriteLocal } final case class WriteTo(n: Int, timeout: Duration) extends WriteConsistency { require(n >= 2, "WriteTo n must be >= 2, use WriteLocal for n=1") /** INTERNAL API */ - @InternalApi private[akka] override def toUntyped = dd.Replicator.WriteTo(n, timeout.asScala) + @InternalApi private[akka] override def toClassic = dd.Replicator.WriteTo(n, timeout.asScala) } final case class WriteMajority(timeout: Duration, minCap: Int = DefaultMajorityMinCap) extends WriteConsistency { def this(timeout: Duration) = this(timeout, DefaultMajorityMinCap) /** INTERNAL API */ - @InternalApi private[akka] override def toUntyped = dd.Replicator.WriteMajority(timeout.asScala, minCap) + @InternalApi private[akka] override def toClassic = dd.Replicator.WriteMajority(timeout.asScala, minCap) } final case class WriteAll(timeout: Duration) extends WriteConsistency { /** INTERNAL API */ - @InternalApi private[akka] override def toUntyped = dd.Replicator.WriteAll(timeout.asScala) + @InternalApi private[akka] override def toClassic = dd.Replicator.WriteAll(timeout.asScala) } /** diff --git a/akka-cluster-typed/src/main/scala/akka/cluster/ddata/typed/javadsl/ReplicatorSettings.scala b/akka-cluster-typed/src/main/scala/akka/cluster/ddata/typed/javadsl/ReplicatorSettings.scala index 1deb640e37..33af10b042 100644 --- a/akka-cluster-typed/src/main/scala/akka/cluster/ddata/typed/javadsl/ReplicatorSettings.scala +++ b/akka-cluster-typed/src/main/scala/akka/cluster/ddata/typed/javadsl/ReplicatorSettings.scala @@ -16,7 +16,7 @@ object ReplicatorSettings { * `akka.cluster.distributed-data`. */ def create(system: ActorSystem[_]): dd.ReplicatorSettings = - dd.ReplicatorSettings(system.toUntyped) + dd.ReplicatorSettings(system.toClassic) /** * Create settings from a configuration with the same layout as diff --git a/akka-cluster-typed/src/main/scala/akka/cluster/ddata/typed/scaladsl/DistributedData.scala b/akka-cluster-typed/src/main/scala/akka/cluster/ddata/typed/scaladsl/DistributedData.scala index cdba91f878..838b965e1e 100644 --- a/akka-cluster-typed/src/main/scala/akka/cluster/ddata/typed/scaladsl/DistributedData.scala +++ b/akka-cluster-typed/src/main/scala/akka/cluster/ddata/typed/scaladsl/DistributedData.scala @@ -74,9 +74,9 @@ class DistributedData(system: ActorSystem[_]) extends Extension { .getDuration("akka.cluster.ddata.typed.replicator-message-adapter-unexpected-ask-timeout") .asScala - private val untypedSystem = system.toUntyped.asInstanceOf[ExtendedActorSystem] + private val classicSystem = system.toClassic.asInstanceOf[ExtendedActorSystem] - implicit val selfUniqueAddress: SelfUniqueAddress = dd.DistributedData(untypedSystem).selfUniqueAddress + implicit val selfUniqueAddress: SelfUniqueAddress = dd.DistributedData(classicSystem).selfUniqueAddress /** * `ActorRef` of the [[Replicator]]. @@ -86,17 +86,17 @@ class DistributedData(system: ActorSystem[_]) extends Extension { val replicator: ActorRef[Replicator.Command] = if (isTerminated) { val log = system.log.withLoggerClass(getClass) - if (Cluster(untypedSystem).isTerminated) + if (Cluster(classicSystem).isTerminated) log.warning("Replicator points to dead letters, because Cluster is terminated.") else log.warning( "Replicator points to dead letters. Make sure the cluster node has the proper role. " + "Node has roles [], Distributed Data is configured for roles []", - Cluster(untypedSystem).selfRoles.mkString(","), + Cluster(classicSystem).selfRoles.mkString(","), settings.roles.mkString(",")) system.deadLetters } else { - val underlyingReplicator = dd.DistributedData(untypedSystem).replicator + val underlyingReplicator = dd.DistributedData(classicSystem).replicator val replicatorBehavior = Replicator.behavior(settings, underlyingReplicator) system.internalSystemActorOf( @@ -108,6 +108,6 @@ class DistributedData(system: ActorSystem[_]) extends Extension { /** * Returns true if this member is not tagged with the role configured for the replicas. */ - private def isTerminated: Boolean = dd.DistributedData(system.toUntyped).isTerminated + private def isTerminated: Boolean = dd.DistributedData(system.toClassic).isTerminated } diff --git a/akka-cluster-typed/src/main/scala/akka/cluster/ddata/typed/scaladsl/ReplicatorSettings.scala b/akka-cluster-typed/src/main/scala/akka/cluster/ddata/typed/scaladsl/ReplicatorSettings.scala index 9c5f51aee9..15bd60e2a9 100644 --- a/akka-cluster-typed/src/main/scala/akka/cluster/ddata/typed/scaladsl/ReplicatorSettings.scala +++ b/akka-cluster-typed/src/main/scala/akka/cluster/ddata/typed/scaladsl/ReplicatorSettings.scala @@ -20,7 +20,7 @@ object ReplicatorSettings { * `akka.cluster.distributed-data`. */ def apply(system: ActorSystem[_]): ReplicatorSettings = - dd.ReplicatorSettings(system.toUntyped) + dd.ReplicatorSettings(system.toClassic) /** * Create settings from a configuration with the same layout as @@ -34,5 +34,5 @@ object ReplicatorSettings { * The name of the actor used in DistributedData extensions. */ @InternalApi private[akka] def name(system: ActorSystem[_]): String = - dd.ReplicatorSettings.name(system.toUntyped, Some("typed")) + dd.ReplicatorSettings.name(system.toClassic, Some("typed")) } diff --git a/akka-cluster-typed/src/main/scala/akka/cluster/typed/ClusterSingleton.scala b/akka-cluster-typed/src/main/scala/akka/cluster/typed/ClusterSingleton.scala index ef48067939..8a13c4572c 100644 --- a/akka-cluster-typed/src/main/scala/akka/cluster/typed/ClusterSingleton.scala +++ b/akka-cluster-typed/src/main/scala/akka/cluster/typed/ClusterSingleton.scala @@ -9,7 +9,7 @@ import akka.annotation.{ DoNotInherit, InternalApi } import akka.cluster.ClusterSettings.DataCenter import akka.cluster.singleton.{ ClusterSingletonProxySettings, - ClusterSingletonManagerSettings => UntypedClusterSingletonManagerSettings + ClusterSingletonManagerSettings => ClassicClusterSingletonManagerSettings } import akka.cluster.typed.internal.AdaptedClusterSingletonImpl import akka.actor.typed.{ ActorRef, ActorSystem, Behavior, Extension, ExtensionId, Props } @@ -91,8 +91,8 @@ final class ClusterSingletonSettings( * INTERNAL API: */ @InternalApi - private[akka] def toManagerSettings(singletonName: String): UntypedClusterSingletonManagerSettings = - new UntypedClusterSingletonManagerSettings(singletonName, role, removalMargin, handOverRetryInterval) + private[akka] def toManagerSettings(singletonName: String): ClassicClusterSingletonManagerSettings = + new ClassicClusterSingletonManagerSettings(singletonName, role, removalMargin, handOverRetryInterval) /** * INTERNAL API: @@ -213,7 +213,7 @@ object ClusterSingletonManagerSettings { */ def apply(system: ActorSystem[_]): ClusterSingletonManagerSettings = apply(system.settings.config.getConfig("akka.cluster.singleton")) - .withRemovalMargin(akka.cluster.Cluster(system.toUntyped).downingProvider.downRemovalMargin) + .withRemovalMargin(akka.cluster.Cluster(system.toClassic).downingProvider.downRemovalMargin) /** * Create settings from a configuration with the same layout as @@ -276,7 +276,7 @@ final class ClusterSingletonManagerSettings( def withSingletonName(name: String): ClusterSingletonManagerSettings = copy(singletonName = name) def withRole(role: String): ClusterSingletonManagerSettings = - copy(role = UntypedClusterSingletonManagerSettings.roleOption(role)) + copy(role = ClassicClusterSingletonManagerSettings.roleOption(role)) def withRole(role: Option[String]): ClusterSingletonManagerSettings = copy(role = role) diff --git a/akka-cluster-typed/src/main/scala/akka/cluster/typed/internal/AdaptedClusterImpl.scala b/akka-cluster-typed/src/main/scala/akka/cluster/typed/internal/AdaptedClusterImpl.scala index 7d2981dd9a..e59d6aaffd 100644 --- a/akka-cluster-typed/src/main/scala/akka/cluster/typed/internal/AdaptedClusterImpl.scala +++ b/akka-cluster-typed/src/main/scala/akka/cluster/typed/internal/AdaptedClusterImpl.scala @@ -31,7 +31,7 @@ private[akka] object AdapterClusterImpl { var upSubscribers: List[ActorRef[SelfUp]] = Nil var removedSubscribers: List[ActorRef[SelfRemoved]] = Nil - adaptedCluster.subscribe(ctx.self.toUntyped, ClusterEvent.initialStateAsEvents, classOf[MemberEvent]) + adaptedCluster.subscribe(ctx.self.toClassic, ClusterEvent.initialStateAsEvents, classOf[MemberEvent]) // important to not eagerly refer to it or we get a cycle here lazy val cluster = Cluster(ctx.system) @@ -77,15 +77,15 @@ private[akka] object AdapterClusterImpl { case Subscribe(subscriber, eventClass) => adaptedCluster - .subscribe(subscriber.toUntyped, initialStateMode = ClusterEvent.initialStateAsEvents, eventClass) + .subscribe(subscriber.toClassic, initialStateMode = ClusterEvent.initialStateAsEvents, eventClass) Behaviors.same case Unsubscribe(subscriber) => - adaptedCluster.unsubscribe(subscriber.toUntyped) + adaptedCluster.unsubscribe(subscriber.toClassic) Behaviors.same case GetCurrentState(sender) => - adaptedCluster.sendCurrentClusterState(sender.toUntyped) + adaptedCluster.sendCurrentClusterState(sender.toClassic) Behaviors.same case evt: MemberEvent if evt.member.uniqueAddress == cluster.selfMember.uniqueAddress => @@ -139,17 +139,17 @@ private[akka] final class AdapterClusterImpl(system: ActorSystem[_]) extends Clu import AdapterClusterImpl._ require(system.isInstanceOf[ActorSystemAdapter[_]], "only adapted actor systems can be used for cluster features") - private val untypedCluster = akka.cluster.Cluster(system.toUntyped) + private val classicCluster = akka.cluster.Cluster(system.toClassic) - override def selfMember: Member = untypedCluster.selfMember - override def isTerminated: Boolean = untypedCluster.isTerminated - override def state: ClusterEvent.CurrentClusterState = untypedCluster.state + override def selfMember: Member = classicCluster.selfMember + override def isTerminated: Boolean = classicCluster.isTerminated + override def state: ClusterEvent.CurrentClusterState = classicCluster.state // must not be lazy as it also updates the cached selfMember override val subscriptions: ActorRef[ClusterStateSubscription] = - system.internalSystemActorOf(subscriptionsBehavior(untypedCluster), "clusterStateSubscriptions", Props.empty) + system.internalSystemActorOf(subscriptionsBehavior(classicCluster), "clusterStateSubscriptions", Props.empty) override lazy val manager: ActorRef[ClusterCommand] = - system.internalSystemActorOf(managerBehavior(untypedCluster), "clusterCommandManager", Props.empty) + system.internalSystemActorOf(managerBehavior(classicCluster), "clusterCommandManager", Props.empty) } diff --git a/akka-cluster-typed/src/main/scala/akka/cluster/typed/internal/AdaptedClusterSingletonImpl.scala b/akka-cluster-typed/src/main/scala/akka/cluster/typed/internal/AdaptedClusterSingletonImpl.scala index 244340e3c9..dbfe19f542 100644 --- a/akka-cluster-typed/src/main/scala/akka/cluster/typed/internal/AdaptedClusterSingletonImpl.scala +++ b/akka-cluster-typed/src/main/scala/akka/cluster/typed/internal/AdaptedClusterSingletonImpl.scala @@ -31,7 +31,7 @@ private[akka] final class AdaptedClusterSingletonImpl(system: ActorSystem[_]) ex import akka.actor.typed.scaladsl.adapter._ private lazy val cluster = Cluster(system) - private val untypedSystem = system.toUntyped.asInstanceOf[ExtendedActorSystem] + private val classicSystem = system.toClassic.asInstanceOf[ExtendedActorSystem] private val proxies = new ConcurrentHashMap[(String, Option[DataCenter]), ActorRef[_]]() @@ -50,11 +50,11 @@ private[akka] final class AdaptedClusterSingletonImpl(system: ActorSystem[_]) ex if (settings.shouldRunManager(cluster)) { val managerName = managerNameFor(singleton.name) // start singleton on this node - val untypedProps = PropsAdapter(poisonPillInterceptor(singleton.behavior), singleton.props) + val classicProps = PropsAdapter(poisonPillInterceptor(singleton.behavior), singleton.props) try { - untypedSystem.systemActorOf( + classicSystem.systemActorOf( OldSingletonManager.props( - untypedProps, + classicProps, singleton.stopMessage.getOrElse(PoisonPill), settings.toManagerSettings(singleton.name)), managerName) @@ -72,7 +72,7 @@ private[akka] final class AdaptedClusterSingletonImpl(system: ActorSystem[_]) ex def apply(singletonNameAndDc: (String, Option[DataCenter])): ActorRef[_] = { val (singletonName, _) = singletonNameAndDc val proxyName = s"singletonProxy$singletonName-${settings.dataCenter.getOrElse("no-dc")}" - untypedSystem.systemActorOf( + classicSystem.systemActorOf( ClusterSingletonProxy .props(s"/system/${managerNameFor(singletonName)}", settings.toProxySettings(singletonName)), proxyName) diff --git a/akka-cluster-typed/src/main/scala/akka/cluster/typed/internal/receptionist/ClusterReceptionist.scala b/akka-cluster-typed/src/main/scala/akka/cluster/typed/internal/receptionist/ClusterReceptionist.scala index 9f8e0a7808..45bcb391d8 100644 --- a/akka-cluster-typed/src/main/scala/akka/cluster/typed/internal/receptionist/ClusterReceptionist.scala +++ b/akka-cluster-typed/src/main/scala/akka/cluster/typed/internal/receptionist/ClusterReceptionist.scala @@ -72,14 +72,14 @@ private[typed] object ClusterReceptionist extends ReceptionistBehaviorProvider { // captures setup/dependencies so we can avoid doing it over and over again final class Setup(ctx: ActorContext[Command]) { - val untypedSystem = ctx.system.toUntyped + val classicSystem = ctx.system.toClassic val settings = ClusterReceptionistSettings(ctx.system) - val selfSystemUid = AddressUidExtension(untypedSystem).longAddressUid + val selfSystemUid = AddressUidExtension(classicSystem).longAddressUid lazy val keepTombstonesFor = cluster.settings.PruneGossipTombstonesAfter match { case f: FiniteDuration => f case _ => throw new IllegalStateException("Cannot actually happen") } - val cluster = Cluster(untypedSystem) + val cluster = Cluster(classicSystem) // don't use DistributedData.selfUniqueAddress here, because that will initialize extension, which // isn't used otherwise by the ClusterReceptionist implicit val selfNodeAddress = SelfUniqueAddress(cluster.selfUniqueAddress) @@ -108,7 +108,7 @@ private[typed] object ClusterReceptionist extends ReceptionistBehaviorProvider { } registry.allDdataKeys.foreach(key => - setup.replicator ! Replicator.Subscribe(key, replicatorMessageAdapter.toUntyped)) + setup.replicator ! Replicator.Subscribe(key, replicatorMessageAdapter.toClassic)) // keep track of cluster members // remove entries when members are removed @@ -125,7 +125,7 @@ private[typed] object ClusterReceptionist extends ReceptionistBehaviorProvider { throw new IllegalStateException(s"Unexpected ClusterDomainEvent $other. Please report bug.") } setup.cluster.subscribe( - clusterEventMessageAdapter.toUntyped, + clusterEventMessageAdapter.toClassic, ClusterEvent.InitialStateAsEvents, classOf[MemberJoined], classOf[MemberWeaklyUp], diff --git a/akka-cluster-typed/src/multi-jvm/scala/akka/cluster/typed/MultiDcClusterSingletonSpec.scala b/akka-cluster-typed/src/multi-jvm/scala/akka/cluster/typed/MultiDcClusterSingletonSpec.scala index b34df5d56a..2d33248dd5 100644 --- a/akka-cluster-typed/src/multi-jvm/scala/akka/cluster/typed/MultiDcClusterSingletonSpec.scala +++ b/akka-cluster-typed/src/multi-jvm/scala/akka/cluster/typed/MultiDcClusterSingletonSpec.scala @@ -44,7 +44,7 @@ abstract class MultiDcClusterSingletonSpec import MultiDcClusterActors._ import MultiDcClusterSingletonSpecConfig._ - "A typed cluster with multiple data centers" must { + "A cluster with multiple data centers" must { "be able to form" in { runOn(first) { cluster.manager ! Join(cluster.selfMember.address) diff --git a/akka-cluster-typed/src/test/scala/akka/cluster/typed/ActorSystemSpec.scala b/akka-cluster-typed/src/test/scala/akka/cluster/typed/ActorSystemSpec.scala index 3ddf16850e..3b7057a569 100644 --- a/akka-cluster-typed/src/test/scala/akka/cluster/typed/ActorSystemSpec.scala +++ b/akka-cluster-typed/src/test/scala/akka/cluster/typed/ActorSystemSpec.scala @@ -69,7 +69,7 @@ class ActorSystemSpec extends WordSpec with Matchers with BeforeAndAfterAll with } inbox.receiveAll() should ===("hello" :: Nil) sys.whenTerminated.futureValue - CoordinatedShutdown(sys.toUntyped).shutdownReason() should ===( + CoordinatedShutdown(sys.toClassic).shutdownReason() should ===( Some(CoordinatedShutdown.ActorSystemTerminateReason)) } } @@ -105,7 +105,7 @@ class ActorSystemSpec extends WordSpec with Matchers with BeforeAndAfterAll with // now we know that the guardian has started, and should receive PostStop sys.terminate() sys.whenTerminated.futureValue - CoordinatedShutdown(sys.toUntyped).shutdownReason() should ===( + CoordinatedShutdown(sys.toClassic).shutdownReason() should ===( Some(CoordinatedShutdown.ActorSystemTerminateReason)) inbox.receiveAll() should ===("done" :: Nil) } diff --git a/akka-cluster-typed/src/test/scala/akka/cluster/typed/ClusterApiSpec.scala b/akka-cluster-typed/src/test/scala/akka/cluster/typed/ClusterApiSpec.scala index b8f28d5a75..79626da331 100644 --- a/akka-cluster-typed/src/test/scala/akka/cluster/typed/ClusterApiSpec.scala +++ b/akka-cluster-typed/src/test/scala/akka/cluster/typed/ClusterApiSpec.scala @@ -39,7 +39,7 @@ class ClusterApiSpec extends ScalaTestWithActorTestKit(ClusterApiSpec.config) wi val testSettings = TestKitSettings(system) val clusterNode1 = Cluster(system) - val untypedSystem1 = system.toUntyped + val classicSystem1 = system.toClassic "A typed Cluster" must { diff --git a/akka-cluster-typed/src/test/scala/akka/cluster/typed/ClusterSingletonApiSpec.scala b/akka-cluster-typed/src/test/scala/akka/cluster/typed/ClusterSingletonApiSpec.scala index 52899537c5..6412b47ff9 100644 --- a/akka-cluster-typed/src/test/scala/akka/cluster/typed/ClusterSingletonApiSpec.scala +++ b/akka-cluster-typed/src/test/scala/akka/cluster/typed/ClusterSingletonApiSpec.scala @@ -90,7 +90,7 @@ class ClusterSingletonApiSpec extends ScalaTestWithActorTestKit(ClusterSingleton implicit val testSettings = TestKitSettings(system) val clusterNode1 = Cluster(system) - val untypedSystem1 = system.toUntyped + val classicSystem1 = system.toClassic val system2 = akka.actor.ActorSystem( system.name, diff --git a/akka-cluster-typed/src/test/scala/akka/cluster/typed/ClusterSingletonPersistenceSpec.scala b/akka-cluster-typed/src/test/scala/akka/cluster/typed/ClusterSingletonPersistenceSpec.scala index 254ce0feac..ae0ed90db9 100644 --- a/akka-cluster-typed/src/test/scala/akka/cluster/typed/ClusterSingletonPersistenceSpec.scala +++ b/akka-cluster-typed/src/test/scala/akka/cluster/typed/ClusterSingletonPersistenceSpec.scala @@ -58,12 +58,12 @@ class ClusterSingletonPersistenceSpec implicit val s = system - implicit val untypedSystem = system.toUntyped - private val untypedCluster = akka.cluster.Cluster(untypedSystem) + implicit val classicSystem = system.toClassic + private val classicCluster = akka.cluster.Cluster(classicSystem) "A typed cluster singleton with persistent actor" must { - untypedCluster.join(untypedCluster.selfAddress) + classicCluster.join(classicCluster.selfAddress) "start persistent actor" in { val ref = ClusterSingleton(system).init(SingletonActor(persistentActor, "singleton").withStopMessage(StopPlz)) diff --git a/akka-cluster-typed/src/test/scala/akka/cluster/typed/ClusterSingletonPoisonPillSpec.scala b/akka-cluster-typed/src/test/scala/akka/cluster/typed/ClusterSingletonPoisonPillSpec.scala index 5ac6e0b68d..80c9051490 100644 --- a/akka-cluster-typed/src/test/scala/akka/cluster/typed/ClusterSingletonPoisonPillSpec.scala +++ b/akka-cluster-typed/src/test/scala/akka/cluster/typed/ClusterSingletonPoisonPillSpec.scala @@ -32,7 +32,7 @@ class ClusterSingletonPoisonPillSpec implicit val testSettings = TestKitSettings(system) val clusterNode1 = Cluster(system) clusterNode1.manager ! Join(clusterNode1.selfMember.address) - val untypedSystem1 = system.toUntyped + val classicSystem1 = system.toClassic "A typed cluster singleton" must { "support using PoisonPill to stop" in { diff --git a/akka-cluster-typed/src/test/scala/akka/cluster/typed/RemoteMessageSpec.scala b/akka-cluster-typed/src/test/scala/akka/cluster/typed/RemoteMessageSpec.scala index 10759425b1..01aa1b63cd 100644 --- a/akka-cluster-typed/src/test/scala/akka/cluster/typed/RemoteMessageSpec.scala +++ b/akka-cluster-typed/src/test/scala/akka/cluster/typed/RemoteMessageSpec.scala @@ -10,7 +10,7 @@ import akka.Done import akka.testkit.AkkaSpec import akka.actor.typed.{ ActorRef, ActorRefResolver } import akka.actor.typed.scaladsl.Behaviors -import akka.actor.{ ExtendedActorSystem, ActorSystem => UntypedActorSystem } +import akka.actor.{ ExtendedActorSystem, ActorSystem => ClassicActorSystem } import akka.serialization.SerializerWithStringManifest import com.typesafe.config.ConfigFactory import scala.concurrent.Promise @@ -80,7 +80,7 @@ class RemoteMessageSpec extends AkkaSpec(RemoteMessageSpec.config) { // typed actor on system1 val pingPongActor = system.spawn(ponger, "pingpong") - val system2 = UntypedActorSystem(system.name + "-system2", RemoteMessageSpec.config) + val system2 = ClassicActorSystem(system.name + "-system2", RemoteMessageSpec.config) val typedSystem2 = system2.toTyped try { diff --git a/akka-cluster-typed/src/test/scala/akka/cluster/typed/internal/AkkaClusterTypedSerializerSpec.scala b/akka-cluster-typed/src/test/scala/akka/cluster/typed/internal/AkkaClusterTypedSerializerSpec.scala index 45169cc138..8a29ed6417 100644 --- a/akka-cluster-typed/src/test/scala/akka/cluster/typed/internal/AkkaClusterTypedSerializerSpec.scala +++ b/akka-cluster-typed/src/test/scala/akka/cluster/typed/internal/AkkaClusterTypedSerializerSpec.scala @@ -15,15 +15,15 @@ import org.scalatest.WordSpecLike class AkkaClusterTypedSerializerSpec extends ScalaTestWithActorTestKit with WordSpecLike { val ref = spawn(Behaviors.empty[String]) - val untypedSystem = system.toUntyped - val serializer = new AkkaClusterTypedSerializer(untypedSystem.asInstanceOf[ExtendedActorSystem]) + val classicSystem = system.toClassic + val serializer = new AkkaClusterTypedSerializer(classicSystem.asInstanceOf[ExtendedActorSystem]) "AkkaClusterTypedSerializer" must { Seq("ReceptionistEntry" -> ClusterReceptionist.Entry(ref, 666L)).foreach { case (scenario, item) => s"resolve serializer for $scenario" in { - val serializer = SerializationExtension(untypedSystem) + val serializer = SerializationExtension(classicSystem) serializer.serializerFor(item.getClass).getClass should be(classOf[AkkaClusterTypedSerializer]) } diff --git a/akka-cluster-typed/src/test/scala/akka/cluster/typed/internal/receptionist/ClusterReceptionistSpec.scala b/akka-cluster-typed/src/test/scala/akka/cluster/typed/internal/receptionist/ClusterReceptionistSpec.scala index 949c2e1346..6758bd6679 100644 --- a/akka-cluster-typed/src/test/scala/akka/cluster/typed/internal/receptionist/ClusterReceptionistSpec.scala +++ b/akka-cluster-typed/src/test/scala/akka/cluster/typed/internal/receptionist/ClusterReceptionistSpec.scala @@ -240,7 +240,7 @@ class ClusterReceptionistSpec extends WordSpec with Matchers { regProbe2.expectMessageType[Listing].serviceInstances(PingKey).size should ===(2) - akka.cluster.Cluster(system1.toUntyped).shutdown() + akka.cluster.Cluster(system1.toClassic).shutdown() regProbe2.expectNoMessage(3.seconds) diff --git a/akka-docs/src/main/paradox/mailboxes.md b/akka-docs/src/main/paradox/mailboxes.md index 3eebfa8b42..db03180a5d 100644 --- a/akka-docs/src/main/paradox/mailboxes.md +++ b/akka-docs/src/main/paradox/mailboxes.md @@ -33,7 +33,7 @@ Scala : @@snip [DispatcherDocSpec.scala](/akka-docs/src/test/scala/docs/dispatcher/DispatcherDocSpec.scala) { #required-mailbox-class } Java -: @@snip [MyBoundedActor.java](/akka-docs/src/test/java/jdocs/actor/MyBoundedActor.java) { #my-bounded-untyped-actor } +: @@snip [MyBoundedActor.java](/akka-docs/src/test/java/jdocs/actor/MyBoundedActor.java) { #my-bounded-classic-actor } The type parameter to the `RequiresMessageQueue` @scala[trait]@java[interface] needs to be mapped to a mailbox in configuration like this: diff --git a/akka-docs/src/main/paradox/project/migration-guide-2.5.x-2.6.x.md b/akka-docs/src/main/paradox/project/migration-guide-2.5.x-2.6.x.md index 86a3c0d2a6..9a02f72fae 100644 --- a/akka-docs/src/main/paradox/project/migration-guide-2.5.x-2.6.x.md +++ b/akka-docs/src/main/paradox/project/migration-guide-2.5.x-2.6.x.md @@ -10,62 +10,39 @@ If you are still using Scala 2.11 then you must upgrade to 2.12 or 2.13 ## Removed features that were deprecated -### akka-camel removed +After being deprecated since 2.5.0, the following have been removed in Akka 2.6. -After being deprecated in 2.5.0, the akka-camel module has been removed in 2.6. -As an alternative we recommend [Alpakka](https://doc.akka.io/docs/alpakka/current/). +* akka-camel module + - As an alternative we recommend [Alpakka](https://doc.akka.io/docs/alpakka/current/). + - This is of course not a drop-in replacement. If there is community interest we are open to setting up akka-camel as a separate community-maintained repository. +* akka-agent module + - If there is interest it may be moved to a separate, community-maintained repository. +* akka-contrib module + - To migrate, take the components you are using from [Akka 2.5](https://github.com/akka/akka/tree/release-2.5/akka-contrib) and include them in your own project or library under your own package name. +* Actor DSL + - Actor DSL is a rarely used feature. Use plain `system.actorOf` instead of the DSL to create Actors if you have been using it. +* `akka.stream.extra.Timing` operator + - If you need it you can now find it in `akka.stream.contrib.Timed` from [Akka Stream Contrib](https://github.com/akka/akka-stream-contrib/blob/master/src/main/scala/akka/stream/contrib/Timed.scala). +* Netty UDP (Classic remoting over UDP) + - To continue to use UDP configure @ref[Artery UDP](../remoting-artery.md#configuring-ssl-tls-for-akka-remoting) or migrate to Artery TCP. + - A full cluster restart is required to change to Artery. +* `UntypedActor` + - Use `AbstractActor` instead. +* `JavaTestKit` + - Use `akka.testkit.javadsl.TestKit` instead. +* `UntypedPersistentActor` + - Use `AbstractPersistentActor` instead. +* `UntypedPersistentActorWithAtLeastOnceDelivery` + - Use @apidoc[AbstractPersistentActorWithAtLeastOnceDelivery] instead. -This is of course not a drop-in replacement. If there is community interest we -are open to setting up akka-camel as a separate community-maintained -repository. +After being deprecated since 2.2, the following have been removed in Akka 2.6. -### akka-agent removed +* `actorFor` + - Use `ActorSelection` instead. + +### Removed methods -After being deprecated in 2.5.0, the akka-agent module has been removed in 2.6. -If there is interest it may be moved to a separate, community-maintained -repository. - -### akka-contrib removed - -The akka-contrib module was deprecated in 2.5 and has been removed in 2.6. -To migrate, take the components you are using from [Akka 2.5](https://github.com/akka/akka/tree/release-2.5/akka-contrib) -and include them in your own project or library under your own package name. - -### Actor DSL removed - -Actor DSL is a rarely used feature and has been deprecated since `2.5.0`. -Use plain `system.actorOf` instead of the DSL to create Actors if you have been using it. - -### Timing operator removed - -`akka.stream.extra.Timing` has been removed. If you need it you can now find it in `akka.stream.contrib.Timed` from - [Akka Stream Contrib](https://github.com/akka/akka-stream-contrib/blob/master/src/main/scala/akka/stream/contrib/Timed.scala). - -### actorFor removed - -`actorFor` has been deprecated since `2.2`. Use `ActorSelection` instead. - -### Netty UDP removed - -Classic remoting over UDP has been deprecated since `2.5.0` and now has been removed. -To continue to use UDP configure @ref[Artery UDP](../remoting-artery.md#configuring-ssl-tls-for-akka-remoting) or migrate to Artery TCP. -A full cluster restart is required to change to Artery. - -### Untyped actor removed - -`UntypedActor` has been depcated since `2.5.0`. Use `AbstractActor` instead. - -### UntypedPersistentActor removed - -Use `AbstractPersistentActor` instead. - -### UntypedPersistentActorWithAtLeastOnceDelivery removed - -Use @apidoc[AbstractPersistentActorWithAtLeastOnceDelivery] instead. - -### Various removed methods - -* `Logging.getLogger(UntypedActor)` Untyped actor has been removed, use AbstractActor instead. +* `Logging.getLogger(UntypedActor)` `UntypedActor` has been removed, use `AbstractActor` instead. * `LoggingReceive.create(Receive, ActorContext)` use `AbstractActor.Receive` instead. * `ActorMaterialzierSettings.withAutoFusing` disabling fusing is no longer possible. * `AbstractActor.getChild` use `findChild` instead. @@ -76,9 +53,6 @@ Use @apidoc[AbstractPersistentActorWithAtLeastOnceDelivery] instead. * `Source.actorSubscriber`, use `Source.fromGraph` instead. * `Source.actorActorPublisher`, use `Source.fromGraph` instead. -### JavaTestKit removed - -The `JavaTestKit` has been deprecated since `2.5.0`. Use `akka.testkit.javadsl.TestKit` instead. ## Deprecated features @@ -444,6 +418,12 @@ The materialized value for `StreamRefs.sinkRef` and `StreamRefs.sourceRef` is no ## Akka Typed +### Naming convention changed + +In needing a way to distinguish the new APIs in code and docs from the original, Akka used the naming +convention `untyped`. All references of the original have now been changed to `classic`. The +reference of the new APIs as `typed` is going away as it becomes the primary APIs. + ### Receptionist has moved The receptionist had a name clash with the default Cluster Client Receptionist at `/system/receptionist` and will now @@ -472,7 +452,7 @@ made before finalizing the APIs. Compared to Akka 2.5.x the source incompatible * Factory method `Entity.ofPersistentEntity` is renamed to `Entity.ofEventSourcedEntity` in the Java API for Akka Cluster Sharding Typed. * New abstract class `EventSourcedEntityWithEnforcedReplies` in Java API for Akka Cluster Sharding Typed and corresponding factory method `Entity.ofEventSourcedEntityWithEnforcedReplies` to ease the creation of `EventSourcedBehavior` with enforced replies. * New method `EventSourcedEntity.withEnforcedReplies` added to Scala API to ease the creation of `EventSourcedBehavior` with enforced replies. -* `ActorSystem.scheduler` previously gave access to the untyped `akka.actor.Scheduler` but now returns a typed specific `akka.actor.typed.Scheduler`. +* `ActorSystem.scheduler` previously gave access to the classic `akka.actor.Scheduler` but now returns a typed specific `akka.actor.typed.Scheduler`. Additionally `schedule` method has been replaced by `scheduleWithFixedDelay` and `scheduleAtFixedRate`. Actors that needs to schedule tasks should prefer `Behaviors.withTimers`. * `TimerScheduler.startPeriodicTimer`, replaced by `startTimerWithFixedDelay` or `startTimerAtFixedRate` @@ -497,9 +477,9 @@ made before finalizing the APIs. Compared to Akka 2.5.x the source incompatible #### Akka Typed Stream API changes * `ActorSource.actorRef` relying on `PartialFunction` has been replaced in the Java API with a variant more suitable to be called by Java. +* `toUntyped` has been renamed to `toClassic`. - -## Additional changes +## Materializer changes ### System global Materializer provided diff --git a/akka-docs/src/main/paradox/typed/actor-discovery.md b/akka-docs/src/main/paradox/typed/actor-discovery.md index 1007ea1bf4..ab6e1aa319 100644 --- a/akka-docs/src/main/paradox/typed/actor-discovery.md +++ b/akka-docs/src/main/paradox/typed/actor-discovery.md @@ -12,7 +12,7 @@ To use Akka Actor Typed, you must add the following dependency in your project: ## Introduction -With @ref:[untyped actors](../general/addressing.md) you would use `ActorSelection` to "lookup" actors. Given an actor path with +With @ref:[classic actors](../general/addressing.md) you would use `ActorSelection` to "lookup" actors. Given an actor path with address information you can get hold of an `ActorRef` to any actor. `ActorSelection` does not exist in Akka Typed, so how do you get the actor references? You can send refs in messages but you need something to bootstrap the interaction. diff --git a/akka-docs/src/main/paradox/typed/actor-lifecycle.md b/akka-docs/src/main/paradox/typed/actor-lifecycle.md index 3b45085ac6..e9a6860569 100644 --- a/akka-docs/src/main/paradox/typed/actor-lifecycle.md +++ b/akka-docs/src/main/paradox/typed/actor-lifecycle.md @@ -64,7 +64,7 @@ Java @@@ Note -In the untyped counter part, the @apidoc[akka.actor.ActorSystem], the root actor was provided out of the box and you +In the classic counter part, the @apidoc[akka.actor.ActorSystem], the root actor was provided out of the box and you could spawn top-level actors from the outside of the `ActorSystem` using `actorOf`. @ref:[SpawnProtocol](#spawnprotocol) is a tool that mimics the old style of starting up actors. @@ -105,7 +105,7 @@ That is not difficult to implement in your behavior, but since this is a common message protocol and implementation of a behavior for this. It can be used as the guardian actor of the `ActorSystem`, possibly combined with `Behaviors.setup` to start some initial tasks or actors. Child actors can then be started from the outside by telling or asking `SpawnProtocol.Spawn` to the actor reference of the system. When using `ask` this is -similar to how `ActorSystem.actorOf` can be used in untyped actors with the difference that a +similar to how `ActorSystem.actorOf` can be used in classic actors with the difference that a @scala[`Future`]@java[`CompletionStage`] of the `ActorRef` is returned. The guardian behavior can be defined as: diff --git a/akka-docs/src/main/paradox/typed/coexisting.md b/akka-docs/src/main/paradox/typed/coexisting.md index c06e357755..f19ae9c950 100644 --- a/akka-docs/src/main/paradox/typed/coexisting.md +++ b/akka-docs/src/main/paradox/typed/coexisting.md @@ -13,114 +13,114 @@ To use Akka Actor Typed, you must add the following dependency in your project: ## Introduction We believe Akka Typed will be adopted in existing systems gradually and therefore it's important to be able to use typed -and untyped actors together, within the same `ActorSystem`. Also, we will not be able to integrate with all existing modules in one big bang release and that is another reason for why these two ways of writing actors must be able to coexist. +and classic actors together, within the same `ActorSystem`. Also, we will not be able to integrate with all existing modules in one big bang release and that is another reason for why these two ways of writing actors must be able to coexist. There are two different `ActorSystem`s: `akka.actor.ActorSystem` and `akka.actor.typed.ActorSystem`. -Currently the typed actor system is implemented using an untyped actor system under the hood. This may change in the future. +Currently the typed actor system is implemented using the classic actor system under the hood. This may change in the future. -Typed and untyped can interact the following ways: +Typed and classic can interact the following ways: -* untyped actor systems can create typed actors -* typed actors can send messages to untyped actors, and opposite -* spawn and supervise typed child from untyped parent, and opposite -* watch typed from untyped, and opposite -* untyped actor system can be converted to a typed actor system +* classic actor systems can create typed actors +* typed actors can send messages to classic actors, and opposite +* spawn and supervise typed child from classic parent, and opposite +* watch typed from classic, and opposite +* classic actor system can be converted to a typed actor system @@@ div { .group-scala } -In the examples the `akka.actor` package is aliased to `untyped`. +In the examples the `akka.actor` package is aliased to `classic`. Scala -: @@snip [UntypedWatchingTypedSpec.scala](/akka-actor-typed-tests/src/test/scala/docs/akka/typed/coexistence/UntypedWatchingTypedSpec.scala) { #import-alias } +: @@snip [ClassicWatchingTypedSpec.scala](/akka-actor-typed-tests/src/test/scala/docs/akka/typed/coexistence/ClassicWatchingTypedSpec.scala) { #import-alias } @@@ -@java[The examples use fully qualified class names for the untyped classes to distinguish between typed and untyped classes with the same name.] +@java[The examples use fully qualified class names for the classic classes to distinguish between typed and classic classes with the same name.] -## Untyped to typed +## Classic to typed -While coexisting your application will likely still have an untyped ActorSystem. This can be converted to a typed ActorSystem -so that new code and migrated parts don't rely on the untyped system: +While coexisting your application will likely still have a classic ActorSystem. This can be converted to a typed ActorSystem +so that new code and migrated parts don't rely on the classic system: Scala -: @@snip [UntypedWatchingTypedSpec.scala](/akka-actor-typed-tests/src/test/scala/docs/akka/typed/coexistence/UntypedWatchingTypedSpec.scala) { #adapter-import #convert-untyped } +: @@snip [ClassicWatchingTypedSpec.scala](/akka-actor-typed-tests/src/test/scala/docs/akka/typed/coexistence/ClassicWatchingTypedSpec.scala) { #adapter-import #convert-classic } Java -: @@snip [UntypedWatchingTypedTest.java](/akka-actor-typed-tests/src/test/java/jdocs/akka/typed/coexistence/UntypedWatchingTypedTest.java) { #adapter-import #convert-untyped } +: @@snip [ClassicWatchingTypedTest.java](/akka-actor-typed-tests/src/test/java/jdocs/akka/typed/coexistence/ClassicWatchingTypedTest.java) { #adapter-import #convert-classic } Then for new typed actors here's how you create, watch and send messages to -it from an untyped actor. +it from a classic actor. Scala -: @@snip [UntypedWatchingTypedSpec.scala](/akka-actor-typed-tests/src/test/scala/docs/akka/typed/coexistence/UntypedWatchingTypedSpec.scala) { #typed } +: @@snip [ClassicWatchingTypedSpec.scala](/akka-actor-typed-tests/src/test/scala/docs/akka/typed/coexistence/ClassicWatchingTypedSpec.scala) { #typed } Java -: @@snip [UntypedWatchingTypedTest.java](/akka-actor-typed-tests/src/test/java/jdocs/akka/typed/coexistence/UntypedWatchingTypedTest.java) { #typed } +: @@snip [ClassicWatchingTypedTest.java](/akka-actor-typed-tests/src/test/java/jdocs/akka/typed/coexistence/ClassicWatchingTypedTest.java) { #typed } -The top level untyped actor is created in the usual way: +The top level classic actor is created in the usual way: Scala -: @@snip [UntypedWatchingTypedSpec.scala](/akka-actor-typed-tests/src/test/scala/docs/akka/typed/coexistence/UntypedWatchingTypedSpec.scala) { #create-untyped } +: @@snip [ClassicWatchingTypedSpec.scala](/akka-actor-typed-tests/src/test/scala/docs/akka/typed/coexistence/ClassicWatchingTypedSpec.scala) { #create-classic } Java -: @@snip [UntypedWatchingTypedTest.java](/akka-actor-typed-tests/src/test/java/jdocs/akka/typed/coexistence/UntypedWatchingTypedTest.java) { #create-untyped } +: @@snip [ClassicWatchingTypedTest.java](/akka-actor-typed-tests/src/test/java/jdocs/akka/typed/coexistence/ClassicWatchingTypedTest.java) { #create-classic } Then it can create a typed actor, watch it, and send a message to it: Scala -: @@snip [UntypedWatchingTypedSpec.scala](/akka-actor-typed-tests/src/test/scala/docs/akka/typed/coexistence/UntypedWatchingTypedSpec.scala) { #untyped-watch } +: @@snip [ClassicWatchingTypedSpec.scala](/akka-actor-typed-tests/src/test/scala/docs/akka/typed/coexistence/ClassicWatchingTypedSpec.scala) { #classic-watch } Java -: @@snip [UntypedWatchingTypedTest.java](/akka-actor-typed-tests/src/test/java/jdocs/akka/typed/coexistence/UntypedWatchingTypedTest.java) { #untyped-watch } +: @@snip [ClassicWatchingTypedTest.java](/akka-actor-typed-tests/src/test/java/jdocs/akka/typed/coexistence/ClassicWatchingTypedTest.java) { #classic-watch } @scala[There is one `import` that is needed to make that work.] @java[We import the Adapter class and call static methods for conversion.] Scala -: @@snip [UntypedWatchingTypedSpec.scala](/akka-actor-typed-tests/src/test/scala/docs/akka/typed/coexistence/UntypedWatchingTypedSpec.scala) { #adapter-import } +: @@snip [ClassicWatchingTypedSpec.scala](/akka-actor-typed-tests/src/test/scala/docs/akka/typed/coexistence/ClassicWatchingTypedSpec.scala) { #adapter-import } Java -: @@snip [UntypedWatchingTypedTest.java](/akka-actor-typed-tests/src/test/java/jdocs/akka/typed/coexistence/UntypedWatchingTypedTest.java) { #adapter-import } +: @@snip [ClassicWatchingTypedTest.java](/akka-actor-typed-tests/src/test/java/jdocs/akka/typed/coexistence/ClassicWatchingTypedTest.java) { #adapter-import } -@scala[That adds some implicit extension methods that are added to untyped and typed `ActorSystem` and `ActorContext` in both directions.] -@java[To convert between typed and untyped there are adapter methods in `akka.actor.typed.javadsl.Adapter`.] Note the inline comments in the example above. +@scala[That adds some implicit extension methods that are added to classic and typed `ActorSystem` and `ActorContext` in both directions.] +@java[To convert between typed and classic there are adapter methods in `akka.actor.typed.javadsl.Adapter`.] Note the inline comments in the example above. -## Typed to untyped +## Typed to classic -Let's turn the example upside down and first start the typed actor and then the untyped as a child. +Let's turn the example upside down and first start the typed actor and then the classic as a child. The following will show how to create, watch and send messages back and forth from a typed actor to this -untyped actor: +classic actor: Scala -: @@snip [TypedWatchingUntypedSpec.scala](/akka-actor-typed-tests/src/test/scala/docs/akka/typed/coexistence/TypedWatchingUntypedSpec.scala) { #untyped } +: @@snip [TypedWatchingClassicSpec.scala](/akka-actor-typed-tests/src/test/scala/docs/akka/typed/coexistence/TypedWatchingClassicSpec.scala) { #classic } Java -: @@snip [TypedWatchingUntypedTest.java](/akka-actor-typed-tests/src/test/java/jdocs/akka/typed/coexistence/TypedWatchingUntypedTest.java) { #untyped } +: @@snip [TypedWatchingClassicTest.java](/akka-actor-typed-tests/src/test/java/jdocs/akka/typed/coexistence/TypedWatchingClassicTest.java) { #classic } Creating the actor system and the typed actor: Scala -: @@snip [TypedWatchingUntypedSpec.scala](/akka-actor-typed-tests/src/test/scala/docs/akka/typed/coexistence/TypedWatchingUntypedSpec.scala) { #create } +: @@snip [TypedWatchingClassicSpec.scala](/akka-actor-typed-tests/src/test/scala/docs/akka/typed/coexistence/TypedWatchingClassicSpec.scala) { #create } Java -: @@snip [TypedWatchingUntypedTest.java](/akka-actor-typed-tests/src/test/java/jdocs/akka/typed/coexistence/TypedWatchingUntypedTest.java) { #create } +: @@snip [TypedWatchingClassicTest.java](/akka-actor-typed-tests/src/test/java/jdocs/akka/typed/coexistence/TypedWatchingClassicTest.java) { #create } -Then the typed actor creates the untyped actor, watches it and sends and receives a response: +Then the typed actor creates the classic actor, watches it and sends and receives a response: Scala -: @@snip [TypedWatchingUntypedSpec.scala](/akka-actor-typed-tests/src/test/scala/docs/akka/typed/coexistence/TypedWatchingUntypedSpec.scala) { #typed } +: @@snip [TypedWatchingClassicSpec.scala](/akka-actor-typed-tests/src/test/scala/docs/akka/typed/coexistence/TypedWatchingClassicSpec.scala) { #typed } Java -: @@snip [TypedWatchingUntypedTest.java](/akka-actor-typed-tests/src/test/java/jdocs/akka/typed/coexistence/TypedWatchingUntypedTest.java) { #typed } +: @@snip [TypedWatchingClassicTest.java](/akka-actor-typed-tests/src/test/java/jdocs/akka/typed/coexistence/TypedWatchingClassicTest.java) { #typed } ## Supervision -The default supervision for untyped actors is to restart whereas for typed it is to stop. -When combining untyped and typed actors the default supervision is based on the default behavior of -the child i.e. if an untyped actor creates a typed child, its default supervision will be to stop. If a typed -actor creates an untyped child, its default supervision will be to restart. +The default supervision for classic actors is to restart whereas for typed it is to stop. +When combining classic and typed actors the default supervision is based on the default behavior of +the child, for example if a classic actor creates a typed child, its default supervision will be to stop. If a typed +actor creates a classic child, its default supervision will be to restart. diff --git a/akka-docs/src/main/paradox/typed/distributed-data.md b/akka-docs/src/main/paradox/typed/distributed-data.md index 10b6e56030..1988bfa04d 100644 --- a/akka-docs/src/main/paradox/typed/distributed-data.md +++ b/akka-docs/src/main/paradox/typed/distributed-data.md @@ -39,7 +39,7 @@ actor provides the API for interacting with the data and is accessed through the The messages for the replicator, such as `Replicator.Update` are defined in @apidoc[typed.*.Replicator] but the actual CRDTs are the -same as in untyped, for example `akka.cluster.ddata.GCounter`. This will require a @scala[implicit] `akka.cluster.ddata.SelfUniqueAddress.SelfUniqueAddress`, +same as in classic, for example `akka.cluster.ddata.GCounter`. This will require a @scala[implicit] `akka.cluster.ddata.SelfUniqueAddress.SelfUniqueAddress`, available from @scala[`implicit val node = DistributedData(system).selfUniqueAddress`]@java[SelfUniqueAddress node = DistributedData.get(system).selfUniqueAddress();]. The replicator can contain multiple entries each containing a replicated data type, we therefore need to create a @@ -79,7 +79,7 @@ the extra interaction with the replicator using the `GetCachedValue` command. The example also supports asking the replicator using the `GetValue` command. Note how the `replyTo` from the incoming message can be used when the `GetSuccess` response from the replicator is received. -See the @ref[the untyped Distributed Data documentation](../distributed-data.md#using-the-replicator) +See the @ref:[the classic Distributed Data documentation](../distributed-data.md#using-the-replicator) for more details about `Get`, `Update` and `Delete` interactions with the replicator. @@@ div { .group-scala } @@ -98,15 +98,15 @@ Scala ### Replicated data types Akka contains a set of useful replicated data types and it is fully possible to implement custom replicated data types. -For more details, read @ref[the untyped Distributed Data documentation](../distributed-data.md#data-types) +For more details, read @ref:[the classic Distributed Data documentation](../distributed-data.md#data-types) ### Running separate instances of the replicator For some use cases, for example when limiting the replicator to certain roles, or using different subsets on different roles, it makes sense to start separate replicators, this needs to be done on all nodes, or -the group of nodes tagged with a specific role. To do this with the Typed Distributed Data you will first -have to start an untyped `Replicator` and pass it to the `Replicator.behavior` method that takes an untyped -actor ref. All such `Replicator`s must run on the same path in the untyped actor hierarchy. +the group of nodes tagged with a specific role. To do this with Distributed Data you will first +have to start a classic `Replicator` and pass it to the `Replicator.behavior` method that takes a classic +actor ref. All such `Replicator`s must run on the same path in the classic actor hierarchy. A standalone `ReplicatorMessageAdapter` can also be created for a given `Replicator` instead of creating one via the `DistributedData` extension. diff --git a/akka-docs/src/main/paradox/typed/fault-tolerance.md b/akka-docs/src/main/paradox/typed/fault-tolerance.md index 5081b644a7..9284d37bc7 100644 --- a/akka-docs/src/main/paradox/typed/fault-tolerance.md +++ b/akka-docs/src/main/paradox/typed/fault-tolerance.md @@ -5,8 +5,8 @@ will by default be stopped. @@@ note -An important difference between Typed and Untyped actors is that Typed actors are by default stopped if -an exception is thrown and no supervision strategy is defined while in Untyped they are restarted. +An important difference between Typed and Classic actors is that Typed actors are by default stopped if +an exception is thrown and no supervision strategy is defined while in Classic they are restarted. @@@ @@ -26,7 +26,7 @@ with a fresh state that we know is valid. ## Supervision -In Akka Typed this "somewhere else" is called supervision. Supervision allows you to declaratively describe what should happen when a certain type of exceptions are thrown inside an actor. To use supervision the actual Actor behavior is wrapped using `Behaviors.supervise`, for example to restart on `IllegalStateExceptions`: +In Akka this "somewhere else" is called supervision. Supervision allows you to declaratively describe what should happen when a certain type of exceptions are thrown inside an actor. To use supervision the actual Actor behavior is wrapped using `Behaviors.supervise`, for example to restart on `IllegalStateExceptions`: Scala @@ -114,7 +114,7 @@ restarted. ## Bubble failures up through the hierarchy In some scenarios it may be useful to push the decision about what to do on a failure upwards in the Actor hierarchy - and let the parent actor handle what should happen on failures (in untyped Akka Actors this is how it works by default). + and let the parent actor handle what should happen on failures (in classic Akka Actors this is how it works by default). For a parent to be notified when a child is terminated it has to `watch` the child. If the child was stopped because of a failure the `ChildFailed` signal will be received which will contain the cause. `ChildFailed` extends `Terminated` so if diff --git a/akka-docs/src/main/paradox/typed/fsm.md b/akka-docs/src/main/paradox/typed/fsm.md index f3f48ed60a..ef0d53da01 100644 --- a/akka-docs/src/main/paradox/typed/fsm.md +++ b/akka-docs/src/main/paradox/typed/fsm.md @@ -1,10 +1,10 @@ # Behaviors as Finite state machines -With untyped actors there is explicit support for building @ref[Finite State Machines](../fsm.md). No support +With classic actors there is explicit support for building @ref[Finite State Machines](../fsm.md). No support is needed in Akka Typed as it is straightforward to represent FSMs with behaviors. To see how the Akka Typed API can be used to model FSMs here's the Buncher example ported from -the @ref[untyped actor FSM docs](../fsm.md). It demonstrates how to: +the @ref[classic actor FSM docs](../fsm.md). It demonstrates how to: * Model states using different behaviors * Model storing data at each state by representing the behavior as a method @@ -22,7 +22,7 @@ Java `Batches` to be passed on; `Queue` will add to the internal queue while `Flush` will mark the end of a burst. -Untyped `FSM`s also have a `D` (data) type parameter. Akka Typed doesn't need to be aware of this and it can be stored +Classic `FSM`s also have a `D` (data) type parameter. Akka Typed doesn't need to be aware of this and it can be stored via defining your behaviors as methods. Scala diff --git a/akka-docs/src/main/paradox/typed/persistence.md b/akka-docs/src/main/paradox/typed/persistence.md index bad31d8735..c0dc4b3021 100644 --- a/akka-docs/src/main/paradox/typed/persistence.md +++ b/akka-docs/src/main/paradox/typed/persistence.md @@ -24,7 +24,7 @@ To use Akka Persistence Typed, add the module to your project: ## Introduction Akka Persistence is a library for building event sourced actors. For background about how it works -see the @ref:[untyped Akka Persistence section](../persistence.md). This documentation shows how the typed API for persistence +see the @ref:[classic Akka Persistence section](../persistence.md). This documentation shows how the typed API for persistence works and assumes you know what is meant by `Command`, `Event` and `State`. ## Example @@ -323,7 +323,7 @@ command or the reply will be sent later, perhaps after some asynchronous interac ## Serialization -The same @ref:[serialization](../serialization.md) mechanism as for untyped +The same @ref:[serialization](../serialization.md) mechanism as for classic actors is also used in Akka Typed, also for persistent actors. When picking serialization solution for the events you should also consider that it must be possible read old events when the application has evolved. Strategies for that can be found in the @ref:[schema evolution](../persistence-schema-evolution.md). diff --git a/akka-docs/src/main/paradox/typed/testing.md b/akka-docs/src/main/paradox/typed/testing.md index f5b4a9458f..e6daca4205 100644 --- a/akka-docs/src/main/paradox/typed/testing.md +++ b/akka-docs/src/main/paradox/typed/testing.md @@ -2,7 +2,7 @@ ## Dependency -To use Akka TestKit Typed, add the module to your project: +To use Akka TestKit add the module to your project: @@dependency[sbt,Maven,Gradle] { group=com.typesafe.akka @@ -13,7 +13,7 @@ To use Akka TestKit Typed, add the module to your project: @@@div { .group-scala } -We recommend using Akka TestKit Typed with ScalaTest: +We recommend using Akka TestKit with ScalaTest: @@dependency[sbt,Maven,Gradle] { group=org.scalatest @@ -77,8 +77,8 @@ Java The following demonstrates: -* Creating a typed actor from the `TestKit`'s system using `spawn` -* Creating a typed `TestProbe` +* Creating an actor from the `TestKit`'s system using `spawn` +* Creating a `TestProbe` * Verifying that the actor under test responds via the `TestProbe` Scala @@ -117,7 +117,7 @@ run the other actors it depends on. Instead, you might want to create mock behav messages in the same way the other actor would do but without executing any actual logic. In addition to this it can also be useful to observe those interactions to assert that the component under test did send the expected messages. -This allows the same kinds of tests as untyped `TestActor`/`Autopilot`. +This allows the same kinds of tests as classic `TestActor`/`Autopilot`. As an example, let's assume we'd like to test the following component: diff --git a/akka-docs/src/test/java/jdocs/actor/MyBoundedActor.java b/akka-docs/src/test/java/jdocs/actor/MyBoundedActor.java index 88a0e4efa5..f840081f59 100644 --- a/akka-docs/src/test/java/jdocs/actor/MyBoundedActor.java +++ b/akka-docs/src/test/java/jdocs/actor/MyBoundedActor.java @@ -4,10 +4,10 @@ package jdocs.actor; -// #my-bounded-untyped-actor +// #my-bounded-classic-actor import akka.dispatch.BoundedMessageQueueSemantics; import akka.dispatch.RequiresMessageQueue; public class MyBoundedActor extends MyActor implements RequiresMessageQueue {} -// #my-bounded-untyped-actor +// #my-bounded-classic-actor diff --git a/akka-persistence-typed/src/main/scala/akka/persistence/typed/EventSourcedSignal.scala b/akka-persistence-typed/src/main/scala/akka/persistence/typed/EventSourcedSignal.scala index 444455fe77..7286604704 100644 --- a/akka-persistence-typed/src/main/scala/akka/persistence/typed/EventSourcedSignal.scala +++ b/akka-persistence-typed/src/main/scala/akka/persistence/typed/EventSourcedSignal.scala @@ -64,7 +64,7 @@ object SnapshotMetadata { /** * INTERNAL API */ - @InternalApi private[akka] def fromUntyped(metadata: akka.persistence.SnapshotMetadata): SnapshotMetadata = + @InternalApi private[akka] def fromClassic(metadata: akka.persistence.SnapshotMetadata): SnapshotMetadata = new SnapshotMetadata(metadata.persistenceId, metadata.sequenceNr, metadata.timestamp) } diff --git a/akka-persistence-typed/src/main/scala/akka/persistence/typed/SnapshotAdapter.scala b/akka-persistence-typed/src/main/scala/akka/persistence/typed/SnapshotAdapter.scala index e242b6c28f..f98f9d411b 100644 --- a/akka-persistence-typed/src/main/scala/akka/persistence/typed/SnapshotAdapter.scala +++ b/akka-persistence-typed/src/main/scala/akka/persistence/typed/SnapshotAdapter.scala @@ -7,7 +7,7 @@ package akka.persistence.typed /** * Facility to convert snapshots from and to a specialized data model. * Can be used when migration from different state types e.g. when migration - * from Persistent FSM to Typed Persistence. + * from Persistent FSM to Typed EventSourcedBehavior. * * @tparam State The state type of the `EventSourcedBehavior` */ diff --git a/akka-persistence-typed/src/main/scala/akka/persistence/typed/SnapshotSelectionCriteria.scala b/akka-persistence-typed/src/main/scala/akka/persistence/typed/SnapshotSelectionCriteria.scala index 83fd9451ad..4587b91cd6 100644 --- a/akka-persistence-typed/src/main/scala/akka/persistence/typed/SnapshotSelectionCriteria.scala +++ b/akka-persistence-typed/src/main/scala/akka/persistence/typed/SnapshotSelectionCriteria.scala @@ -5,7 +5,7 @@ package akka.persistence.typed import akka.annotation.InternalApi -import akka.persistence.{ SnapshotSelectionCriteria => UntypedSnapshotSelectionCriteria } +import akka.persistence.{ SnapshotSelectionCriteria => ClassicSnapshotSelectionCriteria } import akka.util.HashCode object SnapshotSelectionCriteria { @@ -29,7 +29,7 @@ object SnapshotSelectionCriteria { /** * INTERNAL API */ - @InternalApi private[akka] def fromUntyped(c: UntypedSnapshotSelectionCriteria): SnapshotSelectionCriteria = + @InternalApi private[akka] def fromClassic(c: ClassicSnapshotSelectionCriteria): SnapshotSelectionCriteria = new SnapshotSelectionCriteria(c.maxSequenceNr, c.maxTimestamp, c.minSequenceNr, c.minTimestamp) } @@ -82,7 +82,7 @@ final class SnapshotSelectionCriteria @InternalApi private[akka] ( /** * INTERNAL API */ - @InternalApi private[akka] def toUntyped: akka.persistence.SnapshotSelectionCriteria = + @InternalApi private[akka] def toClassic: akka.persistence.SnapshotSelectionCriteria = akka.persistence.SnapshotSelectionCriteria(maxSequenceNr, maxTimestamp, minSequenceNr, minTimestamp) override def equals(other: Any): Boolean = other match { diff --git a/akka-persistence-typed/src/main/scala/akka/persistence/typed/internal/BehaviorSetup.scala b/akka-persistence-typed/src/main/scala/akka/persistence/typed/internal/BehaviorSetup.scala index ab42d9ee68..6e7b3ad9dd 100644 --- a/akka-persistence-typed/src/main/scala/akka/persistence/typed/internal/BehaviorSetup.scala +++ b/akka-persistence-typed/src/main/scala/akka/persistence/typed/internal/BehaviorSetup.scala @@ -55,12 +55,12 @@ private[akka] final class BehaviorSetup[C, E, S]( import akka.actor.typed.scaladsl.adapter._ import BehaviorSetup._ - val persistence: Persistence = Persistence(context.system.toUntyped) + val persistence: Persistence = Persistence(context.system.toClassic) val journal: ActorRef = persistence.journalFor(settings.journalPluginId) val snapshotStore: ActorRef = persistence.snapshotStoreFor(settings.snapshotPluginId) - def selfUntyped = context.self.toUntyped + def selfClassic: ActorRef = context.self.toClassic private var mdc: Map[String, Any] = Map.empty private var _log: OptionVal[Logger] = OptionVal.Some(context.log) // changed when mdc is changed diff --git a/akka-persistence-typed/src/main/scala/akka/persistence/typed/internal/EventSourcedBehaviorImpl.scala b/akka-persistence-typed/src/main/scala/akka/persistence/typed/internal/EventSourcedBehaviorImpl.scala index aa3eb65b37..beff3063ad 100644 --- a/akka-persistence-typed/src/main/scala/akka/persistence/typed/internal/EventSourcedBehaviorImpl.scala +++ b/akka-persistence-typed/src/main/scala/akka/persistence/typed/internal/EventSourcedBehaviorImpl.scala @@ -192,7 +192,7 @@ private[akka] final case class EventSourcedBehaviorImpl[Command, Event, State]( override def withSnapshotSelectionCriteria( selection: SnapshotSelectionCriteria): EventSourcedBehavior[Command, Event, State] = { - copy(recovery = Recovery(selection.toUntyped)) + copy(recovery = Recovery(selection.toClassic)) } override def snapshotWhen(predicate: (State, Event, Long) => Boolean): EventSourcedBehavior[Command, Event, State] = diff --git a/akka-persistence-typed/src/main/scala/akka/persistence/typed/internal/ExternalInteractions.scala b/akka-persistence-typed/src/main/scala/akka/persistence/typed/internal/ExternalInteractions.scala index d7566f4054..59c98cef9e 100644 --- a/akka-persistence-typed/src/main/scala/akka/persistence/typed/internal/ExternalInteractions.scala +++ b/akka-persistence-typed/src/main/scala/akka/persistence/typed/internal/ExternalInteractions.scala @@ -51,7 +51,7 @@ private[akka] trait JournalInteractions[C, E, S] { val write = AtomicWrite(repr) :: Nil setup.journal - .tell(JournalProtocol.WriteMessages(write, setup.selfUntyped, setup.writerIdentity.instanceId), setup.selfUntyped) + .tell(JournalProtocol.WriteMessages(write, setup.selfClassic, setup.writerIdentity.instanceId), setup.selfClassic) newState } @@ -86,8 +86,8 @@ private[akka] trait JournalInteractions[C, E, S] { val write = AtomicWrite(writes) setup.journal.tell( - JournalProtocol.WriteMessages(write :: Nil, setup.selfUntyped, setup.writerIdentity.instanceId), - setup.selfUntyped) + JournalProtocol.WriteMessages(write :: Nil, setup.selfClassic, setup.writerIdentity.instanceId), + setup.selfClassic) newState } else state @@ -106,11 +106,11 @@ private[akka] trait JournalInteractions[C, E, S] { toSeqNr, setup.recovery.replayMax, setup.persistenceId.id, - setup.selfUntyped) + setup.selfClassic) } protected def requestRecoveryPermit(): Unit = { - setup.persistence.recoveryPermitter.tell(RecoveryPermitter.RequestRecoveryPermit, setup.selfUntyped) + setup.persistence.recoveryPermitter.tell(RecoveryPermitter.RequestRecoveryPermit, setup.selfClassic) } /** Intended to be used in .onSignal(returnPermitOnStop) by behaviors */ @@ -128,7 +128,7 @@ private[akka] trait JournalInteractions[C, E, S] { protected def tryReturnRecoveryPermit(reason: String): Unit = { if (setup.holdingRecoveryPermit) { setup.log.debug("Returning recovery permit, reason: {}", reason) - setup.persistence.recoveryPermitter.tell(RecoveryPermitter.ReturnRecoveryPermit, setup.selfUntyped) + setup.persistence.recoveryPermitter.tell(RecoveryPermitter.ReturnRecoveryPermit, setup.selfClassic) setup.holdingRecoveryPermit = false } // else, no need to return the permit } @@ -140,7 +140,7 @@ private[akka] trait JournalInteractions[C, E, S] { */ protected def internalDeleteEvents(lastSequenceNr: Long, toSequenceNr: Long): Unit = if (toSequenceNr > 0) { - val self = setup.selfUntyped + val self = setup.selfClassic if (toSequenceNr == Long.MaxValue || toSequenceNr <= lastSequenceNr) setup.journal ! JournalProtocol.DeleteMessagesTo(setup.persistenceId.id, toSequenceNr, self) @@ -163,7 +163,7 @@ private[akka] trait SnapshotInteractions[C, E, S] { * to the running [[PersistentActor]]. */ protected def loadSnapshot(criteria: SnapshotSelectionCriteria, toSequenceNr: Long): Unit = { - setup.snapshotStore.tell(LoadSnapshot(setup.persistenceId.id, criteria, toSequenceNr), setup.selfUntyped) + setup.snapshotStore.tell(LoadSnapshot(setup.persistenceId.id, criteria, toSequenceNr), setup.selfClassic) } protected def internalSaveSnapshot(state: Running.RunningState[S]): Unit = { @@ -175,7 +175,7 @@ private[akka] trait SnapshotInteractions[C, E, S] { SnapshotProtocol.SaveSnapshot( SnapshotMetadata(setup.persistenceId.id, state.seqNr), setup.snapshotAdapter.toJournal(state.state)), - setup.selfUntyped) + setup.selfClassic) } /** Deletes the snapshots up to and including the `sequenceNr`. */ @@ -184,7 +184,7 @@ private[akka] trait SnapshotInteractions[C, E, S] { val snapshotCriteria = SnapshotSelectionCriteria(minSequenceNr = fromSequenceNr, maxSequenceNr = toSequenceNr) setup.log.debug("Deleting snapshots from sequenceNr [{}] to [{}]", fromSequenceNr, toSequenceNr) setup.snapshotStore - .tell(SnapshotProtocol.DeleteSnapshots(setup.persistenceId.id, snapshotCriteria), setup.selfUntyped) + .tell(SnapshotProtocol.DeleteSnapshots(setup.persistenceId.id, snapshotCriteria), setup.selfClassic) } } } diff --git a/akka-persistence-typed/src/main/scala/akka/persistence/typed/internal/Running.scala b/akka-persistence-typed/src/main/scala/akka/persistence/typed/internal/Running.scala index 637c0463cd..dcaf3a70f2 100644 --- a/akka-persistence-typed/src/main/scala/akka/persistence/typed/internal/Running.scala +++ b/akka-persistence-typed/src/main/scala/akka/persistence/typed/internal/Running.scala @@ -186,8 +186,8 @@ private[akka] object Running { case _: Unhandled.type => import akka.actor.typed.scaladsl.adapter._ - setup.context.system.toUntyped.eventStream - .publish(UnhandledMessage(msg, setup.context.system.toUntyped.deadLetters, setup.context.self.toUntyped)) + setup.context.system.toClassic.eventStream + .publish(UnhandledMessage(msg, setup.context.system.toClassic.deadLetters, setup.context.self.toClassic)) tryUnstashOne(applySideEffects(sideEffects, state)) case _: Stash.type => @@ -368,11 +368,11 @@ private[akka] object Running { } } - Some(SnapshotCompleted(SnapshotMetadata.fromUntyped(meta))) + Some(SnapshotCompleted(SnapshotMetadata.fromClassic(meta))) case SaveSnapshotFailure(meta, error) => setup.log.warning("Failed to save snapshot given metadata [{}] due to [{}]", meta, error.getMessage) - Some(SnapshotFailed(SnapshotMetadata.fromUntyped(meta), error)) + Some(SnapshotFailed(SnapshotMetadata.fromClassic(meta), error)) case _ => None @@ -490,13 +490,13 @@ private[akka] object Running { def onDeleteSnapshotResponse(response: SnapshotProtocol.Response, state: S): Behavior[InternalProtocol] = { val signal = response match { case DeleteSnapshotsSuccess(criteria) => - Some(DeleteSnapshotsCompleted(DeletionTarget.Criteria(SnapshotSelectionCriteria.fromUntyped(criteria)))) + Some(DeleteSnapshotsCompleted(DeletionTarget.Criteria(SnapshotSelectionCriteria.fromClassic(criteria)))) case DeleteSnapshotsFailure(criteria, error) => - Some(DeleteSnapshotsFailed(DeletionTarget.Criteria(SnapshotSelectionCriteria.fromUntyped(criteria)), error)) + Some(DeleteSnapshotsFailed(DeletionTarget.Criteria(SnapshotSelectionCriteria.fromClassic(criteria)), error)) case DeleteSnapshotSuccess(meta) => - Some(DeleteSnapshotsCompleted(DeletionTarget.Individual(SnapshotMetadata.fromUntyped(meta)))) + Some(DeleteSnapshotsCompleted(DeletionTarget.Individual(SnapshotMetadata.fromClassic(meta)))) case DeleteSnapshotFailure(meta, error) => - Some(DeleteSnapshotsFailed(DeletionTarget.Individual(SnapshotMetadata.fromUntyped(meta)), error)) + Some(DeleteSnapshotsFailed(DeletionTarget.Individual(SnapshotMetadata.fromClassic(meta)), error)) case _ => None } diff --git a/akka-persistence-typed/src/main/scala/akka/persistence/typed/internal/StashManagement.scala b/akka-persistence-typed/src/main/scala/akka/persistence/typed/internal/StashManagement.scala index 56e8a661cc..adb6714fa1 100644 --- a/akka-persistence-typed/src/main/scala/akka/persistence/typed/internal/StashManagement.scala +++ b/akka-persistence-typed/src/main/scala/akka/persistence/typed/internal/StashManagement.scala @@ -52,7 +52,7 @@ private[akka] trait StashManagement[C, E, S] { } context.log.warning("Stash buffer is full, dropping message [{}]", dropName) } - context.system.toUntyped.eventStream.publish(Dropped(msg, "Stash buffer is full", context.self.toUntyped)) + context.system.toClassic.eventStream.publish(Dropped(msg, "Stash buffer is full", context.self.toClassic)) case StashOverflowStrategy.Fail => throw e } diff --git a/akka-persistence-typed/src/main/scala/akka/persistence/typed/javadsl/EventSourcedBehavior.scala b/akka-persistence-typed/src/main/scala/akka/persistence/typed/javadsl/EventSourcedBehavior.scala index ed039ec669..0ce8dc376e 100644 --- a/akka-persistence-typed/src/main/scala/akka/persistence/typed/javadsl/EventSourcedBehavior.scala +++ b/akka-persistence-typed/src/main/scala/akka/persistence/typed/javadsl/EventSourcedBehavior.scala @@ -157,7 +157,7 @@ abstract class EventSourcedBehavior[Command, Event, State] private[akka] ( /** * Transform the state into another type before giving it to and from the journal. Can be used - * to migrate from different state types e.g. when migration from PersistentFSM to Typed Persistence + * to migrate from different state types e.g. when migration from PersistentFSM to Typed EventSourcedBehavior. */ def snapshotAdapter(): SnapshotAdapter[State] = NoOpSnapshotAdapter.instance[State] diff --git a/akka-persistence-typed/src/main/scala/akka/persistence/typed/scaladsl/EventSourcedBehavior.scala b/akka-persistence-typed/src/main/scala/akka/persistence/typed/scaladsl/EventSourcedBehavior.scala index feaef49921..7b35cb7539 100644 --- a/akka-persistence-typed/src/main/scala/akka/persistence/typed/scaladsl/EventSourcedBehavior.scala +++ b/akka-persistence-typed/src/main/scala/akka/persistence/typed/scaladsl/EventSourcedBehavior.scala @@ -190,7 +190,7 @@ object EventSourcedBehavior { /** * Transform the state to another type before giving to the journal. Can be used to transform older - * state types into the current state type e.g. when migrating from Persistent FSM to Typed Persistence. + * state types into the current state type e.g. when migrating from Persistent FSM to Typed EventSourcedBehavior. */ def snapshotAdapter(adapter: SnapshotAdapter[State]): EventSourcedBehavior[Command, Event, State] diff --git a/akka-persistence-typed/src/test/java/akka/persistence/typed/javadsl/EventSourcedActorFailureTest.java b/akka-persistence-typed/src/test/java/akka/persistence/typed/javadsl/EventSourcedActorFailureTest.java index d32b7de1b8..a9c2e59af3 100644 --- a/akka-persistence-typed/src/test/java/akka/persistence/typed/javadsl/EventSourcedActorFailureTest.java +++ b/akka-persistence-typed/src/test/java/akka/persistence/typed/javadsl/EventSourcedActorFailureTest.java @@ -9,9 +9,7 @@ import akka.actor.testkit.typed.javadsl.TestKitJunitResource; import akka.actor.testkit.typed.javadsl.TestProbe; import akka.actor.typed.ActorRef; import akka.actor.typed.Behavior; -import akka.actor.typed.Signal; import akka.actor.typed.SupervisorStrategy; -import akka.japi.function.Effect; import akka.persistence.typed.PersistenceId; import akka.persistence.typed.RecoveryCompleted; import akka.persistence.typed.RecoveryFailed; @@ -99,7 +97,7 @@ public class EventSourcedActorFailureTest extends JUnitSuite { public EventSourcedActorFailureTest() { // FIXME ##24348 silence logging in a proper way - akka.actor.typed.javadsl.Adapter.toUntyped(testKit.system()) + akka.actor.typed.javadsl.Adapter.toClassic(testKit.system()) .eventStream() .publish( new TestEvent.Mute( @@ -107,7 +105,7 @@ public class EventSourcedActorFailureTest extends JUnitSuite { new EventFilter[] { EventFilter.warning(null, null, "No default snapshot store", null, 1) }))); - akka.actor.typed.javadsl.Adapter.toUntyped(testKit.system()) + akka.actor.typed.javadsl.Adapter.toClassic(testKit.system()) .eventStream() .publish( new TestEvent.Mute( diff --git a/akka-persistence-typed/src/test/java/akka/persistence/typed/javadsl/LoggerSourceTest.java b/akka-persistence-typed/src/test/java/akka/persistence/typed/javadsl/LoggerSourceTest.java index 8acd26487c..8ceb5db24c 100644 --- a/akka-persistence-typed/src/test/java/akka/persistence/typed/javadsl/LoggerSourceTest.java +++ b/akka-persistence-typed/src/test/java/akka/persistence/typed/javadsl/LoggerSourceTest.java @@ -96,7 +96,7 @@ public class LoggerSourceTest extends JUnitSuite { public LoggerSourceTest() { // FIXME ##24348 silence logging in a proper way - akka.actor.typed.javadsl.Adapter.toUntyped(testKit.system()) + akka.actor.typed.javadsl.Adapter.toClassic(testKit.system()) .eventStream() .publish( new TestEvent.Mute( diff --git a/akka-persistence-typed/src/test/java/akka/persistence/typed/javadsl/PersistentActorJavaDslTest.java b/akka-persistence-typed/src/test/java/akka/persistence/typed/javadsl/PersistentActorJavaDslTest.java index e21d032eb1..9e37112b5e 100644 --- a/akka-persistence-typed/src/test/java/akka/persistence/typed/javadsl/PersistentActorJavaDslTest.java +++ b/akka-persistence-typed/src/test/java/akka/persistence/typed/javadsl/PersistentActorJavaDslTest.java @@ -51,11 +51,11 @@ public class PersistentActorJavaDslTest extends JUnitSuite { @ClassRule public static final TestKitJunitResource testKit = new TestKitJunitResource(config); private LeveldbReadJournal queries = - PersistenceQuery.get(Adapter.toUntyped(testKit.system())) + PersistenceQuery.get(Adapter.toClassic(testKit.system())) .getReadJournalFor(LeveldbReadJournal.class, LeveldbReadJournal.Identifier()); private ActorMaterializer materializer = - ActorMaterializer.create(Adapter.toUntyped(testKit.system())); + ActorMaterializer.create(Adapter.toClassic(testKit.system())); interface Command extends CborSerializable {} @@ -703,7 +703,7 @@ public class PersistentActorJavaDslTest extends JUnitSuite { probe.expectMessage("started!"); // workaround for #26256 - new EventFilter(Logging.Error.class, Adapter.toUntyped(testKit.system())) + new EventFilter(Logging.Error.class, Adapter.toClassic(testKit.system())) .occurrences(1) // the error messages slightly changed in later JDKs .matches("(class )?java.lang.Integer cannot be cast to (class )?java.lang.String.*") diff --git a/akka-persistence-typed/src/test/scala/akka/persistence/typed/ManyRecoveriesSpec.scala b/akka-persistence-typed/src/test/scala/akka/persistence/typed/ManyRecoveriesSpec.scala index 8802a0b21f..00cdc92b59 100644 --- a/akka-persistence-typed/src/test/scala/akka/persistence/typed/ManyRecoveriesSpec.scala +++ b/akka-persistence-typed/src/test/scala/akka/persistence/typed/ManyRecoveriesSpec.scala @@ -65,7 +65,7 @@ class ManyRecoveriesSpec extends ScalaTestWithActorTestKit(s""" import ManyRecoveriesSpec._ import akka.actor.typed.scaladsl.adapter._ - system.toUntyped.eventStream.publish(Mute(EventFilter.warning(start = "No default snapshot store", occurrences = 1))) + system.toClassic.eventStream.publish(Mute(EventFilter.warning(start = "No default snapshot store", occurrences = 1))) "Many persistent actors" must { "be able to recover without overloading" in { @@ -77,7 +77,7 @@ class ManyRecoveriesSpec extends ScalaTestWithActorTestKit(s""" } // this would starve (block) all threads without max-concurrent-recoveries - val latch = TestLatch()(system.toUntyped) + val latch = TestLatch()(system.toClassic) (1 to 100).foreach { n => spawn(persistentBehavior(s"a$n", probe, Some(latch))) ! Cmd("B") } diff --git a/akka-persistence-typed/src/test/scala/akka/persistence/typed/internal/RecoveryPermitterSpec.scala b/akka-persistence-typed/src/test/scala/akka/persistence/typed/internal/RecoveryPermitterSpec.scala index 0997fb42d1..f915ee364f 100644 --- a/akka-persistence-typed/src/test/scala/akka/persistence/typed/internal/RecoveryPermitterSpec.scala +++ b/akka-persistence-typed/src/test/scala/akka/persistence/typed/internal/RecoveryPermitterSpec.scala @@ -77,14 +77,14 @@ class RecoveryPermitterSpec extends ScalaTestWithActorTestKit(s""" import RecoveryPermitterSpec._ - implicit val untypedSystem = system.toUntyped + implicit val classicSystem = system.toClassic - untypedSystem.eventStream.publish(Mute(EventFilter.warning(start = "No default snapshot store", occurrences = 1))) + classicSystem.eventStream.publish(Mute(EventFilter.warning(start = "No default snapshot store", occurrences = 1))) - private val permitter = Persistence(untypedSystem).recoveryPermitter + private val permitter = Persistence(classicSystem).recoveryPermitter def requestPermit(p: TestProbe[Any]): Unit = { - permitter.tell(RequestRecoveryPermit, p.ref.toUntyped) + permitter.tell(RequestRecoveryPermit, p.ref.toClassic) p.expectMessage(RecoveryPermitGranted) } @@ -100,21 +100,21 @@ class RecoveryPermitterSpec extends ScalaTestWithActorTestKit(s""" requestPermit(p2) requestPermit(p3) - permitter.tell(RequestRecoveryPermit, p4.ref.toUntyped) - permitter.tell(RequestRecoveryPermit, p5.ref.toUntyped) + permitter.tell(RequestRecoveryPermit, p4.ref.toClassic) + permitter.tell(RequestRecoveryPermit, p5.ref.toClassic) p4.expectNoMessage(100.millis) p5.expectNoMessage(10.millis) - permitter.tell(ReturnRecoveryPermit, p2.ref.toUntyped) + permitter.tell(ReturnRecoveryPermit, p2.ref.toClassic) p4.expectMessage(RecoveryPermitGranted) p5.expectNoMessage(100.millis) - permitter.tell(ReturnRecoveryPermit, p1.ref.toUntyped) + permitter.tell(ReturnRecoveryPermit, p1.ref.toClassic) p5.expectMessage(RecoveryPermitGranted) - permitter.tell(ReturnRecoveryPermit, p3.ref.toUntyped) - permitter.tell(ReturnRecoveryPermit, p4.ref.toUntyped) - permitter.tell(ReturnRecoveryPermit, p5.ref.toUntyped) + permitter.tell(ReturnRecoveryPermit, p3.ref.toClassic) + permitter.tell(ReturnRecoveryPermit, p4.ref.toClassic) + permitter.tell(ReturnRecoveryPermit, p5.ref.toClassic) } "grant recovery when all permits not used" in { @@ -122,7 +122,7 @@ class RecoveryPermitterSpec extends ScalaTestWithActorTestKit(s""" spawn(persistentBehavior("p2", p2, p2)) p2.expectMessage(Recovered) - permitter.tell(ReturnRecoveryPermit, p1.ref.toUntyped) + permitter.tell(ReturnRecoveryPermit, p1.ref.toClassic) } "delay recovery when all permits used" in { @@ -134,12 +134,12 @@ class RecoveryPermitterSpec extends ScalaTestWithActorTestKit(s""" persistentActor ! StopActor p4.expectNoMessage(200.millis) - permitter.tell(ReturnRecoveryPermit, p3.ref.toUntyped) + permitter.tell(ReturnRecoveryPermit, p3.ref.toClassic) p4.expectMessage(Recovered) p4.expectTerminated(persistentActor, 1.second) - permitter.tell(ReturnRecoveryPermit, p1.ref.toUntyped) - permitter.tell(ReturnRecoveryPermit, p2.ref.toUntyped) + permitter.tell(ReturnRecoveryPermit, p1.ref.toClassic) + permitter.tell(ReturnRecoveryPermit, p2.ref.toClassic) } "return permit when actor is pre-maturely terminated before holding permit" in { @@ -150,40 +150,40 @@ class RecoveryPermitterSpec extends ScalaTestWithActorTestKit(s""" val persistentActor = spawn(persistentBehavior("p4", p4, p4)) p4.expectNoMessage(100.millis) - permitter.tell(RequestRecoveryPermit, p5.ref.toUntyped) + permitter.tell(RequestRecoveryPermit, p5.ref.toClassic) p5.expectNoMessage(100.millis) // PoisonPill is not stashed - persistentActor.toUntyped ! PoisonPill + persistentActor.toClassic ! PoisonPill // persistentActor didn't hold a permit so still p5.expectNoMessage(100.millis) - permitter.tell(ReturnRecoveryPermit, p1.ref.toUntyped) + permitter.tell(ReturnRecoveryPermit, p1.ref.toClassic) p5.expectMessage(RecoveryPermitGranted) - permitter.tell(ReturnRecoveryPermit, p2.ref.toUntyped) - permitter.tell(ReturnRecoveryPermit, p3.ref.toUntyped) - permitter.tell(ReturnRecoveryPermit, p5.ref.toUntyped) + permitter.tell(ReturnRecoveryPermit, p2.ref.toClassic) + permitter.tell(ReturnRecoveryPermit, p3.ref.toClassic) + permitter.tell(ReturnRecoveryPermit, p5.ref.toClassic) } "return permit when actor is pre-maturely terminated when holding permit" in { val actor = spawn(forwardingBehavior(p1)) - permitter.tell(RequestRecoveryPermit, actor.toUntyped) + permitter.tell(RequestRecoveryPermit, actor.toClassic) p1.expectMessage(RecoveryPermitGranted) requestPermit(p2) requestPermit(p3) - permitter.tell(RequestRecoveryPermit, p4.ref.toUntyped) + permitter.tell(RequestRecoveryPermit, p4.ref.toClassic) p4.expectNoMessage(100.millis) - actor.toUntyped ! PoisonPill + actor.toClassic ! PoisonPill p4.expectMessage(RecoveryPermitGranted) - permitter.tell(ReturnRecoveryPermit, p2.ref.toUntyped) - permitter.tell(ReturnRecoveryPermit, p3.ref.toUntyped) - permitter.tell(ReturnRecoveryPermit, p4.ref.toUntyped) + permitter.tell(ReturnRecoveryPermit, p2.ref.toClassic) + permitter.tell(ReturnRecoveryPermit, p3.ref.toClassic) + permitter.tell(ReturnRecoveryPermit, p4.ref.toClassic) } "return permit when actor throws from RecoveryCompleted" in { @@ -215,9 +215,9 @@ class RecoveryPermitterSpec extends ScalaTestWithActorTestKit(s""" requestPermit(p4) - permitter.tell(ReturnRecoveryPermit, p1.ref.toUntyped) - permitter.tell(ReturnRecoveryPermit, p2.ref.toUntyped) - permitter.tell(ReturnRecoveryPermit, p4.ref.toUntyped) + permitter.tell(ReturnRecoveryPermit, p1.ref.toClassic) + permitter.tell(ReturnRecoveryPermit, p2.ref.toClassic) + permitter.tell(ReturnRecoveryPermit, p4.ref.toClassic) } } } diff --git a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorFailureSpec.scala b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorFailureSpec.scala index e520cd6bc7..c593e9690d 100644 --- a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorFailureSpec.scala +++ b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorFailureSpec.scala @@ -89,10 +89,10 @@ class EventSourcedBehaviorFailureSpec implicit val testSettings: TestKitSettings = TestKitSettings(system) - // Needed for the untyped event filter - implicit val untyped = system.toUntyped + // Needed for the classic event filter + implicit val classic = system.toClassic - untyped.eventStream.publish(Mute(EventFilter.warning(start = "No default snapshot store", occurrences = 1))) + classic.eventStream.publish(Mute(EventFilter.warning(start = "No default snapshot store", occurrences = 1))) def failingPersistentActor( pid: PersistenceId, @@ -303,7 +303,7 @@ class EventSourcedBehaviorFailureSpec }) val c = spawn(behav) probe.expectMessage("starting") - c.toUntyped ! SomeSignal + c.toClassic ! SomeSignal probe.expectMessage("stopped") } } diff --git a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorInterceptorSpec.scala b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorInterceptorSpec.scala index f7a95b4b14..2bcaa41512 100644 --- a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorInterceptorSpec.scala +++ b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorInterceptorSpec.scala @@ -55,10 +55,10 @@ class EventSourcedBehaviorInterceptorSpec private def nextPid(): PersistenceId = PersistenceId(s"c${pidCounter.incrementAndGet()})") import akka.actor.typed.scaladsl.adapter._ - // needed for the untyped event filter - private implicit val untypedSystem: akka.actor.ActorSystem = system.toUntyped + // needed for the classic event filter + private implicit val classicSystem: akka.actor.ActorSystem = system.toClassic - untypedSystem.eventStream.publish(Mute(EventFilter.warning(start = "No default snapshot store", occurrences = 1))) + classicSystem.eventStream.publish(Mute(EventFilter.warning(start = "No default snapshot store", occurrences = 1))) "EventSourcedBehavior interceptor" must { diff --git a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorRecoveryTimeoutSpec.scala b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorRecoveryTimeoutSpec.scala index 25e110db92..afe397a90f 100644 --- a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorRecoveryTimeoutSpec.scala +++ b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorRecoveryTimeoutSpec.scala @@ -63,9 +63,9 @@ class EventSourcedBehaviorRecoveryTimeoutSpec import akka.actor.typed.scaladsl.adapter._ // needed for SteppingInmemJournal.step - private implicit val untypedSystem: akka.actor.ActorSystem = system.toUntyped + private implicit val classicSystem: akka.actor.ActorSystem = system.toClassic - untypedSystem.eventStream.publish(Mute(EventFilter.warning(start = "No default snapshot store", occurrences = 1))) + classicSystem.eventStream.publish(Mute(EventFilter.warning(start = "No default snapshot store", occurrences = 1))) "The recovery timeout" must { diff --git a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorRetentionSpec.scala b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorRetentionSpec.scala index 902e08bede..3b1691d125 100644 --- a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorRetentionSpec.scala +++ b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorRetentionSpec.scala @@ -152,8 +152,8 @@ class EventSourcedBehaviorRetentionSpec import EventSourcedBehaviorRetentionSpec._ import akka.actor.typed.scaladsl.adapter._ - // needed for the untyped event filter - implicit val actorSystem = system.toUntyped + // needed for the classic event filter + implicit val actorSystem = system.toClassic val pidCounter = new AtomicInteger(0) private def nextPid(): PersistenceId = PersistenceId(s"c${pidCounter.incrementAndGet()})") diff --git a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorSpec.scala b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorSpec.scala index 69ff82a49e..7638396dc5 100644 --- a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorSpec.scala +++ b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorSpec.scala @@ -38,8 +38,8 @@ import akka.persistence.typed.RecoveryCompleted import akka.persistence.typed.SnapshotCompleted import akka.persistence.typed.SnapshotFailed import akka.persistence.typed.SnapshotMetadata -import akka.persistence.{ SnapshotMetadata => UntypedSnapshotMetadata } -import akka.persistence.{ SnapshotSelectionCriteria => UntypedSnapshotSelectionCriteria } +import akka.persistence.{ SnapshotMetadata => ClassicSnapshotMetadata } +import akka.persistence.{ SnapshotSelectionCriteria => ClassicSnapshotSelectionCriteria } import akka.serialization.jackson.CborSerializable import akka.stream.ActorMaterializer import akka.stream.scaladsl.Sink @@ -53,25 +53,25 @@ object EventSourcedBehaviorSpec { class SlowInMemorySnapshotStore extends SnapshotStore { - private var state = Map.empty[String, (Any, UntypedSnapshotMetadata)] + private var state = Map.empty[String, (Any, ClassicSnapshotMetadata)] override def loadAsync( persistenceId: String, - criteria: UntypedSnapshotSelectionCriteria): Future[Option[SelectedSnapshot]] = { + criteria: ClassicSnapshotSelectionCriteria): Future[Option[SelectedSnapshot]] = { Promise().future // never completed } - override def saveAsync(metadata: UntypedSnapshotMetadata, snapshot: Any): Future[Unit] = { + override def saveAsync(metadata: ClassicSnapshotMetadata, snapshot: Any): Future[Unit] = { state = state.updated(metadata.persistenceId, (snapshot, metadata)) Future.successful(()) } - override def deleteAsync(metadata: UntypedSnapshotMetadata): Future[Unit] = { + override def deleteAsync(metadata: ClassicSnapshotMetadata): Future[Unit] = { state = state.filterNot { case (k, (_, b)) => k == metadata.persistenceId && b.sequenceNr == metadata.sequenceNr } Future.successful(()) } - override def deleteAsync(persistenceId: String, criteria: UntypedSnapshotSelectionCriteria): Future[Unit] = { + override def deleteAsync(persistenceId: String, criteria: ClassicSnapshotSelectionCriteria): Future[Unit] = { val range = criteria.minSequenceNr to criteria.maxSequenceNr state = state.filterNot { case (k, (_, b)) => k == persistenceId && range.contains(b.sequenceNr) } Future.successful(()) @@ -289,12 +289,12 @@ class EventSourcedBehaviorSpec extends ScalaTestWithActorTestKit(EventSourcedBeh import EventSourcedBehaviorSpec._ import akka.actor.typed.scaladsl.adapter._ - implicit val materializer = ActorMaterializer()(system.toUntyped) + implicit val materializer = ActorMaterializer()(system.toClassic) val queries: LeveldbReadJournal = - PersistenceQuery(system.toUntyped).readJournalFor[LeveldbReadJournal](LeveldbReadJournal.Identifier) + PersistenceQuery(system.toClassic).readJournalFor[LeveldbReadJournal](LeveldbReadJournal.Identifier) - // needed for the untyped event filter - implicit val actorSystem = system.toUntyped + // needed for the classic event filter + implicit val actorSystem = system.toClassic val pidCounter = new AtomicInteger(0) private def nextPid(): PersistenceId = PersistenceId(s"c${pidCounter.incrementAndGet()})") @@ -579,7 +579,7 @@ class EventSourcedBehaviorSpec extends ScalaTestWithActorTestKit(EventSourcedBeh val ref = testkit2.spawn(Behaviors.setup[Command](counter(_, nextPid()))) val probe = testkit2.createTestProbe() probe.expectTerminated(ref) - }(testkit2.system.toUntyped) + }(testkit2.system.toClassic) } finally { testkit2.shutdownTestKit() } @@ -599,7 +599,7 @@ class EventSourcedBehaviorSpec extends ScalaTestWithActorTestKit(EventSourcedBeh val ref = testkit2.spawn(Behaviors.setup[Command](counter(_, nextPid()).withJournalPluginId("missing"))) val probe = testkit2.createTestProbe() probe.expectTerminated(ref) - }(testkit2.system.toUntyped) + }(testkit2.system.toClassic) } finally { testkit2.shutdownTestKit() } @@ -623,7 +623,7 @@ class EventSourcedBehaviorSpec extends ScalaTestWithActorTestKit(EventSourcedBeh // verify that it's not terminated ref ! GetValue(probe.ref) probe.expectMessage(State(0, Vector.empty)) - }(testkit2.system.toUntyped) + }(testkit2.system.toClassic) } finally { testkit2.shutdownTestKit() } @@ -645,7 +645,7 @@ class EventSourcedBehaviorSpec extends ScalaTestWithActorTestKit(EventSourcedBeh val ref = testkit2.spawn(Behaviors.setup[Command](counter(_, nextPid()).withSnapshotPluginId("missing"))) val probe = testkit2.createTestProbe() probe.expectTerminated(ref) - }(testkit2.system.toUntyped) + }(testkit2.system.toClassic) } finally { testkit2.shutdownTestKit() } diff --git a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorStashSpec.scala b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorStashSpec.scala index 6265cd9668..bbc3c6aa01 100644 --- a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorStashSpec.scala +++ b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorStashSpec.scala @@ -175,10 +175,10 @@ class EventSourcedBehaviorStashSpec val pidCounter = new AtomicInteger(0) private def nextPid(): PersistenceId = PersistenceId(s"c${pidCounter.incrementAndGet()})") - // Needed for the untyped event filter - implicit val untyped = system.toUntyped + // Needed for the classic event filter + implicit val classic = system.toClassic - untyped.eventStream.publish(Mute(EventFilter.warning(start = "No default snapshot store", occurrences = 1))) + classic.eventStream.publish(Mute(EventFilter.warning(start = "No default snapshot store", occurrences = 1))) "A typed persistent actor that is stashing commands" must { @@ -504,7 +504,7 @@ class EventSourcedBehaviorStashSpec "discard when stash has reached limit with default dropped setting" in { val probe = TestProbe[AnyRef]() - system.toUntyped.eventStream.subscribe(probe.ref.toUntyped, classOf[Dropped]) + system.toClassic.eventStream.subscribe(probe.ref.toClassic, classOf[Dropped]) val behavior = Behaviors.setup[String] { context => EventSourcedBehavior[String, String, Boolean]( persistenceId = PersistenceId("stash-is-full-drop"), @@ -572,7 +572,7 @@ class EventSourcedBehaviorStashSpec ConfigFactory .parseString("akka.persistence.typed.stash-overflow-strategy=fail") .withFallback(EventSourcedBehaviorStashSpec.conf)) - failStashTestKit.system.toUntyped.eventStream + failStashTestKit.system.toClassic.eventStream .publish(Mute(EventFilter.warning(start = "No default snapshot store", occurrences = 1))) try { val probe = failStashTestKit.createTestProbe[AnyRef]() @@ -597,7 +597,7 @@ class EventSourcedBehaviorStashSpec c ! s"cmd-$n" // limit triggers overflow } probe.expectTerminated(c, 10.seconds) - }(failStashTestKit.system.toUntyped) + }(failStashTestKit.system.toClassic) } finally { failStashTestKit.shutdownTestKit() } @@ -617,7 +617,7 @@ class EventSourcedBehaviorStashSpec c ! Increment("3", ackProbe.ref) c ! Increment("4", ackProbe.ref) - c.toUntyped ! PoisonPill + c.toClassic ! PoisonPill ackProbe.expectTerminated(c) } @@ -638,7 +638,7 @@ class EventSourcedBehaviorStashSpec EventFilter.warning(start = "unhandled message", occurrences = 1).intercept { // start unstashing c ! Activate("5", ackProbe.ref) - c.toUntyped ! PoisonPill + c.toClassic ! PoisonPill // 6 shouldn't make it, already stopped c ! Increment("6", ackProbe.ref) @@ -667,21 +667,21 @@ class EventSourcedBehaviorStashSpec ackProbe.expectMessage(Ack("3")) // silence some dead letters that may, or may not, occur depending on timing - system.toUntyped.eventStream.publish(Mute(EventFilter.warning(start = "unhandled message", occurrences = 100))) - system.toUntyped.eventStream.publish(Mute(EventFilter.warning(start = "received dead letter", occurrences = 100))) - system.toUntyped.eventStream.publish(Mute(EventFilter.info(pattern = ".*was not delivered.*", occurrences = 100))) + system.toClassic.eventStream.publish(Mute(EventFilter.warning(start = "unhandled message", occurrences = 100))) + system.toClassic.eventStream.publish(Mute(EventFilter.warning(start = "received dead letter", occurrences = 100))) + system.toClassic.eventStream.publish(Mute(EventFilter.info(pattern = ".*was not delivered.*", occurrences = 100))) val signalProbe = TestProbe[String] val c2 = spawn(counter(pid, Some(signalProbe.ref))) // this PoisonPill will most likely be received in RequestingRecoveryPermit since it's sent immediately - c2.toUntyped ! PoisonPill + c2.toClassic ! PoisonPill signalProbe.expectMessage("RecoveryCompleted-3") signalProbe.expectMessage("PostStop") val c3 = spawn(counter(pid, Some(signalProbe.ref))) // this PoisonPill will most likely be received in RequestingRecoveryPermit since it's sent slightly afterwards Thread.sleep(1) - c3.toUntyped ! PoisonPill + c3.toClassic ! PoisonPill c3 ! Increment("4", ackProbe.ref) signalProbe.expectMessage("RecoveryCompleted-3") signalProbe.expectMessage("PostStop") @@ -690,7 +690,7 @@ class EventSourcedBehaviorStashSpec val c4 = spawn(counter(pid, Some(signalProbe.ref))) signalProbe.expectMessage("RecoveryCompleted-3") // this PoisonPill will be received in Running - c4.toUntyped ! PoisonPill + c4.toClassic ! PoisonPill c4 ! Increment("4", ackProbe.ref) signalProbe.expectMessage("PostStop") ackProbe.expectNoMessage(20.millis) @@ -700,7 +700,7 @@ class EventSourcedBehaviorStashSpec c5 ! Increment("4", ackProbe.ref) c5 ! Increment("5", ackProbe.ref) // this PoisonPill will most likely be received in PersistingEvents - c5.toUntyped ! PoisonPill + c5.toClassic ! PoisonPill c5 ! Increment("6", ackProbe.ref) ackProbe.expectMessage(Ack("4")) ackProbe.expectMessage(Ack("5")) diff --git a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorTimersSpec.scala b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorTimersSpec.scala index b45ee2e3b5..d83be80e36 100644 --- a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorTimersSpec.scala +++ b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorTimersSpec.scala @@ -85,10 +85,10 @@ class EventSourcedBehaviorTimersSpec private def nextPid(): PersistenceId = PersistenceId(s"c${pidCounter.incrementAndGet()})") import akka.actor.typed.scaladsl.adapter._ - // needed for the untyped event filter - private implicit val untypedSystem: akka.actor.ActorSystem = system.toUntyped + // needed for the classic event filter + private implicit val classicSystem: akka.actor.ActorSystem = system.toClassic - untypedSystem.eventStream.publish(Mute(EventFilter.warning(start = "No default snapshot store", occurrences = 1))) + classicSystem.eventStream.publish(Mute(EventFilter.warning(start = "No default snapshot store", occurrences = 1))) "EventSourcedBehavior withTimers" must { diff --git a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedEventAdapterSpec.scala b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedEventAdapterSpec.scala index 474633e06a..11a854898b 100644 --- a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedEventAdapterSpec.scala +++ b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedEventAdapterSpec.scala @@ -99,14 +99,14 @@ class EventSourcedEventAdapterSpec } import akka.actor.typed.scaladsl.adapter._ - system.toUntyped.eventStream.publish(Mute(EventFilter.warning(start = "No default snapshot store", occurrences = 1))) + system.toClassic.eventStream.publish(Mute(EventFilter.warning(start = "No default snapshot store", occurrences = 1))) val pidCounter = new AtomicInteger(0) private def nextPid(): PersistenceId = PersistenceId(s"c${pidCounter.incrementAndGet()})") - implicit val materializer = ActorMaterializer()(system.toUntyped) + implicit val materializer = ActorMaterializer()(system.toClassic) val queries: LeveldbReadJournal = - PersistenceQuery(system.toUntyped).readJournalFor[LeveldbReadJournal](LeveldbReadJournal.Identifier) + PersistenceQuery(system.toClassic).readJournalFor[LeveldbReadJournal](LeveldbReadJournal.Identifier) private def behavior(pid: PersistenceId, probe: ActorRef[String]): EventSourcedBehavior[String, String, String] = EventSourcedBehavior(pid, "", commandHandler = { (_, command) => diff --git a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedSequenceNumberSpec.scala b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedSequenceNumberSpec.scala index 3499dcec23..0e2f031e4d 100644 --- a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedSequenceNumberSpec.scala +++ b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedSequenceNumberSpec.scala @@ -29,7 +29,7 @@ class EventSourcedSequenceNumberSpec with WordSpecLike { import akka.actor.typed.scaladsl.adapter._ - system.toUntyped.eventStream.publish(Mute(EventFilter.warning(start = "No default snapshot store", occurrences = 1))) + system.toClassic.eventStream.publish(Mute(EventFilter.warning(start = "No default snapshot store", occurrences = 1))) private def behavior(pid: PersistenceId, probe: ActorRef[String]): Behavior[String] = Behaviors.setup(ctx => diff --git a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedSnapshotAdapterSpec.scala b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedSnapshotAdapterSpec.scala index bbb452360d..200fbd12a5 100644 --- a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedSnapshotAdapterSpec.scala +++ b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedSnapshotAdapterSpec.scala @@ -38,9 +38,9 @@ class EventSourcedSnapshotAdapterSpec val pidCounter = new AtomicInteger(0) private def nextPid(): PersistenceId = PersistenceId(s"c${pidCounter.incrementAndGet()})") - implicit val materializer = ActorMaterializer()(system.toUntyped) + implicit val materializer = ActorMaterializer()(system.toClassic) val queries: LeveldbReadJournal = - PersistenceQuery(system.toUntyped).readJournalFor[LeveldbReadJournal](LeveldbReadJournal.Identifier) + PersistenceQuery(system.toClassic).readJournalFor[LeveldbReadJournal](LeveldbReadJournal.Identifier) private def behavior(pid: PersistenceId, probe: ActorRef[State]): EventSourcedBehavior[Command, Event, State] = EventSourcedBehavior[Command, Event, State]( diff --git a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/LoggerSourceSpec.scala b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/LoggerSourceSpec.scala index b5839608c9..34796705cb 100644 --- a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/LoggerSourceSpec.scala +++ b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/LoggerSourceSpec.scala @@ -27,7 +27,7 @@ class LoggerSourceSpec .withFallback(EventSourcedBehaviorSpec.conf)) with WordSpecLike { - implicit val untyped = system.toUntyped // FIXME #24348: eventfilter support in typed testkit + implicit val classic = system.toClassic // FIXME #24348: eventfilter support in testkit private val pidCounter = new AtomicInteger(0) private def nextPid(): PersistenceId = PersistenceId(s"c${pidCounter.incrementAndGet()})") diff --git a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/NullEmptyStateSpec.scala b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/NullEmptyStateSpec.scala index 7f5340c458..e7d5e00faf 100644 --- a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/NullEmptyStateSpec.scala +++ b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/NullEmptyStateSpec.scala @@ -29,7 +29,7 @@ class NullEmptyStateSpec extends ScalaTestWithActorTestKit(NullEmptyStateSpec.co implicit val testSettings = TestKitSettings(system) import akka.actor.typed.scaladsl.adapter._ - system.toUntyped.eventStream.publish(Mute(EventFilter.warning(start = "No default snapshot store", occurrences = 1))) + system.toClassic.eventStream.publish(Mute(EventFilter.warning(start = "No default snapshot store", occurrences = 1))) def primitiveState(persistenceId: PersistenceId, probe: ActorRef[String]): Behavior[String] = EventSourcedBehavior[String, String, String]( diff --git a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/OptionalSnapshotStoreSpec.scala b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/OptionalSnapshotStoreSpec.scala index ff6fbffc25..26932df94c 100644 --- a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/OptionalSnapshotStoreSpec.scala +++ b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/OptionalSnapshotStoreSpec.scala @@ -53,8 +53,8 @@ class OptionalSnapshotStoreSpec extends ScalaTestWithActorTestKit(s""" import OptionalSnapshotStoreSpec._ - // Needed for the untyped event filter - implicit val untyped = system.toUntyped + // Needed for the classic event filter + implicit val classic = system.toClassic "Persistence extension" must { "initialize properly even in absence of configured snapshot store" in { diff --git a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/PrimitiveStateSpec.scala b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/PrimitiveStateSpec.scala index c6c0dc06cc..ac18b6a923 100644 --- a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/PrimitiveStateSpec.scala +++ b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/PrimitiveStateSpec.scala @@ -26,7 +26,7 @@ object PrimitiveStateSpec { class PrimitiveStateSpec extends ScalaTestWithActorTestKit(PrimitiveStateSpec.conf) with WordSpecLike { import akka.actor.typed.scaladsl.adapter._ - system.toUntyped.eventStream.publish(Mute(EventFilter.warning(start = "No default snapshot store", occurrences = 1))) + system.toClassic.eventStream.publish(Mute(EventFilter.warning(start = "No default snapshot store", occurrences = 1))) def primitiveState(persistenceId: PersistenceId, probe: ActorRef[String]): Behavior[Int] = EventSourcedBehavior[Int, Int, Int]( diff --git a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/SnapshotMutableStateSpec.scala b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/SnapshotMutableStateSpec.scala index c05c22fa98..9c0039cd25 100644 --- a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/SnapshotMutableStateSpec.scala +++ b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/SnapshotMutableStateSpec.scala @@ -17,8 +17,8 @@ import akka.persistence.snapshot.SnapshotStore import akka.persistence.typed.PersistenceId import akka.persistence.typed.SnapshotCompleted import akka.persistence.typed.SnapshotFailed -import akka.persistence.{ SnapshotSelectionCriteria => UntypedSnapshotSelectionCriteria } -import akka.persistence.{ SnapshotMetadata => UntypedSnapshotMetadata } +import akka.persistence.{ SnapshotSelectionCriteria => ClassicSnapshotSelectionCriteria } +import akka.persistence.{ SnapshotMetadata => ClassicSnapshotMetadata } import akka.serialization.jackson.CborSerializable import com.typesafe.config.Config import com.typesafe.config.ConfigFactory @@ -28,17 +28,17 @@ object SnapshotMutableStateSpec { class SlowInMemorySnapshotStore extends SnapshotStore { - private var state = Map.empty[String, (Any, UntypedSnapshotMetadata)] + private var state = Map.empty[String, (Any, ClassicSnapshotMetadata)] def loadAsync( persistenceId: String, - criteria: UntypedSnapshotSelectionCriteria): Future[Option[SelectedSnapshot]] = { + criteria: ClassicSnapshotSelectionCriteria): Future[Option[SelectedSnapshot]] = { Future.successful(state.get(persistenceId).map { case (snap, meta) => SelectedSnapshot(meta, snap) }) } - def saveAsync(metadata: UntypedSnapshotMetadata, snapshot: Any): Future[Unit] = { + def saveAsync(metadata: ClassicSnapshotMetadata, snapshot: Any): Future[Unit] = { val snapshotState = snapshot.asInstanceOf[MutableState] val value1 = snapshotState.value Thread.sleep(50) @@ -53,14 +53,14 @@ object SnapshotMutableStateSpec { } } - override def deleteAsync(metadata: UntypedSnapshotMetadata): Future[Unit] = { + override def deleteAsync(metadata: ClassicSnapshotMetadata): Future[Unit] = { state = state.filterNot { case (pid, (_, meta)) => pid == metadata.persistenceId && meta.sequenceNr == metadata.sequenceNr } Future.successful(()) } - override def deleteAsync(persistenceId: String, criteria: UntypedSnapshotSelectionCriteria): Future[Unit] = { + override def deleteAsync(persistenceId: String, criteria: ClassicSnapshotSelectionCriteria): Future[Unit] = { state = state.filterNot { case (pid, (_, meta)) => pid == persistenceId && criteria.matches(meta) } diff --git a/akka-persistence-typed/src/test/scala/docs/akka/persistence/typed/PersistentFsmToTypedMigrationSpec.scala b/akka-persistence-typed/src/test/scala/docs/akka/persistence/typed/PersistentFsmToTypedMigrationSpec.scala index 935db82106..6ffb2d2b78 100644 --- a/akka-persistence-typed/src/test/scala/docs/akka/persistence/typed/PersistentFsmToTypedMigrationSpec.scala +++ b/akka-persistence-typed/src/test/scala/docs/akka/persistence/typed/PersistentFsmToTypedMigrationSpec.scala @@ -211,30 +211,30 @@ class PersistentFsmToTypedMigrationSpec extends WordSpec with ScalaFutures { "PersistentFSM migration to Persistence Typed" must { "work when snapshot is not current" in { - val untypedActorSystem = akka.actor.ActorSystem("UntypedSystem", PersistentFsmToTypedMigrationSpec.config) + val classicActorSystem = akka.actor.ActorSystem("ClassicSystem", PersistentFsmToTypedMigrationSpec.config) val shirt = Item("1", "Shirt", 59.99f) val shoes = Item("2", "Shoes", 89.99f) val coat = Item("3", "Coat", 119.99f) val pid = "no-snapshot" try { import akka.testkit.TestProbe - val reportActorProbe = TestProbe()(untypedActorSystem) - val untypedProbe = TestProbe()(untypedActorSystem) - implicit val untypedRef = untypedProbe.ref - val fsmRef = untypedActorSystem.actorOf(WebStoreCustomerFSM.props(pid, reportActorProbe.ref)) + val reportActorProbe = TestProbe()(classicActorSystem) + val classicProbe = TestProbe()(classicActorSystem) + implicit val classicRef = classicProbe.ref + val fsmRef = classicActorSystem.actorOf(WebStoreCustomerFSM.props(pid, reportActorProbe.ref)) fsmRef ! AddItem(shirt) fsmRef ! AddItem(shoes) - fsmRef.tell(GetCurrentCart, untypedProbe.ref) - untypedProbe.expectMsg(NonEmptyShoppingCart(List(shirt, shoes))) + fsmRef.tell(GetCurrentCart, classicProbe.ref) + classicProbe.expectMsg(NonEmptyShoppingCart(List(shirt, shoes))) - untypedProbe.watch(fsmRef) + classicProbe.watch(fsmRef) fsmRef ! PoisonPill - untypedProbe.expectTerminated(fsmRef) + classicProbe.expectTerminated(fsmRef) } finally { - untypedActorSystem.terminate().futureValue + classicActorSystem.terminate().futureValue } - val typedTestKit = ActorTestKit("TypedSystem", PersistentFsmToTypedMigrationSpec.config) + val typedTestKit = ActorTestKit("System", PersistentFsmToTypedMigrationSpec.config) try { import typedTestKit._ val typedProbe = akka.actor.testkit.typed.scaladsl.TestProbe[ShoppingCart]() @@ -252,24 +252,24 @@ class PersistentFsmToTypedMigrationSpec extends WordSpec with ScalaFutures { } "work if snapshot is current" in { - val untypedActorSystem = akka.actor.ActorSystem("UntypedSystem", PersistentFsmToTypedMigrationSpec.config) + val classicActorSystem = akka.actor.ActorSystem("CLassicSystem", PersistentFsmToTypedMigrationSpec.config) val shirt = Item("1", "Shirt", 59.99f) val pid = "current-shapshot" try { import akka.testkit.TestProbe - val reportActorProbe = TestProbe()(untypedActorSystem) - val untypedProbe = TestProbe()(untypedActorSystem) - implicit val untypedRef = untypedProbe.ref - val fsmRef = untypedActorSystem.actorOf(WebStoreCustomerFSM.props(pid, reportActorProbe.ref)) - untypedProbe.watch(fsmRef) + val reportActorProbe = TestProbe()(classicActorSystem) + val classicProbe = TestProbe()(classicActorSystem) + implicit val classicRef = classicProbe.ref + val fsmRef = classicActorSystem.actorOf(WebStoreCustomerFSM.props(pid, reportActorProbe.ref)) + classicProbe.watch(fsmRef) fsmRef ! AddItem(shirt) - fsmRef.tell(GetCurrentCart, untypedProbe.ref) - untypedProbe.expectMsg(NonEmptyShoppingCart(Seq(shirt))) + fsmRef.tell(GetCurrentCart, classicProbe.ref) + classicProbe.expectMsg(NonEmptyShoppingCart(Seq(shirt))) fsmRef ! Buy - fsmRef.tell(GetCurrentCart, untypedProbe.ref) - untypedProbe.expectMsg(NonEmptyShoppingCart(Seq(shirt))) + fsmRef.tell(GetCurrentCart, classicProbe.ref) + classicProbe.expectMsg(NonEmptyShoppingCart(Seq(shirt))) } finally { - untypedActorSystem.terminate().futureValue + classicActorSystem.terminate().futureValue } val typedTestKit = ActorTestKit("TypedSystem", PersistentFsmToTypedMigrationSpec.config) diff --git a/akka-stream-typed/src/main/scala/akka/stream/typed/javadsl/ActorMaterializerFactory.scala b/akka-stream-typed/src/main/scala/akka/stream/typed/javadsl/ActorMaterializerFactory.scala index bdc3b3f94c..42b9f1dadc 100644 --- a/akka-stream-typed/src/main/scala/akka/stream/typed/javadsl/ActorMaterializerFactory.scala +++ b/akka-stream-typed/src/main/scala/akka/stream/typed/javadsl/ActorMaterializerFactory.scala @@ -21,7 +21,7 @@ object ActorMaterializerFactory { * The actor names are built up of `namePrefix-flowNumber-flowStepNumber-stepName`. */ def create[T](actorSystem: ActorSystem[T]): akka.stream.ActorMaterializer = - akka.stream.ActorMaterializer.create(actorSystem.toUntyped) + akka.stream.ActorMaterializer.create(actorSystem.toClassic) /** * Creates an `ActorMaterializer` which will execute every step of a transformation @@ -29,7 +29,7 @@ object ActorMaterializerFactory { * will be used to create one actor that in turn creates actors for the transformation steps. */ def create[T](settings: ActorMaterializerSettings, actorSystem: ActorSystem[T]): akka.stream.ActorMaterializer = - akka.stream.ActorMaterializer.create(settings, actorSystem.toUntyped) + akka.stream.ActorMaterializer.create(settings, actorSystem.toClassic) /** * Creates an `ActorMaterializer` which will execute every step of a transformation @@ -45,7 +45,7 @@ object ActorMaterializerFactory { settings: ActorMaterializerSettings, namePrefix: String, actorSystem: ActorSystem[T]): akka.stream.ActorMaterializer = - akka.stream.ActorMaterializer.create(settings, actorSystem.toUntyped, namePrefix) + akka.stream.ActorMaterializer.create(settings, actorSystem.toClassic, namePrefix) /** * Creates an `ActorMaterializer` which will execute every step of a transformation @@ -56,7 +56,7 @@ object ActorMaterializerFactory { * The actor names are built up of `namePrefix-flowNumber-flowStepNumber-stepName`. */ def create[T](ctx: ActorContext[T]): akka.stream.ActorMaterializer = - akka.stream.ActorMaterializer.create(Adapter.toUntyped(ctx)) + akka.stream.ActorMaterializer.create(Adapter.toClassic(ctx)) /** * Creates an `ActorMaterializer` which will execute every step of a transformation @@ -64,7 +64,7 @@ object ActorMaterializerFactory { * will be bound to the lifecycle of the provided [[akka.actor.typed.javadsl.ActorContext]] */ def create[T](settings: ActorMaterializerSettings, ctx: ActorContext[T]): akka.stream.ActorMaterializer = - akka.stream.ActorMaterializer.create(settings, Adapter.toUntyped(ctx)) + akka.stream.ActorMaterializer.create(settings, Adapter.toClassic(ctx)) /** * Creates an `ActorMaterializer` which will execute every step of a transformation @@ -79,5 +79,5 @@ object ActorMaterializerFactory { settings: ActorMaterializerSettings, namePrefix: String, ctx: ActorContext[T]): akka.stream.ActorMaterializer = - akka.stream.ActorMaterializer.create(settings, Adapter.toUntyped(ctx), namePrefix) + akka.stream.ActorMaterializer.create(settings, Adapter.toClassic(ctx), namePrefix) } diff --git a/akka-stream-typed/src/main/scala/akka/stream/typed/scaladsl/ActorFlow.scala b/akka-stream-typed/src/main/scala/akka/stream/typed/scaladsl/ActorFlow.scala index 456afe40d5..e1729cdc63 100644 --- a/akka-stream-typed/src/main/scala/akka/stream/typed/scaladsl/ActorFlow.scala +++ b/akka-stream-typed/src/main/scala/akka/stream/typed/scaladsl/ActorFlow.scala @@ -102,12 +102,12 @@ object ActorFlow { def ask[I, Q, A](parallelism: Int)(ref: ActorRef[Q])(makeMessage: (I, ActorRef[A]) => Q)( implicit timeout: Timeout): Flow[I, A, NotUsed] = { import akka.actor.typed.scaladsl.adapter._ - val untypedRef = ref.toUntyped + val classicRef = ref.toClassic val askFlow = Flow[I] - .watch(untypedRef) + .watch(classicRef) .mapAsync(parallelism) { el => - val res = akka.pattern.extended.ask(untypedRef, (replyTo: akka.actor.ActorRef) => makeMessage(el, replyTo)) + val res = akka.pattern.extended.ask(classicRef, (replyTo: akka.actor.ActorRef) => makeMessage(el, replyTo)) // we need to cast manually (yet safely, by construction!) since otherwise we need a ClassTag, // which in Scala is fine, but then we would force JavaDSL to create one, which is a hassle in the Akka Typed DSL, // since one may say "but I already specified the type!", and that we have to go via the classic ask is an implementation detail diff --git a/akka-stream-typed/src/main/scala/akka/stream/typed/scaladsl/ActorMaterializer.scala b/akka-stream-typed/src/main/scala/akka/stream/typed/scaladsl/ActorMaterializer.scala index 1d42d19b49..cd5326beeb 100644 --- a/akka-stream-typed/src/main/scala/akka/stream/typed/scaladsl/ActorMaterializer.scala +++ b/akka-stream-typed/src/main/scala/akka/stream/typed/scaladsl/ActorMaterializer.scala @@ -25,7 +25,7 @@ object ActorMaterializer { */ def apply[T](materializerSettings: Option[ActorMaterializerSettings] = None, namePrefix: Option[String] = None)( implicit actorSystem: ActorSystem[T]): ActorMaterializer = - akka.stream.ActorMaterializer(materializerSettings, namePrefix)(actorSystem.toUntyped) + akka.stream.ActorMaterializer(materializerSettings, namePrefix)(actorSystem.toClassic) /** * Creates an `ActorMaterializer` which will execute every step of a transformation @@ -43,6 +43,6 @@ object ActorMaterializer { ctx: ActorContext[T], materializerSettings: Option[ActorMaterializerSettings] = None, namePrefix: Option[String] = None): ActorMaterializer = - akka.stream.ActorMaterializer(materializerSettings, namePrefix)(ctx.toUntyped) + akka.stream.ActorMaterializer(materializerSettings, namePrefix)(ctx.toClassic) } diff --git a/akka-stream-typed/src/main/scala/akka/stream/typed/scaladsl/ActorSink.scala b/akka-stream-typed/src/main/scala/akka/stream/typed/scaladsl/ActorSink.scala index 3384e9e5e1..457404c652 100644 --- a/akka-stream-typed/src/main/scala/akka/stream/typed/scaladsl/ActorSink.scala +++ b/akka-stream-typed/src/main/scala/akka/stream/typed/scaladsl/ActorSink.scala @@ -31,7 +31,7 @@ object ActorSink { * limiting stage in front of this `Sink`. */ def actorRef[T](ref: ActorRef[T], onCompleteMessage: T, onFailureMessage: Throwable => T): Sink[T, NotUsed] = - Sink.actorRef(ref.toUntyped, onCompleteMessage, onFailureMessage) + Sink.actorRef(ref.toClassic, onCompleteMessage, onFailureMessage) /** * Sends the elements of the stream to the given `ActorRef` that sends back back-pressure signal. @@ -54,7 +54,7 @@ object ActorSink { onCompleteMessage: M, onFailureMessage: Throwable => M): Sink[T, NotUsed] = Sink.actorRefWithAck( - ref.toUntyped, + ref.toClassic, messageAdapter.curried.compose(actorRefAdapter), onInitMessage.compose(actorRefAdapter), ackMessage, diff --git a/akka-stream-typed/src/main/scala/akka/stream/typed/scaladsl/ActorSource.scala b/akka-stream-typed/src/main/scala/akka/stream/typed/scaladsl/ActorSource.scala index 4d4644c340..d9a667993a 100644 --- a/akka-stream-typed/src/main/scala/akka/stream/typed/scaladsl/ActorSource.scala +++ b/akka-stream-typed/src/main/scala/akka/stream/typed/scaladsl/ActorSource.scala @@ -81,7 +81,7 @@ object ActorSource { failureMatcher: PartialFunction[T, Throwable]): Source[T, ActorRef[T]] = Source .actorRefWithAck[T]( - Some(ackTo.toUntyped), + Some(ackTo.toClassic), ackMessage, completionMatcher.asInstanceOf[PartialFunction[Any, CompletionStrategy]], failureMatcher.asInstanceOf[PartialFunction[Any, Throwable]]) diff --git a/akka-stream-typed/src/test/scala/akka/stream/typed/scaladsl/ActorFlowSpec.scala b/akka-stream-typed/src/test/scala/akka/stream/typed/scaladsl/ActorFlowSpec.scala index 8b409eff45..ec784f86e2 100644 --- a/akka-stream-typed/src/test/scala/akka/stream/typed/scaladsl/ActorFlowSpec.scala +++ b/akka-stream-typed/src/test/scala/akka/stream/typed/scaladsl/ActorFlowSpec.scala @@ -73,7 +73,7 @@ class ActorFlowSpec extends ScalaTestWithActorTestKit with WordSpecLike { import akka.actor.typed.scaladsl.adapter._ val dontReply = spawn(Behaviors.ignore[Asking]) - val c = TestSubscriber.manualProbe[Reply]()(system.toUntyped) + val c = TestSubscriber.manualProbe[Reply]()(system.toClassic) implicit val timeout = akka.util.Timeout(10.millis) Source(1 to 5) diff --git a/akka-stream/src/main/scala/akka/stream/actor/ActorSubscriber.scala b/akka-stream/src/main/scala/akka/stream/actor/ActorSubscriber.scala index a18d421245..e9f981cb44 100644 --- a/akka-stream/src/main/scala/akka/stream/actor/ActorSubscriber.scala +++ b/akka-stream/src/main/scala/akka/stream/actor/ActorSubscriber.scala @@ -148,8 +148,8 @@ abstract class MaxInFlightRequestStrategy(max: Int) extends RequestStrategy { * the same way as any actor. * * Attach the actor as a [[org.reactivestreams.Subscriber]] to the stream with - * Scala API [[ActorSubscriber#apply]], or Java API [[UntypedActorSubscriber#create]] or - * Java API compatible with lambda expressions [[AbstractActorSubscriber#create]]. + * Scala API [[ActorSubscriber#apply]], or Java API [[ClassicActorSubscriber#create]] or + * Java API compatible with lambda expressions [[ClassicActorSubscriber#create]]. * * Subclass must define the [[RequestStrategy]] to control stream back pressure. * After each incoming message the `ActorSubscriber` will automatically invoke diff --git a/akka-stream/src/main/scala/akka/stream/impl/package.scala b/akka-stream/src/main/scala/akka/stream/impl/package.scala index b477c02256..028ad6c090 100644 --- a/akka-stream/src/main/scala/akka/stream/impl/package.scala +++ b/akka-stream/src/main/scala/akka/stream/impl/package.scala @@ -16,7 +16,7 @@ package akka.stream * operators * * The high level DSLs use the [[akka.stream.impl.TraversalBuilder]] classes to build instances of * [[akka.stream.impl.Traversal]] which are the representation of a materializable stream description. These builders - * are immutable and safely shareable. Unlike the top-level DSLs, these are untyped, i.e. elements are treated as + * are immutable and safely shareable. Unlike the top-level DSLs, these are classic, i.e. elements are treated as * Any. * * The [[akka.stream.impl.Traversal]] is the immutable, efficient representation of a stream processing graph that * can be materialized. The builders exists solely for the purpose of producing a traversal in the end. diff --git a/akka-testkit/src/test/scala/akka/testkit/TestEventListenerSpec.scala b/akka-testkit/src/test/scala/akka/testkit/TestEventListenerSpec.scala index 07819866d6..8a41a84a95 100644 --- a/akka-testkit/src/test/scala/akka/testkit/TestEventListenerSpec.scala +++ b/akka-testkit/src/test/scala/akka/testkit/TestEventListenerSpec.scala @@ -10,7 +10,7 @@ import akka.event.Logging.Warning class TestEventListenerSpec extends AkkaSpec with ImplicitSender { - "The untyped EventFilter.error" must { + "The classic EventFilter.error" must { "filter errors without cause" in { val filter = EventFilter.error() filter(errorNoCause) should ===(true) @@ -53,7 +53,7 @@ class TestEventListenerSpec extends AkkaSpec with ImplicitSender { } } - "The untyped EventFilter.warning" must { + "The classic EventFilter.warning" must { "filter warnings without cause" in { val filter = EventFilter.warning() filter(warningNoCause) should ===(true)