actor: allow seamless access to untyped extensions given typed ActorSystem (#28294)

* actor: allow seamless access to untyped extensions given typed ActorSystem

* add overrides with concrete type for Java API everywhere
This commit is contained in:
Johannes Rudolph 2019-12-05 16:01:23 +01:00 committed by Arnout Engelen
parent 2c96a57d89
commit 702b6a7f41
70 changed files with 192 additions and 49 deletions

View file

@ -283,10 +283,9 @@ class EventSourcedBehaviorSpec
with LogCapturing {
import EventSourcedBehaviorSpec._
import akka.actor.typed.scaladsl.adapter._
val queries: LeveldbReadJournal =
PersistenceQuery(system.toClassic).readJournalFor[LeveldbReadJournal](LeveldbReadJournal.Identifier)
PersistenceQuery(system).readJournalFor[LeveldbReadJournal](LeveldbReadJournal.Identifier)
val pidCounter = new AtomicInteger(0)
private def nextPid(): PersistenceId = PersistenceId.ofUniqueId(s"c${pidCounter.incrementAndGet()})")

View file

@ -96,13 +96,11 @@ class EventSourcedEventAdapterSpec
State
}
import akka.actor.typed.scaladsl.adapter._
val pidCounter = new AtomicInteger(0)
private def nextPid(): PersistenceId = PersistenceId.ofUniqueId(s"c${pidCounter.incrementAndGet()})")
val queries: LeveldbReadJournal =
PersistenceQuery(system.toClassic).readJournalFor[LeveldbReadJournal](LeveldbReadJournal.Identifier)
PersistenceQuery(system).readJournalFor[LeveldbReadJournal](LeveldbReadJournal.Identifier)
private def behavior(pid: PersistenceId, probe: ActorRef[String]): EventSourcedBehavior[String, String, String] =
EventSourcedBehavior(pid, "", commandHandler = { (_, command) =>

View file

@ -12,7 +12,6 @@ import akka.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit
import akka.actor.typed.ActorRef
import akka.actor.typed.Behavior
import akka.actor.typed.scaladsl.Behaviors
import akka.actor.typed.scaladsl.adapter._
import akka.persistence.serialization.Snapshot
import akka.persistence.typed.PersistenceId
import akka.serialization.Serialization
@ -64,7 +63,7 @@ class SnapshotRecoveryWithEmptyJournalSpec
val snapshotsDir: File = new File(survivingSnapshotPath)
val serializationExtension: Serialization = SerializationExtension(system.toClassic)
val serializationExtension: Serialization = SerializationExtension(system)
val persistenceId: String = system.name