Separate typed into modules (#24173)

Creates the following modules:

akka.actor.typed
akka.persistence.typed
akka.cluster.typed
akka.cluster.sharding.typed

Differences from untyped:

DData and cluster singleton are inside cluster. DData is in the package akka.cluster.dddata.typed

Refs #23632
This commit is contained in:
Christopher Batey 2017-12-18 14:50:46 +00:00 committed by GitHub
parent d2fd897926
commit f7b3b483a8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
140 changed files with 857 additions and 761 deletions

View file

@ -1,4 +1,4 @@
package akka.typed;
package akka.actor.typed;
import scala.concurrent.ExecutionContext;

View file

@ -1,7 +1,7 @@
/**
* Copyright (C) 2017 Lightbend Inc. <http://www.lightbend.com/>
*/
package akka.typed;
package akka.actor.typed;
import akka.actor.*;
import com.typesafe.config.ConfigFactory;
@ -46,7 +46,7 @@ public class ExtensionsTest extends JUnitSuite {
Behavior.empty(),
"loadJavaExtensionsFromConfig",
Optional.empty(),
Optional.of(ConfigFactory.parseString("akka.typed.extensions += \"akka.typed.ExtensionsTest$MyExtension\"").resolve()),
Optional.of(ConfigFactory.parseString("akka.typed.extensions += \"akka.actor.typed.ExtensionsTest$MyExtension\"").resolve()),
Optional.empty(),
Optional.empty()
);

View file

@ -1,12 +1,12 @@
/**
* Copyright (C) 2017 Lightbend Inc. <http://www.lightbend.com/>
*/
package akka.typed.javadsl;
package akka.actor.typed.javadsl;
import akka.typed.*;
import akka.typed.ActorContext;
import akka.actor.typed.*;
import akka.actor.typed.ActorContext;
import static akka.typed.javadsl.Actor.*;
import static akka.actor.typed.javadsl.Actor.*;
import java.util.concurrent.TimeUnit;
import scala.concurrent.duration.Duration;

View file

@ -2,7 +2,7 @@
* Copyright (C) 2017 Lightbend Inc. <http://www.lightbend.com>
*/
package akka.typed.javadsl;
package akka.actor.typed.javadsl;
import org.junit.ClassRule;
import org.junit.Test;
@ -13,13 +13,13 @@ import java.util.concurrent.TimeUnit;
import akka.actor.ActorSystem;
import akka.testkit.AkkaJUnitActorSystemResource;
import akka.testkit.AkkaSpec;
import akka.typed.ActorRef;
import akka.typed.Behavior;
import akka.typed.Signal;
import akka.typed.Terminated;
import akka.actor.typed.ActorRef;
import akka.actor.typed.Behavior;
import akka.actor.typed.Signal;
import akka.actor.typed.Terminated;
import akka.testkit.javadsl.TestKit;
import akka.actor.SupervisorStrategy;
import static akka.typed.javadsl.Actor.*;
import static akka.actor.typed.javadsl.Actor.*;
public class AdapterTest extends JUnitSuite {

View file

@ -1,19 +1,19 @@
/**
* Copyright (C) 2017 Lightbend Inc. <http://www.lightbend.com>
*/
package akka.typed.javadsl;
package akka.actor.typed.javadsl;
import org.junit.Test;
import org.scalatest.junit.JUnitSuite;
import akka.typed.Behavior;
import akka.typed.Terminated;
import akka.typed.ActorRef;
import akka.actor.typed.Behavior;
import akka.actor.typed.Terminated;
import akka.actor.typed.ActorRef;
import java.util.ArrayList;
import static akka.typed.javadsl.Actor.same;
import static akka.typed.javadsl.Actor.stopped;
import static akka.actor.typed.javadsl.Actor.same;
import static akka.actor.typed.javadsl.Actor.stopped;
/**
* Test creating [[Behavior]]s using [[BehaviorBuilder]]

View file

@ -1,12 +1,12 @@
/**
* Copyright (C) 2017 Lightbend Inc. <http://www.lightbend.com>
*/
package akka.typed.javadsl;
package akka.actor.typed.javadsl;
import org.junit.Test;
import org.scalatest.junit.JUnitSuite;
import akka.typed.Behavior;
import akka.actor.typed.Behavior;
import static org.junit.Assert.assertEquals;

View file

@ -1,7 +1,7 @@
/**
* Copyright (C) 2017 Lightbend Inc. <http://www.lightbend.com/>
*/
package akka.typed.javadsl;
package akka.actor.typed.javadsl;
import java.util.concurrent.CompletionStage;
import java.util.concurrent.TimeUnit;
@ -13,9 +13,9 @@ import scala.concurrent.duration.Duration;
import akka.util.Timeout;
import org.junit.Test;
import akka.typed.*;
import static akka.typed.javadsl.Actor.*;
import static akka.typed.javadsl.AskPattern.*;
import akka.actor.typed.*;
import static akka.actor.typed.javadsl.Actor.*;
import static akka.actor.typed.javadsl.AskPattern.*;
public class WatchTest extends JUnitSuite {

View file

@ -1,15 +1,15 @@
/**
* Copyright (C) 2017 Lightbend Inc. <http://www.lightbend.com>
*/
package jdocs.akka.typed;
package jdocs.akka.actor.typed;
//#imports
import akka.typed.ActorRef;
import akka.typed.ActorSystem;
import akka.typed.Behavior;
import akka.typed.Terminated;
import akka.typed.javadsl.Actor;
import akka.typed.javadsl.AskPattern;
import akka.actor.typed.ActorRef;
import akka.actor.typed.ActorSystem;
import akka.actor.typed.Behavior;
import akka.actor.typed.Terminated;
import akka.actor.typed.javadsl.Actor;
import akka.actor.typed.javadsl.AskPattern;
import akka.util.Timeout;
//#imports

View file

@ -1,14 +1,14 @@
/**
* Copyright (C) 2017 Lightbend Inc. <http://www.lightbend.com>
*/
package jdocs.akka.typed;
package jdocs.akka.actor.typed;
//#imports
import akka.typed.ActorRef;
import akka.typed.Behavior;
import akka.typed.javadsl.Actor;
import akka.typed.javadsl.Actor.Receive;
import akka.typed.javadsl.ActorContext;
import akka.actor.typed.ActorRef;
import akka.actor.typed.Behavior;
import akka.actor.typed.javadsl.Actor;
import akka.actor.typed.javadsl.Actor.Receive;
import akka.actor.typed.javadsl.ActorContext;
//#imports
import java.util.ArrayList;
import java.util.List;

View file

@ -0,0 +1,4 @@
akka.typed {
# for the akka.actor.ExtensionSpec
library-extensions += "akka.actor.typed.InstanceCountingExtension"
}

View file

@ -1,13 +1,13 @@
/**
* Copyright (C) 2017 Lightbend Inc. <http://www.lightbend.com/>
*/
package akka.typed
package akka.actor.typed
import scala.concurrent.duration._
import scala.concurrent.Future
import com.typesafe.config.ConfigFactory
import akka.actor.{ DeadLetterSuppression, InvalidMessageException }
import akka.typed.scaladsl.Actor
import akka.actor.typed.scaladsl.Actor
import scala.language.existentials

View file

@ -1,15 +1,15 @@
/**
* Copyright (C) 2017 Lightbend Inc. <http://www.lightbend.com>
*/
package akka.typed
package akka.actor.typed
import scala.concurrent.ExecutionContext
import scala.concurrent.duration._
import org.scalatest.concurrent.ScalaFutures
import akka.util.Timeout
import akka.pattern.AskTimeoutException
import akka.typed.scaladsl.Actor._
import akka.typed.scaladsl.AskPattern._
import akka.actor.typed.scaladsl.Actor._
import akka.actor.typed.scaladsl.AskPattern._
object AskSpec {
@ -65,8 +65,8 @@ class AskSpec extends TypedSpec with ScalaFutures {
/** See issue #19947 (MatchError with adapted ActorRef) */
def `must fail the future if the actor doesn't exist`(): Unit = {
val noSuchActor: ActorRef[Msg] = system match {
case adaptedSys: akka.typed.internal.adapter.ActorSystemAdapter[_]
import akka.typed.scaladsl.adapter._
case adaptedSys: akka.actor.typed.internal.adapter.ActorSystemAdapter[_]
import akka.actor.typed.scaladsl.adapter._
adaptedSys.untyped.provider.resolveActorRef("/foo/bar")
case _
fail("this test must only run in an adapted actor system")

View file

@ -1,10 +1,10 @@
/**
* Copyright (C) 2014-2017 Lightbend Inc. <http://www.lightbend.com>
*/
package akka.typed
package akka.actor.typed
import akka.typed.scaladsl.{ Actor SActor }
import akka.typed.javadsl.{ Actor JActor, ActorContext JActorContext }
import akka.actor.typed.scaladsl.{ Actor SActor }
import akka.actor.typed.javadsl.{ Actor JActor, ActorContext JActorContext }
import akka.japi.function.{ Function F1e, Function2 F2, Procedure2 P2 }
import akka.japi.pf.{ FI, PFBuilder }
import java.util.function.{ Function F1 }

View file

@ -1,14 +1,14 @@
/**
* Copyright (C) 2017 Lightbend Inc. <http://www.lightbend.com>
*/
package akka.typed
package akka.actor.typed
import scala.concurrent.Await
import scala.concurrent.duration._
import scala.util.control.NoStackTrace
import akka.typed.scaladsl.Actor
import akka.typed.scaladsl.Actor.BehaviorDecorators
import akka.typed.scaladsl.AskPattern._
import akka.actor.typed.scaladsl.Actor
import akka.actor.typed.scaladsl.Actor.BehaviorDecorators
import akka.actor.typed.scaladsl.AskPattern._
import akka.typed.testkit.{ EffectfulActorContext, Inbox, TestKitSettings }
import akka.typed.testkit.scaladsl._

View file

@ -1,7 +1,7 @@
/**
* Copyright (C) 2017 Lightbend Inc. <http://www.lightbend.com>
*/
package akka.typed
package akka.actor.typed
import java.util.concurrent.atomic.AtomicInteger
@ -82,7 +82,7 @@ class ExtensionsSpec extends TypedSpecSetup {
def `03 should load extensions from the configuration`(): Unit =
withEmptyActorSystem("ExtensionsSpec03", Some(ConfigFactory.parseString(
"""
akka.typed.extensions = ["akka.typed.DummyExtension1$", "akka.typed.SlowExtension$"]
akka.typed.extensions = ["akka.actor.typed.DummyExtension1$", "akka.actor.typed.SlowExtension$"]
"""))
) { system
system.hasExtension(DummyExtension1) should ===(true)
@ -96,7 +96,7 @@ class ExtensionsSpec extends TypedSpecSetup {
def create(): Unit = {
ActorSystem[Any](Behavior.EmptyBehavior, "ExtensionsSpec04", config = Some(ConfigFactory.parseString(
"""
akka.typed.extensions = ["akka.typed.FailingToLoadExtension$"]
akka.typed.extensions = ["akka.actor.typed.FailingToLoadExtension$"]
""")))
}
intercept[RuntimeException] {
@ -130,7 +130,7 @@ class ExtensionsSpec extends TypedSpecSetup {
intercept[RuntimeException] {
withEmptyActorSystem(
"ExtensionsSpec07",
Some(ConfigFactory.parseString("""akka.typed.library-extensions += "akka.typed.FailingToLoadExtension$" """))
Some(ConfigFactory.parseString("""akka.typed.library-extensions += "akka.actor.typed.FailingToLoadExtension$" """))
) { _ () }
}
@ -138,7 +138,7 @@ class ExtensionsSpec extends TypedSpecSetup {
intercept[RuntimeException] {
withEmptyActorSystem(
"ExtensionsSpec08",
Some(ConfigFactory.parseString("""akka.typed.library-extensions += "akka.typed.MissingExtension" """))
Some(ConfigFactory.parseString("""akka.typed.library-extensions += "akka.actor.typed.MissingExtension" """))
) { _ () }
}
@ -152,7 +152,7 @@ class ExtensionsSpec extends TypedSpecSetup {
}
def `10 not create an extension multiple times when using the ActorSystemAdapter`(): Unit = {
import akka.typed.scaladsl.adapter._
import akka.actor.typed.scaladsl.adapter._
val untypedSystem = akka.actor.ActorSystem()
try {

View file

@ -1,19 +1,19 @@
/**
* Copyright (C) 2014-2017 Lightbend Inc. <http://www.lightbend.com>
*/
package akka.typed
package akka.actor.typed
import scala.concurrent.duration._
import com.typesafe.config.ConfigFactory
import org.junit.runner.RunWith
import akka.typed.scaladsl.Actor._
import akka.actor.typed.scaladsl.Actor._
import akka.util.Timeout
@RunWith(classOf[org.scalatest.junit.JUnitRunner])
class PerformanceSpec extends TypedSpec(
ConfigFactory.parseString("""
# increase this if you do real benchmarking
akka.typed.PerformanceSpec.iterations=100000
akka.actor.typed.PerformanceSpec.iterations=100000
""")) {
override def setTimeout = Timeout(20.seconds)
@ -62,7 +62,7 @@ class PerformanceSpec extends TypedSpec(
}
}
val iterations = nativeSystem.settings.config.getInt("akka.typed.PerformanceSpec.iterations")
val iterations = nativeSystem.settings.config.getInt("akka.actor.typed.PerformanceSpec.iterations")
trait CommonTests {
implicit def system: ActorSystem[TypedSpec.Command]

View file

@ -1,7 +1,7 @@
/**
* Copyright (C) 2016-2017 Lightbend Inc. <http://www.lightbend.com/>
*/
package akka.typed
package akka.actor.typed
class PropsSpec extends TypedSpecSetup {

View file

@ -1,10 +1,10 @@
/**
* Copyright (C) 2017 Lightbend Inc. <http://www.lightbend.com>
*/
package akka.typed
package akka.actor.typed
import scala.concurrent.duration._
import akka.typed.scaladsl.Actor._
import akka.actor.typed.scaladsl.Actor._
import akka.typed.testkit.{ EffectfulActorContext, Inbox, TestKitSettings }
import scala.util.control.NoStackTrace
@ -227,7 +227,7 @@ class RestarterSpec extends TypedSpec {
}
trait RealTests extends StartSupport {
import akka.typed.scaladsl.adapter._
import akka.actor.typed.scaladsl.adapter._
implicit def system: ActorSystem[TypedSpec.Command]
implicit val testSettings = TestKitSettings(system)

View file

@ -1,12 +1,12 @@
/**
* Copyright (C) 2014-2017 Lightbend Inc. <http://www.lightbend.com>
*/
package akka.typed
package akka.actor.typed
import scala.concurrent.duration.FiniteDuration
import java.util.concurrent.TimeoutException
import akka.typed.scaladsl.Actor._
import akka.actor.typed.scaladsl.Actor._
import scala.concurrent.duration.Deadline
@ -54,7 +54,7 @@ object StepWise {
protected def getFrames: Array[StackTraceElement] =
Thread.currentThread.getStackTrace.dropWhile { elem
val name = elem.getClassName
name.startsWith("java.lang.Thread") || name.startsWith("akka.typed.StepWise")
name.startsWith("java.lang.Thread") || name.startsWith("akka.actor.typed.StepWise")
}
}
private class WithTrace extends Trace {

View file

@ -1,7 +1,7 @@
/**
* Copyright (C) 2017 Lightbend Inc. <http://www.lightbend.com>
*/
package akka.typed
package akka.actor.typed
import java.util.concurrent.CountDownLatch
import java.util.concurrent.TimeUnit
@ -10,8 +10,8 @@ import java.util.concurrent.atomic.AtomicInteger
import scala.concurrent.duration._
import scala.util.control.NoStackTrace
import akka.typed.scaladsl.Actor
import akka.typed.scaladsl.TimerScheduler
import akka.actor.typed.scaladsl.Actor
import akka.actor.typed.scaladsl.TimerScheduler
import akka.typed.testkit.TestKitSettings
import akka.typed.testkit.scaladsl._

View file

@ -1,7 +1,7 @@
/**
* Copyright (C) 2014-2017 Lightbend Inc. <http://www.lightbend.com>
*/
package akka.typed
package akka.actor.typed
import org.scalatest.refspec.RefSpec
import org.scalatest.Matchers
@ -20,14 +20,14 @@ import akka.actor.ActorInitializationException
import language.existentials
import akka.testkit.TestEvent.Mute
import akka.typed.scaladsl.Actor._
import akka.actor.typed.scaladsl.Actor._
import org.scalatest.concurrent.ScalaFutures
import org.scalactic.TypeCheckedTripleEquals
import org.scalactic.CanEqual
import org.junit.runner.RunWith
import scala.util.control.NonFatal
import akka.typed.scaladsl.AskPattern
import akka.actor.typed.scaladsl.AskPattern
import scala.util.control.NoStackTrace
import akka.typed.testkit.{ Inbox, TestKitSettings }
@ -78,7 +78,7 @@ abstract class TypedSpec(val config: Config) extends TypedSpecSetup {
def nextName(prefix: String = "a"): String = s"$prefix-${nameCounter.next()}"
def start[T](behv: Behavior[T]): ActorRef[T] = {
import akka.typed.scaladsl.AskPattern._
import akka.actor.typed.scaladsl.AskPattern._
import akka.typed.testkit.scaladsl._
implicit val testSettings = TestKitSettings(system)
Await.result(system ? TypedSpec.Create(behv, nextName()), 3.seconds.dilated)

View file

@ -1,12 +1,12 @@
/**
* Copyright (C) 2017 Lightbend Inc. <http://www.lightbend.com>
*/
package akka.typed
package akka.actor.typed
import scala.concurrent._
import scala.concurrent.duration._
import akka.typed.scaladsl.Actor._
import akka.typed.scaladsl.AskPattern._
import akka.actor.typed.scaladsl.Actor._
import akka.actor.typed.scaladsl.AskPattern._
import akka.testkit._
@org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner])

View file

@ -1,11 +1,11 @@
/**
* Copyright (C) 2016-2017 Lightbend Inc. <http://www.lightbend.com/>
*/
package akka.typed
package akka.actor.typed
package internal
import akka.typed.scaladsl.Actor
import akka.typed.scaladsl.Actor._
import akka.actor.typed.scaladsl.Actor
import akka.actor.typed.scaladsl.Actor._
import org.scalactic.ConversionCheckedTripleEquals
import org.scalatest.concurrent.ScalaFutures
import org.scalatest.exceptions.TestFailedException

View file

@ -1,13 +1,13 @@
/**
* Copyright (C) 2016-2017 Lightbend Inc. <http://www.lightbend.com/>
*/
package akka.typed
package akka.actor.typed
package internal
import akka.Done
import akka.actor.InvalidMessageException
import akka.typed.scaladsl.Actor
import akka.typed.scaladsl.Actor._
import akka.actor.typed.scaladsl.Actor
import akka.actor.typed.scaladsl.Actor._
import akka.typed.testkit.Inbox
import akka.util.Timeout
import org.junit.runner.RunWith
@ -122,7 +122,7 @@ class ActorSystemSpec extends Spec with Matchers with BeforeAndAfterAll with Sca
def `must start system actors and mangle their names`(): Unit = {
withSystem("systemActorOf", Actor.empty[String]) { sys
import akka.typed.scaladsl.AskPattern._
import akka.actor.typed.scaladsl.AskPattern._
implicit val timeout = Timeout(1.second)
implicit val sched = sys.scheduler

View file

@ -1,7 +1,7 @@
/**
* Copyright (C) 2016-2017 Lightbend Inc. <http://www.lightbend.com/>
*/
package akka.typed
package akka.actor.typed
package internal
import akka.{ actor a, event e }
@ -10,7 +10,7 @@ import scala.concurrent._
import com.typesafe.config.ConfigFactory
import java.util.concurrent.ThreadFactory
import akka.typed.testkit.Inbox
import akka.typed.{ BusLogging, DefaultLoggingFilter, EventStream }
import akka.util.Timeout
private[typed] class ActorSystemStub(val name: String)
@ -23,15 +23,15 @@ private[typed] class ActorSystemStub(val name: String)
override def tell(msg: Nothing): Unit = throw new RuntimeException("must not send message to ActorSystemStub")
override def isLocal: Boolean = true
override def sendSystem(signal: akka.typed.internal.SystemMessage): Unit =
override def sendSystem(signal: akka.actor.typed.internal.SystemMessage): Unit =
throw new RuntimeException("must not send SYSTEM message to ActorSystemStub")
val deadLettersInbox = new DebugRef[Any](path.parent / "deadLetters", true)
override def deadLetters[U]: akka.typed.ActorRef[U] = deadLettersInbox
override def deadLetters[U]: akka.actor.typed.ActorRef[U] = deadLettersInbox
val controlledExecutor = new ControlledExecutor
implicit override def executionContext: scala.concurrent.ExecutionContextExecutor = controlledExecutor
override def dispatchers: akka.typed.Dispatchers = new Dispatchers {
override def dispatchers: akka.actor.typed.Dispatchers = new Dispatchers {
def lookup(selector: DispatcherSelector): ExecutionContextExecutor = controlledExecutor
def shutdown(): Unit = ()
}
@ -45,11 +45,11 @@ private[typed] class ActorSystemStub(val name: String)
override def scheduler: a.Scheduler = throw new UnsupportedOperationException("no scheduler")
private val terminationPromise = Promise[Terminated]
override def terminate(): Future[akka.typed.Terminated] = {
override def terminate(): Future[akka.actor.typed.Terminated] = {
terminationPromise.trySuccess(Terminated(this)(null))
terminationPromise.future
}
override def whenTerminated: Future[akka.typed.Terminated] = terminationPromise.future
override def whenTerminated: Future[akka.actor.typed.Terminated] = terminationPromise.future
override val startTime: Long = System.currentTimeMillis()
override def uptime: Long = System.currentTimeMillis() - startTime
override def threadFactory: java.util.concurrent.ThreadFactory = new ThreadFactory {

View file

@ -1,7 +1,7 @@
/**
* Copyright (C) 2016-2017 Lightbend Inc. <http://www.lightbend.com/>
*/
package akka.typed.internal
package akka.actor.typed.internal
import scala.concurrent.ExecutionContextExecutor
import java.util.LinkedList

View file

@ -1,7 +1,7 @@
/**
* Copyright (C) 2016-2017 Lightbend Inc. <http://www.lightbend.com/>
*/
package akka.typed
package akka.actor.typed
package internal
import akka.{ actor a }

View file

@ -1,14 +1,15 @@
/**
* Copyright (C) 2016-2017 Lightbend Inc. <http://www.lightbend.com/>
*/
package akka.typed
package akka.actor.typed
package internal
import akka.Done
import akka.event.Logging._
import akka.typed.scaladsl.Actor._
import akka.typed.scaladsl.AskPattern._
import akka.actor.typed.scaladsl.Actor._
import akka.actor.typed.scaladsl.AskPattern._
import akka.typed.testkit.Inbox
import akka.typed.Logger
import com.typesafe.config.ConfigFactory
import org.scalatest.concurrent.Eventually
import org.scalatest.concurrent.PatienceConfiguration.Timeout
@ -33,7 +34,7 @@ object EventStreamSpec {
}
val config = ConfigFactory.parseString("""
akka.typed.loggers = ["akka.typed.internal.EventStreamSpec$MyLogger"]
akka.typed.loggers = ["akka.actor.typed.internal.EventStreamSpec$MyLogger"]
""")
// class hierarchy for subchannel test

View file

@ -1,7 +1,7 @@
/**
* Copyright (C) 2016-2017 Lightbend Inc. <http://www.lightbend.com/>
*/
package akka.typed
package akka.actor.typed
package internal
import akka.actor.InvalidMessageException

View file

@ -1,12 +1,12 @@
/**
* Copyright (C) 2014-2017 Lightbend Inc. <http://www.lightbend.com>
*/
package akka.typed.receptionist
package akka.actor.typed.receptionist
import akka.typed._
import akka.typed.receptionist.Receptionist._
import akka.typed.scaladsl.Actor
import akka.typed.scaladsl.AskPattern._
import akka.actor.typed._
import akka.actor.typed.receptionist.Receptionist._
import akka.actor.typed.scaladsl.Actor
import akka.actor.typed.scaladsl.AskPattern._
import akka.typed.testkit.EffectfulActorContext
import akka.typed.testkit.Inbox
import akka.typed.testkit.TestKitSettings
@ -33,7 +33,7 @@ class LocalReceptionistSpec extends TypedSpec with Eventually {
}
}
import akka.typed.internal.receptionist.ReceptionistImpl.{ localOnlyBehavior behavior }
import akka.actor.typed.internal.receptionist.ReceptionistImpl.{ localOnlyBehavior behavior }
trait CommonTests extends StartSupport {
implicit def system: ActorSystem[TypedSpec.Command]

View file

@ -1,7 +1,7 @@
/**
* Copyright (C) 2017 Lightbend Inc. <http://www.lightbend.com>
*/
package akka.typed
package akka.actor.typed
package scaladsl
import akka.typed.testkit.{ EffectfulActorContext, TestKitSettings }

View file

@ -1,7 +1,7 @@
/**
* Copyright (C) 2017 Lightbend Inc. <http://www.lightbend.com>
*/
package akka.typed
package akka.actor.typed
package scaladsl
import akka.Done

View file

@ -1,18 +1,18 @@
/**
* Copyright (C) 2017 Lightbend Inc. <http://www.lightbend.com>
*/
package akka.typed.scaladsl.adapter
package akka.actor.typed.scaladsl.adapter
import scala.concurrent.duration._
import scala.util.control.NoStackTrace
import akka.typed.ActorRef
import akka.actor.typed.ActorRef
import akka.actor.{ InvalidMessageException, Props }
import akka.typed.Behavior
import akka.typed.Terminated
import akka.typed.scaladsl.Actor
import akka.actor.typed.Behavior
import akka.actor.typed.Terminated
import akka.actor.typed.scaladsl.Actor
import akka.{ actor untyped }
import akka.testkit._
import akka.typed.Behavior.UntypedBehavior
import akka.actor.typed.Behavior.UntypedBehavior
object AdapterSpec {
val untyped1: untyped.Props = untyped.Props(new Untyped1)

View file

@ -1,12 +1,12 @@
/**
* Copyright (C) 2014-2017 Lightbend Inc. <http://www.lightbend.com>
*/
package docs.akka.typed
package docs.akka.actor.typed
//#imports
import akka.typed._
import akka.typed.scaladsl.Actor
import akka.typed.scaladsl.AskPattern._
import akka.actor.typed._
import akka.actor.typed.scaladsl.Actor
import akka.actor.typed.scaladsl.AskPattern._
import scala.concurrent.Future
import scala.concurrent.duration._
import scala.concurrent.Await

View file

@ -1,13 +1,13 @@
/**
* Copyright (C) 2014-2017 Lightbend Inc. <http://www.lightbend.com>
*/
package docs.akka.typed
package docs.akka.actor.typed
//#imports
import akka.typed._
import akka.typed.scaladsl.Actor
import akka.typed.scaladsl.ActorContext
import akka.typed.scaladsl.AskPattern._
import akka.actor.typed._
import akka.actor.typed.scaladsl.Actor
import akka.actor.typed.scaladsl.ActorContext
import akka.actor.typed.scaladsl.AskPattern._
import scala.concurrent.Future
import scala.concurrent.duration._
import scala.concurrent.Await

View file

@ -31,17 +31,8 @@ akka.typed {
# TODO: move these out somewhere else when doing #23632
akka.actor {
serializers {
typed-misc = "akka.typed.cluster.internal.MiscMessageSerializer"
typed-sharding = "akka.typed.cluster.sharding.internal.ShardingSerializer"
}
serialization-identifiers {
"akka.typed.cluster.internal.MiscMessageSerializer" = 24
"akka.typed.cluster.sharding.internal.ShardingSerializer" = 25
}
serialization-bindings {
"akka.typed.ActorRef" = typed-misc
"akka.typed.internal.adapter.ActorRefAdapter" = typed-misc
"akka.typed.cluster.sharding.ShardingEnvelope" = typed-sharding
"akka.actor.typed.ActorRef" = typed-misc
"akka.actor.typed.internal.adapter.ActorRefAdapter" = typed-misc
}
}

View file

@ -1,7 +1,7 @@
/**
* Copyright (C) 2014-2017 Lightbend Inc. <http://www.lightbend.com>
*/
package akka.typed
package akka.actor.typed
import akka.annotation.DoNotInherit
import akka.annotation.ApiMayChange

View file

@ -1,7 +1,7 @@
/**
* Copyright (C) 2014-2017 Lightbend Inc. <http://www.lightbend.com>
*/
package akka.typed
package akka.actor.typed
import akka.{ actor a }
@ -82,6 +82,6 @@ object ActorRef {
def apply[T](send: (T, internal.FunctionRef[T]) Unit, terminate: internal.FunctionRef[T] Unit): ActorRef[T] =
new internal.FunctionRef(FunctionPath, send, terminate)
private[typed] val FuturePath = a.RootActorPath(a.Address("akka.typed.internal", "future"))
private[typed] val FunctionPath = a.RootActorPath(a.Address("akka.typed.internal", "function"))
private[typed] val FuturePath = a.RootActorPath(a.Address("akka.actor.typed.internal", "future"))
private[typed] val FunctionPath = a.RootActorPath(a.Address("akka.actor.typed.internal", "function"))
}

View file

@ -1,7 +1,7 @@
/**
* Copyright (C) 2014-2017 Lightbend Inc. <http://www.lightbend.com>
*/
package akka.typed
package akka.actor.typed
import scala.concurrent.ExecutionContext
import akka.{ actor a, event e }
@ -11,13 +11,14 @@ import akka.actor.setup.ActorSystemSetup
import com.typesafe.config.{ Config, ConfigFactory }
import scala.concurrent.{ ExecutionContextExecutor, Future }
import akka.typed.internal.adapter.{ ActorSystemAdapter, PropsAdapter }
import akka.actor.typed.internal.adapter.{ ActorSystemAdapter, PropsAdapter }
import akka.util.Timeout
import akka.annotation.DoNotInherit
import akka.annotation.ApiMayChange
import java.util.Optional
import akka.typed.receptionist.Receptionist
import akka.actor.typed.receptionist.Receptionist
import akka.typed.EventStream
/**
* An ActorSystem is home to a hierarchy of Actors. It is created using
@ -47,9 +48,9 @@ abstract class ActorSystem[-T] extends ActorRef[T] with Extensions { this: inter
def logConfiguration(): Unit
/**
* A reference to this systems logFilter, which filters usage of the [[#log]]
* A reference to this systems logFilter, which filters usage of the [[log]]
* [[akka.event.LoggingAdapter]] such that only permissible messages are sent
* via the [[#eventStream]]. The default implementation will just test that
* via the [[eventStream]]. The default implementation will just test that
* the message is suitable for the current log level.
*/
def logFilter: e.LoggingFilter
@ -138,7 +139,7 @@ abstract class ActorSystem[-T] extends ActorRef[T] with Extensions { this: inter
* Ask the system guardian of this system to create an actor from the given
* behavior and props and with the given name. The name does not need to
* be unique since the guardian will prefix it with a running number when
* creating the child actor. The timeout sets the timeout used for the [[akka.typed.scaladsl.AskPattern$]]
* creating the child actor. The timeout sets the timeout used for the [[akka.actor.typed.scaladsl.AskPattern$]]
* invocation when asking the guardian.
*
* The returned Future of [[ActorRef]] may be converted into an [[ActorRef]]
@ -148,7 +149,7 @@ abstract class ActorSystem[-T] extends ActorRef[T] with Extensions { this: inter
def systemActorOf[U](behavior: Behavior[U], name: String, props: Props = Props.empty)(implicit timeout: Timeout): Future[ActorRef[U]]
/**
* Return a reference to this systems [[akka.typed.receptionist.Receptionist]].
* Return a reference to this systems [[akka.actor.typed.receptionist.Receptionist]].
*/
def receptionist: ActorRef[Receptionist.Command] =
Receptionist(this).ref

View file

@ -1,14 +1,14 @@
/**
* Copyright (C) 2014-2017 Lightbend Inc. <http://www.lightbend.com>
*/
package akka.typed
package akka.actor.typed
import akka.actor.InvalidMessageException
import scala.annotation.tailrec
import akka.util.LineNumbers
import akka.annotation.{ DoNotInherit, InternalApi }
import akka.typed.scaladsl.{ ActorContext SAC }
import akka.actor.typed.scaladsl.{ ActorContext SAC }
import akka.util.OptionVal
/**
@ -19,7 +19,7 @@ import akka.util.OptionVal
* its child actors.
*
* Behaviors can be formulated in a number of different ways, either by
* using the DSLs in [[akka.typed.scaladsl.Actor]] and [[akka.typed.javadsl.Actor]]
* using the DSLs in [[akka.actor.typed.scaladsl.Actor]] and [[akka.actor.typed.javadsl.Actor]]
* or extending the abstract [[ExtensibleBehavior]] class.
*
* Closing over ActorContext makes a Behavior immobile: it cannot be moved to
@ -42,7 +42,7 @@ sealed abstract class Behavior[T] {
/**
* Extension point for implementing custom behaviors in addition to the existing
* set of behaviors available through the DSLs in [[akka.typed.scaladsl.Actor]] and [[akka.typed.javadsl.Actor]]
* set of behaviors available through the DSLs in [[akka.actor.typed.scaladsl.Actor]] and [[akka.actor.typed.javadsl.Actor]]
*/
abstract class ExtensibleBehavior[T] extends Behavior[T] {
/**

View file

@ -1,7 +1,7 @@
/**
* Copyright (C) 2016-2017 Lightbend Inc. <http://www.lightbend.com/>
*/
package akka.typed
package akka.actor.typed
import scala.concurrent.ExecutionContextExecutor

View file

@ -1,7 +1,7 @@
/**
* Copyright (C) 2017 Lightbend Inc. <http://www.lightbend.com>
*/
package akka.typed
package akka.actor.typed
import akka.annotation.DoNotInherit

View file

@ -1,7 +1,7 @@
/**
* Copyright (C) 2016-2017 Lightbend Inc. <http://www.lightbend.com/>
*/
package akka.typed
package akka.actor.typed
/**
* Envelope that is published on the eventStream for every message that is
@ -57,7 +57,7 @@ final case object PostStop extends PostStop {
/**
* Lifecycle signal that is fired when an Actor that was watched has terminated.
* Watching is performed by invoking the
* [[akka.typed.ActorContext]] `watch` method. The DeathWatch service is
* [[akka.actor.typed.ActorContext]] `watch` method. The DeathWatch service is
* idempotent, meaning that registering twice has the same effect as registering
* once. Registration does not need to happen before the Actor terminates, a
* notification is guaranteed to arrive after both registration and termination

View file

@ -1,7 +1,7 @@
/**
* Copyright (C) 2016-2017 Lightbend Inc. <http://www.lightbend.com/>
*/
package akka.typed
package akka.actor.typed
import java.util.concurrent.Executor

View file

@ -1,7 +1,7 @@
/**
* Copyright (C) 2017 Lightbend Inc. <http://www.lightbend.com>
*/
package akka.typed
package akka.actor.typed
import akka.annotation.InternalApi
import scala.concurrent.duration.FiniteDuration

View file

@ -1,7 +1,7 @@
/**
* Copyright (C) 2016-2017 Lightbend Inc. <http://www.lightbend.com/>
*/
package akka.typed
package akka.actor.typed
package internal
import akka.actor.{ Cancellable, InvalidActorNameException, InvalidMessageException }
@ -20,9 +20,9 @@ import scala.util.control.NonFatal
import scala.util.control.Exception.Catcher
import akka.event.Logging.Error
import akka.event.Logging
import akka.typed.Behavior.StoppedBehavior
import akka.actor.typed.Behavior.StoppedBehavior
import akka.util.OptionVal
import akka.typed.Behavior.UntypedBehavior
import akka.actor.typed.Behavior.UntypedBehavior
/**
* INTERNAL API

View file

@ -1,7 +1,7 @@
/**
* Copyright (C) 2017 Lightbend Inc. <http://www.lightbend.com>
*/
package akka.typed
package akka.actor.typed
package internal
import akka.annotation.InternalApi
@ -24,7 +24,7 @@ import scala.concurrent.ExecutionContextExecutor
case None Optional.empty()
}
override def getChildren: java.util.List[akka.typed.ActorRef[Void]] = {
override def getChildren: java.util.List[akka.actor.typed.ActorRef[Void]] = {
val c = children
val a = new ArrayList[ActorRef[Void]](c.size)
val i = c.iterator
@ -38,16 +38,16 @@ import scala.concurrent.ExecutionContextExecutor
override def getMailboxCapacity: Int =
mailboxCapacity
override def getSelf: akka.typed.ActorRef[T] =
override def getSelf: akka.actor.typed.ActorRef[T] =
self
override def getSystem: akka.typed.ActorSystem[Void] =
override def getSystem: akka.actor.typed.ActorSystem[Void] =
system.asInstanceOf[ActorSystem[Void]]
override def spawn[U](behavior: akka.typed.Behavior[U], name: String): akka.typed.ActorRef[U] =
override def spawn[U](behavior: akka.actor.typed.Behavior[U], name: String): akka.actor.typed.ActorRef[U] =
spawn(behavior, name, Props.empty)
override def spawnAnonymous[U](behavior: akka.typed.Behavior[U]): akka.typed.ActorRef[U] =
override def spawnAnonymous[U](behavior: akka.actor.typed.Behavior[U]): akka.actor.typed.ActorRef[U] =
spawnAnonymous(behavior, Props.empty)
override def spawnAdapter[U](f: U T, name: String): ActorRef[U] =
@ -56,10 +56,10 @@ import scala.concurrent.ExecutionContextExecutor
override def spawnAdapter[U](f: U T): ActorRef[U] =
internalSpawnAdapter(f, "")
override def spawnAdapter[U](f: java.util.function.Function[U, T]): akka.typed.ActorRef[U] =
override def spawnAdapter[U](f: java.util.function.Function[U, T]): akka.actor.typed.ActorRef[U] =
internalSpawnAdapter(f.apply _, "")
override def spawnAdapter[U](f: java.util.function.Function[U, T], name: String): akka.typed.ActorRef[U] =
override def spawnAdapter[U](f: java.util.function.Function[U, T], name: String): akka.actor.typed.ActorRef[U] =
internalSpawnAdapter(f.apply _, name)
/**

View file

@ -1,7 +1,7 @@
/**
* Copyright (C) 2016-2017 Lightbend Inc. <http://www.lightbend.com/>
*/
package akka.typed
package akka.actor.typed
package internal
import akka.{ actor a }
@ -72,7 +72,7 @@ private[typed] class LocalActorRef[-T](override val path: a.ActorPath, cell: Act
*/
private[typed] object BlackholeActorRef
extends ActorRef[Any] with ActorRefImpl[Any] {
override val path: a.ActorPath = a.RootActorPath(a.Address("akka.typed.internal", "blackhole"))
override val path: a.ActorPath = a.RootActorPath(a.Address("akka.actor.typed.internal", "blackhole"))
override def tell(msg: Any): Unit = ()
override def sendSystem(signal: SystemMessage): Unit = ()
final override def isLocal: Boolean = true
@ -83,7 +83,7 @@ private[typed] object BlackholeActorRef
* This reference can be watched and will do the right thing when it receives a [[DeathWatchNotification]].
* This reference cannot watch other references.
*/
private[typed] final class FunctionRef[-T](
private[akka] final class FunctionRef[-T](
_path: a.ActorPath,
send: (T, FunctionRef[T]) Unit,
_terminate: FunctionRef[T] Unit)
@ -228,7 +228,7 @@ private[typed] class FutureRef[-T](_path: a.ActorPath, bufferSize: Int, f: Futur
private[typed] object FutureRef {
val targetOffset = {
val fields = classOf[FutureRef[_]].getDeclaredFields.toList
// On Scala 2.12, the field's name is exactly "_target" (and it's private), earlier Scala versions compile the val to a public field that's name mangled to "akka$typed$internal$FutureRef$$_target"
// On Scala 2.12, the field's name is exactly "_target" (and it's private), earlier Scala versions compile the val to a public field that's name mangled to "akka.actor.typed$internal$FutureRef$$_target"
val targetField = fields.find(_.getName.endsWith("_target"))
assert(targetField.nonEmpty, s"Could not find _target field in FutureRef class among fields $fields.")

View file

@ -1,7 +1,7 @@
/**
* Copyright (C) 2016-2017 Lightbend Inc. <http://www.lightbend.com/>
*/
package akka.typed
package akka.actor.typed
package internal
import com.typesafe.config.Config
@ -15,7 +15,7 @@ import akka.{ actor ⇒ a, dispatch ⇒ d, event ⇒ e }
import scala.util.control.NonFatal
import scala.util.control.ControlThrowable
import scala.collection.immutable
import akka.typed.Dispatchers
import akka.actor.typed.Dispatchers
import scala.concurrent.Promise
import java.util.concurrent.ConcurrentSkipListSet
@ -27,8 +27,9 @@ import akka.util.Timeout
import java.io.Closeable
import java.util.concurrent.atomic.AtomicInteger
import akka.typed.receptionist.Receptionist
import akka.typed.scaladsl.AskPattern
import akka.actor.typed.receptionist.Receptionist
import akka.actor.typed.scaladsl.AskPattern
import akka.typed.{ BusLogging, EventStream }
object ActorSystemImpl {
@ -288,7 +289,7 @@ private[typed] class ActorSystemImpl[-T](
val children = cell.children.toSeq.sorted
val bulk = children.dropRight(1) map (r printNode(r.sorryForNothing, indent + " |"))
terminating ++ bulk ++ (children.lastOption map (r printNode(r.sorryForNothing, indent + " ")))
} mkString ("\n"))
} mkString "\n")
case _
indent + node.path.name + " " + e.Logging.simpleName(node)
}

View file

@ -1,15 +1,15 @@
/**
* Copyright (C) 2017 Lightbend Inc. <http://www.lightbend.com>
*/
package akka.typed
package akka.actor.typed
package internal
import akka.actor.InvalidMessageException
import akka.util.LineNumbers
import akka.annotation.InternalApi
import akka.typed.{ ActorContext AC }
import akka.typed.scaladsl.{ ActorContext SAC }
import akka.typed.scaladsl.Actor
import akka.actor.typed.{ ActorContext AC }
import akka.actor.typed.scaladsl.{ ActorContext SAC }
import akka.actor.typed.scaladsl.Actor
import scala.reflect.ClassTag
import scala.annotation.tailrec
@ -31,7 +31,7 @@ import scala.annotation.tailrec
behavior match {
case d: DeferredBehavior[T]
DeferredBehavior[U] { ctx
val c = ctx.asInstanceOf[akka.typed.ActorContext[T]]
val c = ctx.asInstanceOf[akka.actor.typed.ActorContext[T]]
val b = Behavior.validateAsInitial(Behavior.undefer(d, c))
Widened(b, matcher)
}
@ -120,7 +120,7 @@ import scala.annotation.tailrec
behavior match {
case d: DeferredBehavior[T]
DeferredBehavior[T] { ctx
val c = ctx.asInstanceOf[akka.typed.ActorContext[T]]
val c = ctx.asInstanceOf[akka.actor.typed.ActorContext[T]]
val b = Behavior.validateAsInitial(Behavior.undefer(d, c))
Intercept(beforeMessage, beforeSignal, afterMessage, afterSignal, b, toStringPrefix)
}

View file

@ -2,7 +2,7 @@
* Copyright (C) 2009-2017 Lightbend Inc. <http://www.lightbend.com>
*/
package akka.typed
package akka.actor.typed
package internal
import akka.event.Logging.{ Warning, Debug }

View file

@ -1,7 +1,7 @@
/**
* Copyright (C) 2016-2017 Lightbend Inc. <http://www.lightbend.com/>
*/
package akka.typed
package akka.actor.typed
package internal
import scala.concurrent.ExecutionContextExecutor

View file

@ -1,18 +1,22 @@
/**
* Copyright (C) 2016-2017 Lightbend Inc. <http://www.lightbend.com/>
*/
package akka.typed
package akka.actor.typed
package internal
import akka.{ actor a, event e }
import java.util.concurrent.atomic.AtomicReference
import scala.annotation.tailrec
import scala.concurrent.{ Await, Promise }
import akka.util.{ ReentrantGuard, Subclassification, SubclassifiedIndex }
import scala.collection.immutable
import java.util.concurrent.TimeoutException
import akka.util.Timeout
import akka.typed.scaladsl.AskPattern
import akka.actor.typed.scaladsl.AskPattern
import akka.typed.{ EventStream, Logger }
/**
* INTERNAL API
@ -330,6 +334,6 @@ private[typed] object EventStreamImpl {
def isSubclass(x: Class[_], y: Class[_]) = y isAssignableFrom x
}
val StandardOutLoggerPath = a.RootActorPath(a.Address("akka.typed.internal", "StandardOutLogger"))
val StandardOutLoggerPath = a.RootActorPath(a.Address("akka.actor.typed.internal", "StandardOutLogger"))
}

View file

@ -1,12 +1,12 @@
/**
* Copyright (C) 2017 Lightbend Inc. <http://www.lightbend.com/>
*/
package akka.typed.internal
package akka.actor.typed.internal
import java.util.concurrent.{ ConcurrentHashMap, CountDownLatch }
import akka.annotation.InternalApi
import akka.typed.{ ActorSystem, Extension, ExtensionId, Extensions }
import akka.actor.typed.{ ActorSystem, Extension, ExtensionId, Extensions }
import scala.annotation.tailrec
import scala.util.{ Failure, Success, Try }
@ -58,7 +58,7 @@ trait ExtensionsImpl extends Extensions { self: ActorSystem[_] ⇒
}
// eager initialization of CoordinatedShutdown
// TODO coordinated shutdown for akka typed
// TODO coordinated shutdown for akka.actor.typed
// CoordinatedShutdown(self)
loadExtensions("akka.typed.library-extensions", throwOnLoadFail = true)

View file

@ -1,7 +1,7 @@
/**
* Copyright (C) 2016-2017 Lightbend Inc. <http://www.lightbend.com/>
*/
package akka.typed
package akka.actor.typed
package internal
import java.util.concurrent.ThreadLocalRandom
@ -16,16 +16,16 @@ import scala.util.control.NonFatal
import akka.actor.DeadLetterSuppression
import akka.annotation.InternalApi
import akka.event.Logging
import akka.typed.ActorContext
import akka.typed.Behavior
import akka.typed.Behavior.DeferredBehavior
import akka.typed.ExtensibleBehavior
import akka.typed.PreRestart
import akka.typed.Signal
import akka.typed.SupervisorStrategy._
import akka.typed.scaladsl.Actor._
import akka.actor.typed.ActorContext
import akka.actor.typed.Behavior
import akka.actor.typed.Behavior.DeferredBehavior
import akka.actor.typed.ExtensibleBehavior
import akka.actor.typed.PreRestart
import akka.actor.typed.Signal
import akka.actor.typed.SupervisorStrategy._
import akka.actor.typed.scaladsl.Actor._
import akka.util.OptionVal
import akka.typed.scaladsl.Actor
import akka.actor.typed.scaladsl.Actor
/**
* INTERNAL API
@ -33,7 +33,7 @@ import akka.typed.scaladsl.Actor
@InternalApi private[akka] object Restarter {
def apply[T, Thr <: Throwable: ClassTag](initialBehavior: Behavior[T], strategy: SupervisorStrategy): Behavior[T] =
Actor.deferred[T] { ctx
val c = ctx.asInstanceOf[akka.typed.ActorContext[T]]
val c = ctx.asInstanceOf[akka.actor.typed.ActorContext[T]]
val startedBehavior = initialUndefer(c, initialBehavior)
strategy match {
case Restart(-1, _, loggingEnabled)

View file

@ -1,13 +1,13 @@
/**
* Copyright (C) 2016-2017 Lightbend Inc. <http://www.lightbend.com/>
*/
package akka.typed
package akka.actor.typed
package internal
import scala.util.control.NonFatal
import akka.event.Logging
import akka.typed.Behavior.{ DeferredBehavior, undefer, validateAsInitial }
import akka.typed.Behavior.StoppedBehavior
import akka.actor.typed.Behavior.{ DeferredBehavior, undefer, validateAsInitial }
import akka.actor.typed.Behavior.StoppedBehavior
import akka.util.OptionVal
/**

View file

@ -1,7 +1,7 @@
/**
* Copyright (C) 2009-2017 Lightbend Inc. <http://www.lightbend.com>
*/
package akka.typed
package akka.actor.typed
package internal
import scala.annotation.tailrec
@ -183,7 +183,7 @@ private[typed] class EarliestFirstSystemMessageList(val head: SystemMessage) ext
*
* <b>NEVER SEND THE SAME SYSTEM MESSAGE OBJECT TO TWO ACTORS</b>
*/
private[typed] sealed trait SystemMessage extends Serializable {
private[akka] sealed trait SystemMessage extends Serializable {
// Next fields are only modifiable via the SystemMessageList value class
@transient
private[internal] var next: SystemMessage = _

View file

@ -1,7 +1,7 @@
/**
* Copyright (C) 2017 Lightbend Inc. <http://www.lightbend.com>
*/
package akka.typed
package akka.actor.typed
package internal
import scala.concurrent.duration.FiniteDuration
@ -11,11 +11,11 @@ import akka.annotation.ApiMayChange
import akka.annotation.DoNotInherit
import akka.annotation.InternalApi
import akka.dispatch.ExecutionContexts
import akka.typed.ActorRef
import akka.typed.ActorRef.ActorRefOps
import akka.typed.javadsl
import akka.typed.scaladsl
import akka.typed.scaladsl.ActorContext
import akka.actor.typed.ActorRef
import akka.actor.typed.ActorRef.ActorRefOps
import akka.actor.typed.javadsl
import akka.actor.typed.scaladsl
import akka.actor.typed.scaladsl.ActorContext
import scala.reflect.ClassTag
/**

View file

@ -1,7 +1,7 @@
/**
* Copyright (C) 2016-2017 Lightbend Inc. <http://www.lightbend.com/>
*/
package akka.typed
package akka.actor.typed
package internal
package adapter

View file

@ -1,7 +1,7 @@
/**
* Copyright (C) 2016-2017 Lightbend Inc. <http://www.lightbend.com/>
*/
package akka.typed
package akka.actor.typed
package internal
package adapter
@ -9,12 +9,12 @@ import akka.{ actor ⇒ a }
import scala.concurrent.duration._
import scala.concurrent.ExecutionContextExecutor
import akka.annotation.InternalApi
import akka.typed.Behavior.UntypedBehavior
import akka.actor.typed.Behavior.UntypedBehavior
/**
* INTERNAL API. Wrapping an [[akka.actor.ActorContext]] as an [[ActorContext]].
*/
@InternalApi private[typed] class ActorContextAdapter[T](val untyped: a.ActorContext) extends ActorContextImpl[T] {
@InternalApi private[akka] class ActorContextAdapter[T](val untyped: a.ActorContext) extends ActorContextImpl[T] {
import ActorRefAdapter.toUntyped

View file

@ -1,7 +1,7 @@
/**
* Copyright (C) 2016-2017 Lightbend Inc. <http://www.lightbend.com/>
*/
package akka.typed
package akka.actor.typed
package internal
package adapter
@ -26,7 +26,7 @@ import akka.dispatch.sysmsg
ActorRefAdapter.sendSystemMessage(untyped, signal)
}
private[typed] object ActorRefAdapter {
private[akka] object ActorRefAdapter {
def apply[T](untyped: a.ActorRef): ActorRef[T] = new ActorRefAdapter(untyped.asInstanceOf[a.InternalActorRef])
def toUntyped[U](ref: ActorRef[U]): akka.actor.InternalActorRef =

View file

@ -1,7 +1,7 @@
/**
* Copyright (C) 2016-2017 Lightbend Inc. <http://www.lightbend.com/>
*/
package akka.typed
package akka.actor.typed
package internal
package adapter
@ -13,6 +13,7 @@ import akka.util.Timeout
import scala.concurrent.Future
import akka.annotation.InternalApi
import akka.typed.EventStream
/**
* INTERNAL API. Lightweight wrapper for presenting an untyped ActorSystem to a Behavior (via the context).
@ -21,12 +22,12 @@ import akka.annotation.InternalApi
* a longer time; in all other cases the wrapper will just be spawned for a single call in
* most circumstances.
*/
@InternalApi private[typed] class ActorSystemAdapter[-T](val untyped: a.ActorSystemImpl)
@InternalApi private[akka] class ActorSystemAdapter[-T](val untyped: a.ActorSystemImpl)
extends ActorSystem[T] with ActorRef[T] with internal.ActorRefImpl[T] with ExtensionsImpl {
import ActorRefAdapter.sendSystemMessage
// Members declared in akka.typed.ActorRef
// Members declared in akka.actor.typed.ActorRef
override def tell(msg: T): Unit = {
if (msg == null) throw new InvalidMessageException("[null] is not an allowed message")
untyped.guardian ! msg
@ -37,7 +38,7 @@ import akka.annotation.InternalApi
override def toString: String = untyped.toString
// Members declared in akka.typed.ActorSystem
// Members declared in akka.actor.typed.ActorSystem
override def deadLetters[U]: ActorRef[U] = ActorRefAdapter(untyped.deadLetters)
override def dispatchers: Dispatchers = new Dispatchers {
override def lookup(selector: DispatcherSelector): ExecutionContextExecutor =
@ -67,9 +68,9 @@ import akka.annotation.InternalApi
import akka.dispatch.ExecutionContexts.sameThreadExecutionContext
override def terminate(): scala.concurrent.Future[akka.typed.Terminated] =
override def terminate(): scala.concurrent.Future[akka.actor.typed.Terminated] =
untyped.terminate().map(t Terminated(ActorRefAdapter(t.actor))(null))(sameThreadExecutionContext)
override lazy val whenTerminated: scala.concurrent.Future[akka.typed.Terminated] =
override lazy val whenTerminated: scala.concurrent.Future[akka.actor.typed.Terminated] =
untyped.whenTerminated.map(t Terminated(ActorRefAdapter(t.actor))(null))(sameThreadExecutionContext)
def systemActorOf[U](behavior: Behavior[U], name: String, props: Props)(implicit timeout: Timeout): Future[ActorRef[U]] = {
@ -79,7 +80,7 @@ import akka.annotation.InternalApi
}
private[typed] object ActorSystemAdapter {
private[akka] object ActorSystemAdapter {
def apply(untyped: a.ActorSystem): ActorSystem[Nothing] = AdapterExtension(untyped).adapter
// to make sure we do never create more than one adapter for the same actor system

View file

@ -1,12 +1,13 @@
/**
* Copyright (C) 2016-2017 Lightbend Inc. <http://www.lightbend.com/>
*/
package akka.typed
package akka.actor.typed
package internal
package adapter
import akka.{ event e }
import akka.annotation.InternalApi
import akka.typed.EventStream
/**
* INTERNAL API

View file

@ -1,13 +1,13 @@
/**
* Copyright (C) 2017 Lightbend Inc. <http://www.lightbend.com>
*/
package akka.typed
package akka.actor.typed
package internal
package adapter
import akka.typed.Behavior
import akka.typed.EmptyProps
import akka.typed.Props
import akka.actor.typed.Behavior
import akka.actor.typed.EmptyProps
import akka.actor.typed.Props
import akka.annotation.InternalApi
/**

View file

@ -1,34 +1,32 @@
/**
* Copyright (C) 2009-2017 Lightbend Inc. <http://www.lightbend.com>
*/
package akka.typed.internal.receptionist
package akka.actor.typed.internal.receptionist
import akka.annotation.InternalApi
import akka.typed.ActorRef
import akka.typed.Behavior
import akka.typed.Terminated
import akka.typed.receptionist.Receptionist._
import akka.typed.scaladsl.Actor
import akka.typed.scaladsl.Actor.immutable
import akka.typed.scaladsl.Actor.same
import akka.typed.scaladsl.ActorContext
import akka.actor.typed.ActorRef
import akka.actor.typed.Behavior
import akka.actor.typed.Terminated
import akka.actor.typed.receptionist.Receptionist._
import akka.actor.typed.scaladsl.Actor
import akka.actor.typed.scaladsl.Actor.immutable
import akka.actor.typed.scaladsl.Actor.same
import akka.actor.typed.scaladsl.ActorContext
import akka.util.TypedMultiMap
import scala.reflect.ClassTag
/**
* Marker interface to use with dynamic access
*
* Internal API
*/
@InternalApi
private[typed] trait ReceptionistBehaviorProvider {
private[akka] trait ReceptionistBehaviorProvider {
def behavior: Behavior[Command]
}
/** Internal API */
@InternalApi
private[typed] object ReceptionistImpl extends ReceptionistBehaviorProvider {
private[akka] object ReceptionistImpl extends ReceptionistBehaviorProvider {
// FIXME: make sure to provide serializer
final case class DefaultServiceKey[T](id: String, typeName: String) extends ServiceKey[T] {
override def toString: String = s"ServiceKey[$typeName]($id)"
@ -63,7 +61,7 @@ private[typed] object ReceptionistImpl extends ReceptionistBehaviorProvider {
type SubscriptionsKV[K <: AbstractServiceKey] = ActorRef[Listing[K#Protocol]]
type SubscriptionRegistry = TypedMultiMap[AbstractServiceKey, SubscriptionsKV]
private[typed] def init(externalInterfaceFactory: ActorContext[AllCommands] ExternalInterface): Behavior[Command] =
private[akka] def init(externalInterfaceFactory: ActorContext[AllCommands] ExternalInterface): Behavior[Command] =
Actor.deferred[AllCommands] { ctx
val externalInterface = externalInterfaceFactory(ctx)
behavior(

View file

@ -1,7 +1,7 @@
/**
* Copyright (C) 2017 Lightbend Inc. <http://www.lightbend.com>
*/
package akka.typed.javadsl
package akka.actor.typed.javadsl
import java.util.function.{ Function JFunction }
@ -12,16 +12,16 @@ import akka.japi.function.{ Function2 ⇒ JapiFunction2 }
import akka.japi.function.{ Procedure, Procedure2 }
import akka.japi.pf.PFBuilder
import akka.typed.Behavior
import akka.typed.ExtensibleBehavior
import akka.typed.Signal
import akka.typed.ActorRef
import akka.typed.SupervisorStrategy
import akka.typed.scaladsl.{ ActorContext SAC }
import akka.actor.typed.Behavior
import akka.actor.typed.ExtensibleBehavior
import akka.actor.typed.Signal
import akka.actor.typed.ActorRef
import akka.actor.typed.SupervisorStrategy
import akka.actor.typed.scaladsl.{ ActorContext SAC }
import akka.typed.internal.BehaviorImpl
import akka.typed.internal.Restarter
import akka.typed.internal.TimerSchedulerImpl
import akka.actor.typed.internal.BehaviorImpl
import akka.actor.typed.internal.Restarter
import akka.actor.typed.internal.TimerSchedulerImpl
object Actor {
@ -79,11 +79,11 @@ object Actor {
}
@throws(classOf[Exception])
override final def receiveMessage(ctx: akka.typed.ActorContext[T], msg: T): Behavior[T] =
override final def receiveMessage(ctx: akka.actor.typed.ActorContext[T], msg: T): Behavior[T] =
receive.receiveMessage(msg)
@throws(classOf[Exception])
override final def receiveSignal(ctx: akka.typed.ActorContext[T], msg: Signal): Behavior[T] =
override final def receiveSignal(ctx: akka.actor.typed.ActorContext[T], msg: Signal): Behavior[T] =
receive.receiveSignal(msg)
def createReceive: Receive[T]
@ -142,7 +142,7 @@ object Actor {
/**
* Construct an actor behavior that can react to incoming messages but not to
* lifecycle signals. After spawning this actor from another actor (or as the
* guardian of an [[akka.typed.ActorSystem]]) it will be executed within an
* guardian of an [[akka.actor.typed.ActorSystem]]) it will be executed within an
* [[ActorContext]] that allows access to the system, spawning and watching
* other actors, etc.
*
@ -158,7 +158,7 @@ object Actor {
/**
* Construct an actor behavior that can react to both incoming messages and
* lifecycle signals. After spawning this actor from another actor (or as the
* guardian of an [[akka.typed.ActorSystem]]) it will be executed within an
* guardian of an [[akka.actor.typed.ActorSystem]]) it will be executed within an
* [[ActorContext]] that allows access to the system, spawning and watching
* other actors, etc.
*
@ -217,7 +217,7 @@ object Actor {
/**
* Behavior decorator that copies all received message to the designated
* monitor [[akka.typed.ActorRef]] before invoking the wrapped behavior. The
* monitor [[akka.actor.typed.ActorRef]] before invoking the wrapped behavior. The
* wrapped behavior can evolve (i.e. return different behavior) without needing to be
* wrapped in a `monitor` call again.
*/
@ -263,7 +263,7 @@ object Actor {
* Only exceptions of the given type (and their subclasses) will be handled by this supervision behavior.
*/
def onFailure[Thr <: Throwable](clazz: Class[Thr], strategy: SupervisorStrategy): Behavior[T] =
akka.typed.internal.Restarter(Behavior.validateAsInitial(wrapped), strategy)(ClassTag(clazz))
akka.actor.typed.internal.Restarter(Behavior.validateAsInitial(wrapped), strategy)(ClassTag(clazz))
/**
* Specify the [[SupervisorStrategy]] to be invoked when the wrapped behaior throws.

View file

@ -1,16 +1,16 @@
/**
* Copyright (C) 2017 Lightbend Inc. <http://www.lightbend.com>
*/
package akka.typed.javadsl
package akka.actor.typed.javadsl
import java.util.function.{ Function JFunction }
import akka.annotation.DoNotInherit
import akka.annotation.ApiMayChange
import akka.typed.ActorRef
import akka.typed.ActorSystem
import akka.actor.typed.ActorRef
import akka.actor.typed.ActorSystem
import java.util.Optional
import akka.typed.Behavior
import akka.typed.Props
import akka.actor.typed.Behavior
import akka.actor.typed.Props
import scala.concurrent.duration.FiniteDuration
import scala.concurrent.ExecutionContextExecutor
@ -40,7 +40,7 @@ trait ActorContext[T] {
/**
* Get the `scaladsl` of this `ActorContext`.
*/
def asScala: akka.typed.scaladsl.ActorContext[T]
def asScala: akka.actor.typed.scaladsl.ActorContext[T]
/**
* The identity of this Actor, bound to the lifecycle of this Actor instance.
@ -71,24 +71,24 @@ trait ActorContext[T] {
def getChild(name: String): Optional[ActorRef[Void]]
/**
* Create a child Actor from the given [[akka.typed.Behavior]] under a randomly chosen name.
* Create a child Actor from the given [[akka.actor.typed.Behavior]] under a randomly chosen name.
* It is good practice to name Actors wherever practical.
*/
def spawnAnonymous[U](behavior: Behavior[U]): ActorRef[U]
/**
* Create a child Actor from the given [[akka.typed.Behavior]] under a randomly chosen name.
* Create a child Actor from the given [[akka.actor.typed.Behavior]] under a randomly chosen name.
* It is good practice to name Actors wherever practical.
*/
def spawnAnonymous[U](behavior: Behavior[U], props: Props): ActorRef[U]
/**
* Create a child Actor from the given [[akka.typed.Behavior]] and with the given name.
* Create a child Actor from the given [[akka.actor.typed.Behavior]] and with the given name.
*/
def spawn[U](behavior: Behavior[U], name: String): ActorRef[U]
/**
* Create a child Actor from the given [[akka.typed.Behavior]] and with the given name.
* Create a child Actor from the given [[akka.actor.typed.Behavior]] and with the given name.
*/
def spawn[U](behavior: Behavior[U], name: String, props: Props): ActorRef[U]

View file

@ -1,22 +1,22 @@
/**
* Copyright (C) 2017 Lightbend Inc. <http://www.lightbend.com>
*/
package akka.typed.javadsl
package akka.actor.typed.javadsl
import akka.typed.Behavior
import akka.typed.Props
import akka.typed.EmptyProps
import akka.typed.ActorRef
import akka.typed.internal.adapter.ActorRefAdapter
import akka.typed.scaladsl.adapter._
import akka.typed.ActorSystem
import akka.typed.internal.adapter.ActorContextAdapter
import akka.actor.typed.Behavior
import akka.actor.typed.Props
import akka.actor.typed.EmptyProps
import akka.actor.typed.ActorRef
import akka.actor.typed.internal.adapter.ActorRefAdapter
import akka.actor.typed.scaladsl.adapter._
import akka.actor.typed.ActorSystem
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.typed.Behavior]] on an emulation layer. In this
* which runs Akka Typed [[akka.actor.typed.Behavior]] on an emulation layer. In this
* system typed and untyped actors can coexist.
*
* These methods make it possible to create typed child actor from untyped
@ -24,8 +24,8 @@ import akka.japi.Creator
* `watch` is also supported in both directions.
*
* There are also converters (`toTyped`, `toUntyped`) between untyped
* [[akka.actor.ActorRef]] and typed [[akka.typed.ActorRef]], and between untyped
* [[akka.actor.ActorSystem]] and typed [[akka.typed.ActorSystem]].
* [[akka.actor.ActorRef]] and typed [[akka.actor.typed.ActorRef]], and between untyped
* [[akka.actor.ActorSystem]] and typed [[akka.actor.typed.ActorSystem]].
*/
object Adapter {
@ -90,7 +90,7 @@ object Adapter {
ref
/**
* Wrap [[akka.typed.Behavior]] in an untyped [[akka.actor.Props]], i.e. when
* Wrap [[akka.actor.typed.Behavior]] in an untyped [[akka.actor.Props]], i.e. when
* spawning a typed child actor from an untyped 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
@ -99,10 +99,10 @@ object Adapter {
* example of that.
*/
def props[T](behavior: Creator[Behavior[T]], deploy: Props): akka.actor.Props =
akka.typed.internal.adapter.PropsAdapter(() behavior.create(), deploy)
akka.actor.typed.internal.adapter.PropsAdapter(() behavior.create(), deploy)
/**
* Wrap [[akka.typed.Behavior]] in an untyped [[akka.actor.Props]], i.e. when
* Wrap [[akka.actor.typed.Behavior]] in an untyped [[akka.actor.Props]], i.e. when
* spawning a typed child actor from an untyped 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

View file

@ -1,4 +1,4 @@
package akka.typed
package akka.actor.typed
package javadsl
import java.util.concurrent.CompletionStage

View file

@ -2,16 +2,16 @@
* Copyright (C) 2009-2017 Lightbend Inc. <http://www.lightbend.com>
*/
package akka.typed.javadsl
package akka.actor.typed.javadsl
import scala.annotation.tailrec
import akka.japi.function.{ Function, Function2, Predicate }
import akka.annotation.InternalApi
import akka.typed
import akka.typed.{ Behavior, ExtensibleBehavior, Signal }
import akka.actor.typed
import akka.actor.typed.{ Behavior, ExtensibleBehavior, Signal }
import akka.typed.Behavior.unhandled
import akka.actor.typed.Behavior.unhandled
import BehaviorBuilder._

View file

@ -2,12 +2,12 @@
* Copyright (C) 2009-2017 Lightbend Inc. <http://www.lightbend.com>
*/
package akka.typed.javadsl
package akka.actor.typed.javadsl
import scala.annotation.tailrec
import akka.japi.function.{ Creator, Function, Predicate }
import akka.typed.javadsl.Actor.Receive
import akka.typed.{ Behavior, Signal }
import akka.actor.typed.javadsl.Actor.Receive
import akka.actor.typed.{ Behavior, Signal }
import ReceiveBuilder._
import akka.annotation.InternalApi

View file

@ -1,7 +1,7 @@
/**
* Copyright (C) 2017 Lightbend Inc. <http://www.lightbend.com>
*/
package akka.typed.javadsl
package akka.actor.typed.javadsl
import scala.concurrent.duration.FiniteDuration

View file

@ -1,16 +1,16 @@
package akka
package akka.actor
import akka.typed.internal.ActorRefImpl
import akka.actor.typed.internal.ActorRefImpl
package object typed {
/*
* These are safe due to the self-type of ActorRef
*/
private[typed] implicit class ToImpl[U](val ref: ActorRef[U]) extends AnyVal {
private[akka] implicit class ToImpl[U](val ref: ActorRef[U]) extends AnyVal {
def sorry: ActorRefImpl[U] = ref.asInstanceOf[ActorRefImpl[U]]
}
// This one is necessary because Scala refuses to infer Nothing
private[typed] implicit class ToImplNothing(val ref: ActorRef[Nothing]) extends AnyVal {
private[akka] implicit class ToImplNothing(val ref: ActorRef[Nothing]) extends AnyVal {
def sorryForNothing: ActorRefImpl[Nothing] = ref.asInstanceOf[ActorRefImpl[Nothing]]
}
}

View file

@ -1,15 +1,15 @@
/**
* Copyright (C) 2009-2017 Lightbend Inc. <http://www.lightbend.com>
*/
package akka.typed.receptionist
package akka.actor.typed.receptionist
import akka.annotation.InternalApi
import akka.typed.ActorRef
import akka.typed.ActorSystem
import akka.typed.Extension
import akka.typed.ExtensionId
import akka.typed.internal.receptionist.ReceptionistBehaviorProvider
import akka.typed.internal.receptionist.ReceptionistImpl
import akka.actor.typed.ActorRef
import akka.actor.typed.ActorSystem
import akka.actor.typed.Extension
import akka.actor.typed.ExtensionId
import akka.actor.typed.internal.receptionist.ReceptionistBehaviorProvider
import akka.actor.typed.internal.receptionist.ReceptionistImpl
import scala.collection.JavaConverters._
import scala.concurrent.duration._
@ -24,7 +24,7 @@ class Receptionist(system: ActorSystem[_]) extends Extension {
val behavior =
if (hasCluster)
system.dynamicAccess
.createInstanceFor[ReceptionistBehaviorProvider]("akka.typed.cluster.internal.receptionist.ClusterReceptionist$", Nil)
.createInstanceFor[ReceptionistBehaviorProvider]("akka.cluster.typed.internal.receptionist.ClusterReceptionist$", Nil)
.recover {
case ex
system.log.error(
@ -62,7 +62,7 @@ object Receptionist extends ExtensionId[Receptionist] {
* Internal API
*/
@InternalApi
private[typed] sealed abstract class AbstractServiceKey {
private[akka] sealed abstract class AbstractServiceKey {
type Protocol
/** Type-safe down-cast */
@ -98,7 +98,7 @@ object Receptionist extends ExtensionId[Receptionist] {
/** Internal superclass for external and internal commands */
@InternalApi
sealed private[typed] abstract class AllCommands
sealed private[akka] abstract class AllCommands
/**
* The set of commands accepted by a Receptionist.
@ -108,7 +108,7 @@ object Receptionist extends ExtensionId[Receptionist] {
private[typed] abstract class InternalCommand extends AllCommands
/**
* Associate the given [[akka.typed.ActorRef]] with the given [[ServiceKey]]. Multiple
* Associate the given [[akka.actor.typed.ActorRef]] with the given [[ServiceKey]]. Multiple
* registrations can be made for the same key. Unregistration is implied by
* the end of the referenced Actors lifecycle.
*
@ -122,7 +122,7 @@ object Receptionist extends ExtensionId[Receptionist] {
}
/**
* Confirmation that the given [[akka.typed.ActorRef]] has been associated with the [[ServiceKey]].
* Confirmation that the given [[akka.actor.typed.ActorRef]] has been associated with the [[ServiceKey]].
*/
final case class Registered[T](key: ServiceKey[T], serviceInstance: ActorRef[T])

View file

@ -1,11 +1,11 @@
/**
* Copyright (C) 2017 Lightbend Inc. <http://www.lightbend.com/>
*/
package akka.typed
package akka.actor.typed
package scaladsl
import akka.annotation.{ ApiMayChange, InternalApi }
import akka.typed.internal.{ BehaviorImpl, Supervisor, TimerSchedulerImpl }
import akka.actor.typed.internal.{ BehaviorImpl, Supervisor, TimerSchedulerImpl }
import scala.reflect.ClassTag
import scala.util.control.Exception.Catcher
@ -38,7 +38,7 @@ object Actor {
/**
* `deferred` is a factory for a behavior. Creation of the behavior instance is deferred until
* the actor is started, as opposed to `Actor.immutable` that creates the behavior instance
* the actor is started, as opposed to [[Actor.immutable]] that creates the behavior instance
* immediately before the actor is running. The `factory` function pass the `ActorContext`
* as parameter and that can for example be used for spawning child actors.
*
@ -78,7 +78,7 @@ object Actor {
*/
abstract class MutableBehavior[T] extends ExtensibleBehavior[T] {
@throws(classOf[Exception])
override final def receiveMessage(ctx: akka.typed.ActorContext[T], msg: T): Behavior[T] =
override final def receiveMessage(ctx: akka.actor.typed.ActorContext[T], msg: T): Behavior[T] =
onMessage(msg)
/**
@ -96,11 +96,11 @@ object Actor {
def onMessage(msg: T): Behavior[T]
@throws(classOf[Exception])
override final def receiveSignal(ctx: akka.typed.ActorContext[T], msg: Signal): Behavior[T] =
override final def receiveSignal(ctx: akka.actor.typed.ActorContext[T], msg: Signal): Behavior[T] =
onSignal.applyOrElse(msg, { case _ Behavior.unhandled }: PartialFunction[Signal, Behavior[T]])
/**
* Override this method to process an incoming [[akka.typed.Signal]] and return the next behavior.
* Override this method to process an incoming [[akka.actor.typed.Signal]] and return the next behavior.
* This means that all lifecycle hooks, ReceiveTimeout, Terminated and Failed messages
* can initiate a behavior change.
*
@ -167,7 +167,7 @@ object Actor {
/**
* Construct an actor behavior that can react to both incoming messages and
* lifecycle signals. After spawning this actor from another actor (or as the
* guardian of an [[akka.typed.ActorSystem]]) it will be executed within an
* guardian of an [[akka.actor.typed.ActorSystem]]) it will be executed within an
* [[ActorContext]] that allows access to the system, spawning and watching
* other actors, etc.
*
@ -210,7 +210,7 @@ object Actor {
/**
* Behavior decorator that copies all received message to the designated
* monitor [[akka.typed.ActorRef]] before invoking the wrapped behavior. The
* monitor [[akka.actor.typed.ActorRef]] before invoking the wrapped behavior. The
* wrapped behavior can evolve (i.e. return different behavior) without needing to be
* wrapped in a `monitor` call again.
*/
@ -251,7 +251,7 @@ object Actor {
def onFailure[Thr <: Throwable: ClassTag](strategy: SupervisorStrategy): Behavior[T] = {
val tag = implicitly[ClassTag[Thr]]
val effectiveTag = if (tag == NothingClassTag) ThrowableClassTag else tag
akka.typed.internal.Restarter(Behavior.validateAsInitial(wrapped), strategy)(effectiveTag)
akka.actor.typed.internal.Restarter(Behavior.validateAsInitial(wrapped), strategy)(effectiveTag)
}
}

View file

@ -1,18 +1,18 @@
/**
* Copyright (C) 2017 Lightbend Inc. <http://www.lightbend.com>
*/
package akka.typed.scaladsl
package akka.actor.typed.scaladsl
import scala.concurrent.ExecutionContextExecutor
import scala.concurrent.duration.FiniteDuration
import akka.annotation.ApiMayChange
import akka.annotation.DoNotInherit
import akka.typed.ActorRef
import akka.typed.ActorSystem
import akka.typed.Behavior
import akka.typed.Props
import akka.typed.EmptyProps
import akka.actor.typed.ActorRef
import akka.actor.typed.ActorSystem
import akka.actor.typed.Behavior
import akka.actor.typed.Props
import akka.actor.typed.EmptyProps
/**
* An Actor is given by the combination of a [[Behavior]] and a context in
@ -34,12 +34,12 @@ import akka.typed.EmptyProps
*/
@DoNotInherit
@ApiMayChange
trait ActorContext[T] { this: akka.typed.javadsl.ActorContext[T]
trait ActorContext[T] { this: akka.actor.typed.javadsl.ActorContext[T]
/**
* Get the `javadsl` of this `ActorContext`.
*/
def asJava: akka.typed.javadsl.ActorContext[T]
def asJava: akka.actor.typed.javadsl.ActorContext[T]
/**
* The identity of this Actor, bound to the lifecycle of this Actor instance.
@ -70,13 +70,13 @@ trait ActorContext[T] { this: akka.typed.javadsl.ActorContext[T] ⇒
def child(name: String): Option[ActorRef[Nothing]]
/**
* Create a child Actor from the given [[akka.typed.Behavior]] under a randomly chosen name.
* Create a child Actor from the given [[akka.actor.typed.Behavior]] under a randomly chosen name.
* It is good practice to name Actors wherever practical.
*/
def spawnAnonymous[U](behavior: Behavior[U], props: Props = Props.empty): ActorRef[U]
/**
* Create a child Actor from the given [[akka.typed.Behavior]] and with the given name.
* Create a child Actor from the given [[akka.actor.typed.Behavior]] and with the given name.
*/
def spawn[U](behavior: Behavior[U], name: String, props: Props = Props.empty): ActorRef[U]

View file

@ -1,7 +1,7 @@
/**
* Copyright (C) 2014-2017 Lightbend Inc. <http://www.lightbend.com>
*/
package akka.typed.scaladsl
package akka.actor.typed.scaladsl
import scala.concurrent.{ Future, Promise }
import akka.util.Timeout
@ -9,12 +9,12 @@ import akka.actor.InternalActorRef
import akka.pattern.AskTimeoutException
import akka.pattern.PromiseActorRef
import akka.actor.Scheduler
import akka.typed.internal.FunctionRef
import akka.actor.typed.internal.FunctionRef
import akka.actor.RootActorPath
import akka.actor.Address
import akka.annotation.InternalApi
import akka.typed.ActorRef
import akka.typed.internal.{ adapter adapt }
import akka.actor.typed.ActorRef
import akka.actor.typed.internal.{ adapter adapt }
/**
* The ask-pattern implements the initiator side of a requestreply protocol.
@ -106,7 +106,7 @@ object AskPattern {
AskPath,
(msg, self) {
p.trySuccess(msg)
self.sendSystem(akka.typed.internal.Terminate())
self.sendSystem(akka.actor.typed.internal.Terminate())
},
(self) if (!p.isCompleted) p.tryFailure(new NoSuchElementException("ask pattern terminated before value was received")))
actorRef ! f(ref)
@ -118,5 +118,5 @@ object AskPattern {
}(ec)
}
private[typed] val AskPath = RootActorPath(Address("akka.typed.internal", "ask"))
private[typed] val AskPath = RootActorPath(Address("akka.actor.typed.internal", "ask"))
}

View file

@ -1,7 +1,7 @@
/**
* Copyright (C) 2017 Lightbend Inc. <http://www.lightbend.com>
*/
package akka.typed.scaladsl
package akka.actor.typed.scaladsl
import scala.concurrent.duration.FiniteDuration

View file

@ -1,11 +1,11 @@
/**
* Copyright (C) 2009-2017 Lightbend Inc. <http://www.lightbend.com>
*/
package akka.typed.scaladsl.adapter
package akka.actor.typed.scaladsl.adapter
import akka.actor.ExtendedActorSystem
import akka.annotation.InternalApi
import akka.typed.internal.adapter.ActorSystemAdapter
import akka.actor.typed.internal.adapter.ActorSystemAdapter
/**
* Internal API

View file

@ -1,15 +1,15 @@
/**
* Copyright (C) 2017 Lightbend Inc. <http://www.lightbend.com>
*/
package akka.typed.scaladsl.adapter
package akka.actor.typed.scaladsl.adapter
import akka.typed.Behavior
import akka.typed.EmptyProps
import akka.typed.Props
import akka.typed.internal.adapter.ActorAdapter
import akka.actor.typed.Behavior
import akka.actor.typed.EmptyProps
import akka.actor.typed.Props
import akka.actor.typed.internal.adapter.ActorAdapter
/**
* Wrap [[akka.typed.Behavior]] in an untyped [[akka.actor.Props]], i.e. when
* Wrap [[akka.actor.typed.Behavior]] in an untyped [[akka.actor.Props]], i.e. when
* spawning a typed child actor from an untyped 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
@ -19,5 +19,5 @@ import akka.typed.internal.adapter.ActorAdapter
*/
object PropsAdapter {
def apply[T](behavior: Behavior[T], deploy: Props = Props.empty): akka.actor.Props =
akka.typed.internal.adapter.PropsAdapter(() behavior, deploy)
akka.actor.typed.internal.adapter.PropsAdapter(() behavior, deploy)
}

View file

@ -1,19 +1,19 @@
/**
* Copyright (C) 2016-2017 Lightbend Inc. <http://www.lightbend.com/>
*/
package akka.typed
package akka.actor.typed
package scaladsl
import akka.typed.Behavior.UntypedBehavior
import akka.typed.internal.adapter._
import akka.actor.typed.Behavior.UntypedBehavior
import akka.actor.typed.internal.adapter._
/**
* Scala API: Adapters between typed and untyped actors and actor systems.
* The underlying `ActorSystem` is the untyped [[akka.actor.ActorSystem]]
* which runs Akka Typed [[akka.typed.Behavior]] on an emulation layer. In this
* which runs Akka Typed [[akka.actor.typed.Behavior]] on an emulation layer. In this
* system typed and untyped actors can coexist.
*
* Use these adapters with `import akka.typed.scaladsl.adapter._`.
* Use these adapters with `import akka.actor.typed.scaladsl.adapter._`.
*
* Implicit extension methods are added to untyped and typed `ActorSystem`,
* `ActorContext`. Such methods make it possible to create typed child actor
@ -21,11 +21,11 @@ import akka.typed.internal.adapter._
* `watch` is also supported in both directions.
*
* There is an implicit conversion from untyped [[akka.actor.ActorRef]] to
* typed [[akka.typed.ActorRef]].
* typed [[akka.actor.typed.ActorRef]].
*
* There are also converters (`toTyped`, `toUntyped`) from typed
* [[akka.typed.ActorRef]] to untyped [[akka.actor.ActorRef]], and between untyped
* [[akka.actor.ActorSystem]] and typed [[akka.typed.ActorSystem]].
* [[akka.actor.typed.ActorRef]] to untyped [[akka.actor.ActorRef]], and between untyped
* [[akka.actor.ActorSystem]] and typed [[akka.actor.typed.ActorSystem]].
*/
package object adapter {
@ -58,7 +58,7 @@ package object adapter {
}
/**
* Extension methods added to [[akka.typed.ActorSystem]].
* Extension methods added to [[akka.actor.typed.ActorSystem]].
*/
implicit class TypedActorSystemOps(val sys: ActorSystem[_]) extends AnyVal {
def toUntyped: akka.actor.ActorSystem = ActorSystemAdapter.toUntyped(sys)
@ -81,7 +81,7 @@ package object adapter {
}
/**
* Extension methods added to [[akka.typed.scaladsl.ActorContext]].
* Extension methods added to [[akka.actor.typed.scaladsl.ActorContext]].
*/
implicit class TypedActorContextOps(val ctx: scaladsl.ActorContext[_]) extends AnyVal {
def actorOf(props: akka.actor.Props): akka.actor.ActorRef =
@ -93,14 +93,14 @@ package object adapter {
}
/**
* Extension methods added to [[akka.typed.ActorRef]].
* Extension methods added to [[akka.actor.typed.ActorRef]].
*/
implicit class TypedActorRefOps(val ref: ActorRef[_]) extends AnyVal {
def toUntyped: akka.actor.ActorRef = ActorRefAdapter.toUntyped(ref)
}
/**
* Implicit conversion from untyped [[akka.actor.ActorRef]] to typed [[akka.typed.ActorRef]].
* Implicit conversion from untyped [[akka.actor.ActorRef]] to typed [[akka.actor.typed.ActorRef]].
*/
implicit def actorRefAdapter[T](ref: akka.actor.ActorRef): ActorRef[T] = ActorRefAdapter(ref)

View file

@ -1,10 +1,7 @@
/**
* Copyright (C) 2016-2017 Lightbend Inc. <http://www.lightbend.com/>
*/
package akka.typed
import akka.{ event e }
import akka.event.Logging.{ LogEvent, LogLevel, StdOutLogger }
import akka.actor.typed.ActorRef
import akka.event.Logging.LogLevel
/**
* An EventStream allows local actors to register for certain message types, including
@ -53,6 +50,10 @@ trait EventStream {
def setLogLevel(loglevel: LogLevel): Unit
}
import akka.actor.typed.{ ActorRef, Behavior, Settings }
import akka.{ event e }
import akka.event.Logging.{ LogEvent, StdOutLogger }
abstract class Logger {
def initialBehavior: Behavior[Logger.Command]
}
@ -68,7 +69,7 @@ class DefaultLogger extends Logger with StdOutLogger {
val initialBehavior = {
// TODO avoid depending on dsl here?
import scaladsl.Actor._
import akka.actor.typed.scaladsl.Actor._
deferred[Command] { _
immutable[Command] {
case (ctx, Initialize(eventStream, replyTo))

View file

@ -232,7 +232,7 @@ object StandardMetrics {
* INTERNAL API
*
* Encapsulates evaluation of validity of metric values, conversion of an actual metric value to
* a [[akka.cluster.Metric]] for consumption by subscribed cluster entities.
* a [[akka.cluster.metrics.Metric]] for consumption by subscribed cluster entities.
*/
private[metrics] trait MetricNumericConverter {

View file

@ -1,7 +1,7 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: ShardingMessages.proto
package akka.typed.cluster.sharding.internal.protobuf;
package akka.cluster.sharding.typed.internal.protobuf;
public final class ShardingMessages {
private ShardingMessages() {}
@ -41,7 +41,7 @@ public final class ShardingMessages {
akka.remote.ContainerFormats.PayloadOrBuilder getMessageOrBuilder();
}
/**
* Protobuf type {@code akka.typed.cluster.sharding.ShardingEnvelope}
* Protobuf type {@code akka.cluster.sharding.typed.ShardingEnvelope}
*/
public static final class ShardingEnvelope extends
akka.protobuf.GeneratedMessage
@ -123,14 +123,14 @@ public final class ShardingMessages {
}
public static final akka.protobuf.Descriptors.Descriptor
getDescriptor() {
return akka.typed.cluster.sharding.internal.protobuf.ShardingMessages.internal_static_akka_typed_cluster_sharding_ShardingEnvelope_descriptor;
return akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.internal_static_akka_cluster_sharding_typed_ShardingEnvelope_descriptor;
}
protected akka.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return akka.typed.cluster.sharding.internal.protobuf.ShardingMessages.internal_static_akka_typed_cluster_sharding_ShardingEnvelope_fieldAccessorTable
return akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.internal_static_akka_cluster_sharding_typed_ShardingEnvelope_fieldAccessorTable
.ensureFieldAccessorsInitialized(
akka.typed.cluster.sharding.internal.protobuf.ShardingMessages.ShardingEnvelope.class, akka.typed.cluster.sharding.internal.protobuf.ShardingMessages.ShardingEnvelope.Builder.class);
akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.ShardingEnvelope.class, akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.ShardingEnvelope.Builder.class);
}
public static akka.protobuf.Parser<ShardingEnvelope> PARSER =
@ -275,53 +275,53 @@ public final class ShardingMessages {
return super.writeReplace();
}
public static akka.typed.cluster.sharding.internal.protobuf.ShardingMessages.ShardingEnvelope parseFrom(
public static akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.ShardingEnvelope parseFrom(
akka.protobuf.ByteString data)
throws akka.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static akka.typed.cluster.sharding.internal.protobuf.ShardingMessages.ShardingEnvelope parseFrom(
public static akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.ShardingEnvelope parseFrom(
akka.protobuf.ByteString data,
akka.protobuf.ExtensionRegistryLite extensionRegistry)
throws akka.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static akka.typed.cluster.sharding.internal.protobuf.ShardingMessages.ShardingEnvelope parseFrom(byte[] data)
public static akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.ShardingEnvelope parseFrom(byte[] data)
throws akka.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static akka.typed.cluster.sharding.internal.protobuf.ShardingMessages.ShardingEnvelope parseFrom(
public static akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.ShardingEnvelope parseFrom(
byte[] data,
akka.protobuf.ExtensionRegistryLite extensionRegistry)
throws akka.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static akka.typed.cluster.sharding.internal.protobuf.ShardingMessages.ShardingEnvelope parseFrom(java.io.InputStream input)
public static akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.ShardingEnvelope parseFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static akka.typed.cluster.sharding.internal.protobuf.ShardingMessages.ShardingEnvelope parseFrom(
public static akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.ShardingEnvelope parseFrom(
java.io.InputStream input,
akka.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static akka.typed.cluster.sharding.internal.protobuf.ShardingMessages.ShardingEnvelope parseDelimitedFrom(java.io.InputStream input)
public static akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.ShardingEnvelope parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input);
}
public static akka.typed.cluster.sharding.internal.protobuf.ShardingMessages.ShardingEnvelope parseDelimitedFrom(
public static akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.ShardingEnvelope parseDelimitedFrom(
java.io.InputStream input,
akka.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input, extensionRegistry);
}
public static akka.typed.cluster.sharding.internal.protobuf.ShardingMessages.ShardingEnvelope parseFrom(
public static akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.ShardingEnvelope parseFrom(
akka.protobuf.CodedInputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static akka.typed.cluster.sharding.internal.protobuf.ShardingMessages.ShardingEnvelope parseFrom(
public static akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.ShardingEnvelope parseFrom(
akka.protobuf.CodedInputStream input,
akka.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
@ -330,7 +330,7 @@ public final class ShardingMessages {
public static Builder newBuilder() { return Builder.create(); }
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder(akka.typed.cluster.sharding.internal.protobuf.ShardingMessages.ShardingEnvelope prototype) {
public static Builder newBuilder(akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.ShardingEnvelope prototype) {
return newBuilder().mergeFrom(prototype);
}
public Builder toBuilder() { return newBuilder(this); }
@ -342,24 +342,24 @@ public final class ShardingMessages {
return builder;
}
/**
* Protobuf type {@code akka.typed.cluster.sharding.ShardingEnvelope}
* Protobuf type {@code akka.cluster.sharding.typed.ShardingEnvelope}
*/
public static final class Builder extends
akka.protobuf.GeneratedMessage.Builder<Builder>
implements akka.typed.cluster.sharding.internal.protobuf.ShardingMessages.ShardingEnvelopeOrBuilder {
implements akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.ShardingEnvelopeOrBuilder {
public static final akka.protobuf.Descriptors.Descriptor
getDescriptor() {
return akka.typed.cluster.sharding.internal.protobuf.ShardingMessages.internal_static_akka_typed_cluster_sharding_ShardingEnvelope_descriptor;
return akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.internal_static_akka_cluster_sharding_typed_ShardingEnvelope_descriptor;
}
protected akka.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return akka.typed.cluster.sharding.internal.protobuf.ShardingMessages.internal_static_akka_typed_cluster_sharding_ShardingEnvelope_fieldAccessorTable
return akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.internal_static_akka_cluster_sharding_typed_ShardingEnvelope_fieldAccessorTable
.ensureFieldAccessorsInitialized(
akka.typed.cluster.sharding.internal.protobuf.ShardingMessages.ShardingEnvelope.class, akka.typed.cluster.sharding.internal.protobuf.ShardingMessages.ShardingEnvelope.Builder.class);
akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.ShardingEnvelope.class, akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.ShardingEnvelope.Builder.class);
}
// Construct using akka.typed.cluster.sharding.internal.protobuf.ShardingMessages.ShardingEnvelope.newBuilder()
// Construct using akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.ShardingEnvelope.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
@ -397,23 +397,23 @@ public final class ShardingMessages {
public akka.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return akka.typed.cluster.sharding.internal.protobuf.ShardingMessages.internal_static_akka_typed_cluster_sharding_ShardingEnvelope_descriptor;
return akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.internal_static_akka_cluster_sharding_typed_ShardingEnvelope_descriptor;
}
public akka.typed.cluster.sharding.internal.protobuf.ShardingMessages.ShardingEnvelope getDefaultInstanceForType() {
return akka.typed.cluster.sharding.internal.protobuf.ShardingMessages.ShardingEnvelope.getDefaultInstance();
public akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.ShardingEnvelope getDefaultInstanceForType() {
return akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.ShardingEnvelope.getDefaultInstance();
}
public akka.typed.cluster.sharding.internal.protobuf.ShardingMessages.ShardingEnvelope build() {
akka.typed.cluster.sharding.internal.protobuf.ShardingMessages.ShardingEnvelope result = buildPartial();
public akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.ShardingEnvelope build() {
akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.ShardingEnvelope result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public akka.typed.cluster.sharding.internal.protobuf.ShardingMessages.ShardingEnvelope buildPartial() {
akka.typed.cluster.sharding.internal.protobuf.ShardingMessages.ShardingEnvelope result = new akka.typed.cluster.sharding.internal.protobuf.ShardingMessages.ShardingEnvelope(this);
public akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.ShardingEnvelope buildPartial() {
akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.ShardingEnvelope result = new akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.ShardingEnvelope(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
@ -434,16 +434,16 @@ public final class ShardingMessages {
}
public Builder mergeFrom(akka.protobuf.Message other) {
if (other instanceof akka.typed.cluster.sharding.internal.protobuf.ShardingMessages.ShardingEnvelope) {
return mergeFrom((akka.typed.cluster.sharding.internal.protobuf.ShardingMessages.ShardingEnvelope)other);
if (other instanceof akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.ShardingEnvelope) {
return mergeFrom((akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.ShardingEnvelope)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(akka.typed.cluster.sharding.internal.protobuf.ShardingMessages.ShardingEnvelope other) {
if (other == akka.typed.cluster.sharding.internal.protobuf.ShardingMessages.ShardingEnvelope.getDefaultInstance()) return this;
public Builder mergeFrom(akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.ShardingEnvelope other) {
if (other == akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.ShardingEnvelope.getDefaultInstance()) return this;
if (other.hasEntityId()) {
bitField0_ |= 0x00000001;
entityId_ = other.entityId_;
@ -474,11 +474,11 @@ public final class ShardingMessages {
akka.protobuf.CodedInputStream input,
akka.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
akka.typed.cluster.sharding.internal.protobuf.ShardingMessages.ShardingEnvelope parsedMessage = null;
akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.ShardingEnvelope parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (akka.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (akka.typed.cluster.sharding.internal.protobuf.ShardingMessages.ShardingEnvelope) e.getUnfinishedMessage();
parsedMessage = (akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.ShardingEnvelope) e.getUnfinishedMessage();
throw e;
} finally {
if (parsedMessage != null) {
@ -680,7 +680,7 @@ public final class ShardingMessages {
return messageBuilder_;
}
// @@protoc_insertion_point(builder_scope:akka.typed.cluster.sharding.ShardingEnvelope)
// @@protoc_insertion_point(builder_scope:akka.cluster.sharding.typed.ShardingEnvelope)
}
static {
@ -688,14 +688,14 @@ public final class ShardingMessages {
defaultInstance.initFields();
}
// @@protoc_insertion_point(class_scope:akka.typed.cluster.sharding.ShardingEnvelope)
// @@protoc_insertion_point(class_scope:akka.cluster.sharding.typed.ShardingEnvelope)
}
private static akka.protobuf.Descriptors.Descriptor
internal_static_akka_typed_cluster_sharding_ShardingEnvelope_descriptor;
internal_static_akka_cluster_sharding_typed_ShardingEnvelope_descriptor;
private static
akka.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_akka_typed_cluster_sharding_ShardingEnvelope_fieldAccessorTable;
internal_static_akka_cluster_sharding_typed_ShardingEnvelope_fieldAccessorTable;
public static akka.protobuf.Descriptors.FileDescriptor
getDescriptor() {
@ -705,22 +705,22 @@ public final class ShardingMessages {
descriptor;
static {
java.lang.String[] descriptorData = {
"\n\026ShardingMessages.proto\022\033akka.typed.clu" +
"ster.sharding\032\026ContainerFormats.proto\"?\n" +
"\n\026ShardingMessages.proto\022\033akka.cluster.s" +
"harding.typed\032\026ContainerFormats.proto\"?\n" +
"\020ShardingEnvelope\022\020\n\010entityId\030\001 \002(\t\022\031\n\007m" +
"essage\030\002 \001(\0132\010.PayloadB1\n-akka.typed.clu" +
"ster.sharding.internal.protobufH\001"
"essage\030\002 \001(\0132\010.PayloadB1\n-akka.cluster.s" +
"harding.typed.internal.protobufH\001"
};
akka.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
new akka.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() {
public akka.protobuf.ExtensionRegistry assignDescriptors(
akka.protobuf.Descriptors.FileDescriptor root) {
descriptor = root;
internal_static_akka_typed_cluster_sharding_ShardingEnvelope_descriptor =
internal_static_akka_cluster_sharding_typed_ShardingEnvelope_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_akka_typed_cluster_sharding_ShardingEnvelope_fieldAccessorTable = new
internal_static_akka_cluster_sharding_typed_ShardingEnvelope_fieldAccessorTable = new
akka.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_akka_typed_cluster_sharding_ShardingEnvelope_descriptor,
internal_static_akka_cluster_sharding_typed_ShardingEnvelope_descriptor,
new java.lang.String[] { "EntityId", "Message", });
return null;
}

View file

@ -1,9 +1,9 @@
/**
* Copyright (C) 2014-2017 Lightbend Inc. <http://www.lightbend.com>
*/
package akka.typed.cluster.sharding;
package akka.cluster.sharding.typed;
option java_package = "akka.typed.cluster.sharding.internal.protobuf";
option java_package = "akka.cluster.sharding.typed.internal.protobuf";
option optimize_for = SPEED;
import "ContainerFormats.proto";

View file

@ -0,0 +1,11 @@
akka.actor {
serializers {
typed-sharding = "akka.cluster.sharding.typed.internal.ShardingSerializer"
}
serialization-identifiers {
"akka.cluster.sharding.typed.internal.ShardingSerializer" = 25
}
serialization-bindings {
"akka.cluster.sharding.typed.ShardingEnvelope" = typed-sharding
}
}

View file

@ -1,19 +1,19 @@
/*
* Copyright (C) 2017 Lightbend Inc. <http://www.lightbend.com/>
*/
package akka.typed.cluster.sharding
package akka.cluster.sharding.typed
import akka.annotation.{ DoNotInherit, InternalApi }
import akka.cluster.sharding.ShardCoordinator.{ LeastShardAllocationStrategy, ShardAllocationStrategy }
import akka.cluster.sharding.{ ClusterSharding UntypedClusterSharding, ShardRegion UntypedShardRegion }
import akka.typed.cluster.Cluster
import akka.typed.internal.adapter.{ ActorRefAdapter, ActorSystemAdapter }
import akka.typed.scaladsl.adapter.PropsAdapter
import akka.typed.{ ActorRef, ActorSystem, Behavior, Extension, ExtensionId, Props }
import akka.cluster.typed.Cluster
import akka.actor.typed.internal.adapter.{ ActorRefAdapter, ActorSystemAdapter }
import akka.actor.typed.scaladsl.adapter.PropsAdapter
import akka.actor.typed.{ ActorRef, ActorSystem, Behavior, Extension, ExtensionId, Props }
import scala.language.implicitConversions
import scala.reflect.ClassTag
import akka.typed.Behavior.UntypedBehavior
import akka.actor.typed.Behavior.UntypedBehavior
/**
* Default envelope type that may be used with Cluster Sharding.
@ -101,7 +101,7 @@ trait ShardingMessageExtractor[E, A] {
def entityMessage(message: E): A // TODO "unwrapMessage" is how I'd call it?
/**
* Extract the entity id from an incoming `message`. Only messages that passed the [[#entityId]]
* Extract the entity id from an incoming `message`. Only messages that passed the [[entityId]]
* function will be used as input to this function.
*/
def shardId(message: E): String
@ -187,7 +187,9 @@ object ClusterSharding extends ExtensionId[ClusterSharding] {
/** INTERNAL API */
@InternalApi
final class AdaptedClusterShardingImpl(system: ActorSystem[_]) extends ClusterSharding {
import akka.typed.scaladsl.adapter._
import akka.actor.typed.scaladsl.adapter._
require(system.isInstanceOf[ActorSystemAdapter[_]], "only adapted untyped actor systems can be used for cluster features")
private val cluster = Cluster(system)

View file

@ -2,14 +2,14 @@
* Copyright (C) 2017 Lightbend Inc. <http://www.lightbend.com/>
*/
package akka.typed.cluster.sharding
package akka.cluster.sharding.typed
import akka.actor.NoSerializationVerificationNeeded
import akka.annotation.InternalApi
import akka.cluster.sharding.{ ClusterShardingSettings UntypedShardingSettings }
import akka.cluster.singleton.{ ClusterSingletonManagerSettings UntypedClusterSingletonManagerSettings }
import akka.typed.ActorSystem
import akka.typed.cluster.{ Cluster, ClusterSingletonManagerSettings }
import akka.actor.typed.ActorSystem
import akka.cluster.typed.{ Cluster, ClusterSingletonManagerSettings }
import com.typesafe.config.Config
import scala.concurrent.duration.FiniteDuration
@ -226,7 +226,7 @@ final class ClusterShardingSettings(
val tuningParameters: ClusterShardingSettings.TuningParameters,
val coordinatorSingletonSettings: ClusterSingletonManagerSettings) extends NoSerializationVerificationNeeded {
import akka.typed.cluster.sharding.ClusterShardingSettings.{ StateStoreModeDData, StateStoreModePersistence }
import akka.cluster.sharding.typed.ClusterShardingSettings.{ StateStoreModeDData, StateStoreModePersistence }
require(
stateStoreMode == StateStoreModePersistence || stateStoreMode == StateStoreModeDData,
s"Unknown 'state-store-mode' [$stateStoreMode], " +

View file

@ -1,14 +1,14 @@
/*
* Copyright (C) 2017 Lightbend Inc. <http://www.lightbend.com/>
*/
package akka.typed.cluster.sharding
package akka.cluster.sharding.typed
import akka.actor.{ InternalActorRef, Scheduler }
import akka.annotation.InternalApi
import akka.pattern.{ AskTimeoutException, PromiseActorRef }
import akka.typed.ActorRef
import akka.typed.scaladsl.AskPattern
import akka.typed.scaladsl.AskPattern.PromiseRef
import akka.actor.typed.ActorRef
import akka.actor.typed.scaladsl.AskPattern
import akka.actor.typed.scaladsl.AskPattern.PromiseRef
import akka.util.Timeout
import scala.concurrent.Future
@ -34,7 +34,7 @@ trait EntityRef[A] {
/**
* Allows to "ask" the [[EntityRef]] for a reply.
* See [[akka.typed.scaladsl.AskPattern]] for a complete write-up of this pattern
* See [[akka.actor.typed.scaladsl.AskPattern]] for a complete write-up of this pattern
*
* Example usage:
* {{{
@ -62,7 +62,7 @@ object EntityRef {
/**
* Allows to "ask" the [[EntityRef]] for a reply.
* See [[akka.typed.scaladsl.AskPattern]] for a complete write-up of this pattern
* See [[akka.actor.typed.scaladsl.AskPattern]] for a complete write-up of this pattern
*
* Example usage:
* {{{
@ -83,13 +83,11 @@ object EntityRef {
@InternalApi
private[akka] final class AdaptedEntityRefImpl[A](shardRegion: akka.actor.ActorRef, entityId: String) extends EntityRef[A] {
import akka.pattern.ask
override def tell(msg: A): Unit =
shardRegion ! ShardingEnvelope(entityId, msg)
override def ask[U](f: (ActorRef[U]) A)(implicit timeout: Timeout, scheduler: Scheduler): Future[U] = {
import akka.typed._
val p = new EntityPromiseRef[U](shardRegion.asInstanceOf[InternalActorRef], timeout)
val m = f(p.ref)
if (p.promiseRef ne null) p.promiseRef.messageClassName = m.getClass.getName
@ -97,10 +95,10 @@ private[akka] final class AdaptedEntityRefImpl[A](shardRegion: akka.actor.ActorR
p.future
}
/** Similar to [[akka.typed.scaladsl.AskPattern.PromiseRef]] but for an [[EntityRef]] target. */
/** Similar to [[akka.actor.typed.scaladsl.AskPattern.PromiseRef]] but for an [[EntityRef]] target. */
@InternalApi
private final class EntityPromiseRef[U](untyped: InternalActorRef, timeout: Timeout) {
import akka.typed.internal.{ adapter adapt }
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) =

View file

@ -1,21 +1,15 @@
/**
* Copyright (C) 2017 Lightbend Inc. <http://www.lightbend.com>
*/
package akka.typed.cluster.sharding.internal
package akka.cluster.sharding.typed.internal
import akka.typed.cluster.sharding.internal.protobuf.ShardingMessages
import java.nio.charset.StandardCharsets
import akka.annotation.InternalApi
import akka.serialization.{ BaseSerializer, SerializerWithStringManifest }
import akka.typed.ActorRef
import akka.typed.cluster.ActorRefResolver
import akka.typed.internal.adapter.ActorRefAdapter
import akka.typed.scaladsl.adapter._
import akka.remote.serialization.WrappedPayloadSupport
import akka.typed.cluster.sharding.ShardingEnvelope
import java.io.NotSerializableException
import akka.typed.cluster.sharding.StartEntity
import akka.cluster.sharding.typed.internal.protobuf.ShardingMessages
import akka.annotation.InternalApi
import akka.remote.serialization.WrappedPayloadSupport
import akka.serialization.{ BaseSerializer, SerializerWithStringManifest }
import akka.cluster.sharding.typed.{ ShardingEnvelope, StartEntity }
/**
* INTERNAL API

View file

@ -0,0 +1,21 @@
akka.loglevel = DEBUG
akka.actor.debug.lifecycle = off
dispatcher-1 {
fork-join-executor {
parallelism-min=1
parallelism-max=1
}
}
dispatcher-2 {
fork-join-executor {
parallelism-min=2
parallelism-max=2
}
}
dispatcher-8 {
fork-join-executor {
parallelism-min=8
parallelism-max=8
}
}

View file

@ -2,23 +2,18 @@
* Copyright (C) 2017 Lightbend Inc. <http://www.lightbend.com/>
*/
package akka.typed.cluster.sharding
package akka.cluster.sharding.typed
import akka.cluster.sharding.ShardCoordinator.LeastShardAllocationStrategy
import akka.typed.{ ActorRef, ActorSystem, Props, TypedSpec }
import akka.typed.cluster.Cluster
import akka.typed.internal.adapter.ActorSystemAdapter
import akka.typed.scaladsl.Actor
import akka.typed.scaladsl.adapter._
import akka.typed.testkit.TestKitSettings
import akka.typed.testkit.scaladsl.TestProbe
import akka.actor.typed.{ ActorRef, Props, TypedSpec }
import com.typesafe.config.ConfigFactory
import org.scalatest.concurrent.ScalaFutures
import scala.concurrent.duration._
import akka.typed.Behavior
import akka.typed.persistence.scaladsl.PersistentActor
import akka.typed.persistence.scaladsl.PersistentActor.PersistNothing
import akka.actor.typed.Behavior
import akka.typed.testkit.TestKitSettings
import akka.typed.testkit.scaladsl.TestProbe
import akka.persistence.typed.scaladsl.PersistentActor
import akka.persistence.typed.scaladsl.PersistentActor.PersistNothing
object ClusterShardingPersistenceSpec {
val config = ConfigFactory.parseString(
@ -67,7 +62,7 @@ object ClusterShardingPersistenceSpec {
}
class ClusterShardingPersistenceSpec extends TypedSpec(ClusterShardingPersistenceSpec.config) with ScalaFutures {
import akka.typed.scaladsl.adapter._
import akka.actor.typed.scaladsl.adapter._
import ClusterShardingPersistenceSpec._
implicit val s = system

View file

@ -2,14 +2,14 @@
* Copyright (C) 2017 Lightbend Inc. <http://www.lightbend.com/>
*/
package akka.typed.cluster.sharding
package akka.cluster.sharding.typed
import akka.cluster.sharding.ShardCoordinator.LeastShardAllocationStrategy
import akka.typed.{ ActorRef, ActorSystem, Props, TypedSpec }
import akka.typed.cluster.Cluster
import akka.typed.internal.adapter.ActorSystemAdapter
import akka.typed.scaladsl.Actor
import akka.typed.scaladsl.adapter._
import akka.actor.typed.{ ActorRef, ActorSystem, Props, TypedSpec }
import akka.cluster.typed.Cluster
import akka.actor.typed.internal.adapter.ActorSystemAdapter
import akka.actor.typed.scaladsl.Actor
import akka.actor.typed.scaladsl.adapter._
import akka.typed.testkit.TestKitSettings
import akka.typed.testkit.scaladsl.TestProbe
import com.typesafe.config.ConfigFactory
@ -17,12 +17,12 @@ import org.scalatest.concurrent.ScalaFutures
import scala.concurrent.duration._
import scala.concurrent.Await
import akka.typed.cluster.Join
import akka.cluster.typed.Join
import org.scalatest.concurrent.Eventually
import akka.cluster.MemberStatus
import akka.actor.ExtendedActorSystem
import akka.serialization.SerializerWithStringManifest
import akka.typed.cluster.ActorRefResolver
import akka.cluster.typed.ActorRefResolver
import java.nio.charset.StandardCharsets
object ClusterShardingSpec {
@ -46,11 +46,11 @@ object ClusterShardingSpec {
allow-java-serialization = off
serializers {
test = "akka.typed.cluster.sharding.ClusterShardingSpec$$Serializer"
test = "akka.cluster.sharding.typed.ClusterShardingSpec$$Serializer"
}
serialization-bindings {
"akka.typed.cluster.sharding.ClusterShardingSpec$$TestProtocol" = test
"akka.typed.cluster.sharding.ClusterShardingSpec$$IdTestProtocol" = test
"akka.cluster.sharding.typed.ClusterShardingSpec$$TestProtocol" = test
"akka.cluster.sharding.typed.ClusterShardingSpec$$IdTestProtocol" = test
}
}
""".stripMargin)
@ -118,7 +118,7 @@ object ClusterShardingSpec {
}
class ClusterShardingSpec extends TypedSpec(ClusterShardingSpec.config) with ScalaFutures with Eventually {
import akka.typed.scaladsl.adapter._
import akka.actor.typed.scaladsl.adapter._
import ClusterShardingSpec._
implicit val s = system

View file

@ -1,13 +1,14 @@
/**
* Copyright (C) 2009-2017 Lightbend Inc. <http://www.lightbend.com>
*/
package akka.typed.cluster.sharding
package akka.cluster.sharding.typed
import akka.cluster.sharding.typed.internal.ShardingSerializer
import akka.serialization.SerializationExtension
import akka.typed.TypedSpec
import akka.typed.cluster.sharding.internal.ShardingSerializer
import akka.typed.internal.adapter.ActorSystemAdapter
import akka.typed.scaladsl.AskPattern._
import akka.actor.typed.TypedSpec
import akka.cluster.sharding.typed.internal.ShardingSerializer
import akka.actor.typed.internal.adapter.ActorSystemAdapter
import akka.actor.typed.scaladsl.AskPattern._
class ShardingSerializerSpec extends TypedSpec {

View file

@ -0,0 +1,9 @@
# TODO: move these out somewhere else when doing #23632
akka.actor {
serializers {
typed-misc = "akka.cluster.typed.internal.MiscMessageSerializer"
}
serialization-identifiers {
"akka.cluster.typed.internal.MiscMessageSerializer" = 24
}
}

View file

@ -1,7 +1,7 @@
/**
* Copyright (C) 2017 Lightbend Inc. <http://www.lightbend.com>
*/
package akka.typed.cluster.ddata.internal
package akka.cluster.ddata.typed.internal
import scala.compat.java8.OptionConverters._
import scala.concurrent.duration._
@ -11,21 +11,21 @@ import scala.concurrent.Future
import akka.annotation.InternalApi
import akka.cluster.{ ddata dd }
import akka.pattern.ask
import akka.typed.ActorRef
import akka.typed.Behavior
import akka.typed.scaladsl.Actor
import akka.typed.scaladsl.adapter._
import akka.actor.typed.ActorRef
import akka.actor.typed.Behavior
import akka.actor.typed.scaladsl.Actor
import akka.actor.typed.scaladsl.adapter._
import akka.util.Timeout
import akka.cluster.ddata.ReplicatedData
import akka.cluster.ddata.Key
import akka.typed.Terminated
import akka.actor.typed.Terminated
/**
* INTERNAL API
*/
@InternalApi private[akka] object ReplicatorBehavior {
import akka.typed.cluster.ddata.javadsl.{ Replicator JReplicator }
import akka.typed.cluster.ddata.scaladsl.{ Replicator SReplicator }
import akka.cluster.ddata.typed.javadsl.{ Replicator JReplicator }
import akka.cluster.ddata.typed.scaladsl.{ Replicator SReplicator }
private case class InternalChanged[A <: ReplicatedData](chg: dd.Replicator.Changed[A], subscriber: ActorRef[JReplicator.Changed[A]])
extends JReplicator.Command

View file

@ -1,13 +1,12 @@
/**
* Copyright (C) 2017 Lightbend Inc. <http://www.lightbend.com>
*/
package akka.typed.cluster.ddata.javadsl
package akka.cluster.ddata.typed.javadsl
import akka.typed.ActorSystem
import akka.typed.Extension
import akka.typed.ExtensionId
import akka.typed.ActorRef
import akka.typed.cluster.ddata.scaladsl
import akka.actor.typed.ActorSystem
import akka.actor.typed.Extension
import akka.actor.typed.ExtensionId
import akka.actor.typed.ActorRef
object DistributedData extends ExtensionId[DistributedData] {
def get(system: ActorSystem[_]): DistributedData = apply(system)
@ -22,7 +21,7 @@ object DistributedData extends ExtensionId[DistributedData] {
* `akka.cluster.ddata` section, see `reference.conf`.
*
* This is using the same underlying `Replicator` instance as
* [[akka.akka.cluster.ddata.DistributedData]] and that means that typed
* [[akka.cluster.ddata.DistributedData]] and that means that typed
* and untyped actors can share the same data.
*/
class DistributedData(system: ActorSystem[_]) extends Extension {
@ -31,7 +30,7 @@ class DistributedData(system: ActorSystem[_]) extends Extension {
* `ActorRef` of the [[Replicator]] .
*/
val replicator: ActorRef[Replicator.Command] =
scaladsl.DistributedData(system).replicator.narrow[Replicator.Command]
akka.cluster.ddata.typed.scaladsl.DistributedData(system).replicator.narrow[Replicator.Command]
}

View file

@ -1,25 +1,31 @@
/**
* Copyright (C) 2009-2017 Lightbend Inc. <http://www.lightbend.com>
*/
package akka.typed.cluster.ddata.javadsl
import akka.actor.NoSerializationVerificationNeeded
package akka.cluster.ddata.typed.javadsl
import java.util.function.{ Function JFunction }
import akka.cluster.{ ddata dd }
import akka.typed.cluster.ddata.scaladsl
import akka.cluster.ddata.typed.scaladsl
import akka.cluster.ddata.Key
import akka.cluster.ddata.ReplicatedData
import akka.typed.ActorRef
import akka.typed.Behavior
import akka.typed.cluster.ddata.internal.ReplicatorBehavior
import akka.actor.typed.ActorRef
import akka.actor.typed.Behavior
import akka.cluster.ddata.typed.internal.ReplicatorBehavior
import akka.cluster.ddata.typed.scaladsl
import scala.concurrent.duration.FiniteDuration
import scala.concurrent.duration.Duration
import java.util.Optional
import akka.actor.DeadLetterSuppression
import akka.annotation.InternalApi
import akka.annotation.DoNotInherit
import java.util.function.{ Function JFunction }
import akka.actor.{ DeadLetterSuppression, NoSerializationVerificationNeeded }
import akka.actor.typed.{ ActorRef, Behavior }
import akka.annotation.{ DoNotInherit, InternalApi }
import akka.cluster.ddata.typed.internal.ReplicatorBehavior
import akka.cluster.ddata.typed.scaladsl
import akka.cluster.{ ddata dd }
import scala.concurrent.duration.{ Duration, FiniteDuration }
import scala.util.control.NoStackTrace
/**
@ -41,7 +47,7 @@ object Replicator {
def behavior(settings: dd.ReplicatorSettings, underlyingReplicator: akka.actor.ActorRef): Behavior[Command] =
ReplicatorBehavior.behavior(settings, Some(underlyingReplicator)).narrow[Command]
@DoNotInherit trait Command extends scaladsl.Replicator.Command
@DoNotInherit trait Command extends akka.cluster.ddata.typed.scaladsl.Replicator.Command
sealed trait ReadConsistency {
def timeout: FiniteDuration

View file

@ -1,11 +1,11 @@
/**
* Copyright (C) 2017 Lightbend Inc. <http://www.lightbend.com>
*/
package akka.typed.cluster.ddata.javadsl
package akka.cluster.ddata.typed.javadsl
import akka.cluster.{ ddata dd }
import akka.typed.ActorSystem
import akka.typed.scaladsl.adapter._
import akka.actor.typed.ActorSystem
import akka.actor.typed.scaladsl.adapter._
import com.typesafe.config.Config
object ReplicatorSettings {

Some files were not shown because too many files have changed in this diff Show more