Make ClassicActorSystemProvider.classicSystem public API
See @28818
This commit is contained in:
parent
89f920a198
commit
27b1c73d90
5 changed files with 9 additions and 15 deletions
|
|
@ -66,7 +66,7 @@ import org.slf4j.LoggerFactory
|
|||
override def provider: ActorRefProvider = throw new UnsupportedOperationException("no provider")
|
||||
|
||||
// stream materialization etc. using stub not supported
|
||||
override private[akka] def classicSystem =
|
||||
override def classicSystem =
|
||||
throw new UnsupportedOperationException("no classic actor system available")
|
||||
|
||||
// impl InternalRecipientRef
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ import org.slf4j.{ Logger, LoggerFactory }
|
|||
|
||||
import ActorRefAdapter.sendSystemMessage
|
||||
|
||||
override private[akka] def classicSystem: classic.ActorSystem = system
|
||||
override def classicSystem: classic.ActorSystem = system
|
||||
|
||||
// Members declared in akka.actor.typed.ActorRef
|
||||
override def tell(msg: T): Unit = {
|
||||
|
|
@ -155,12 +155,5 @@ private[akka] object ActorSystemAdapter {
|
|||
new LoadTypedExtensions(system)
|
||||
}
|
||||
|
||||
def toClassic[U](sys: ActorSystem[_]): classic.ActorSystem =
|
||||
sys match {
|
||||
case adapter: ActorSystemAdapter[_] => adapter.classicSystem
|
||||
case _ =>
|
||||
throw new UnsupportedOperationException(
|
||||
"Only adapted classic ActorSystem permissible " +
|
||||
s"($sys of class ${sys.getClass.getName})")
|
||||
}
|
||||
def toClassic[U](sys: ActorSystem[_]): classic.ActorSystem = sys.classicSystem
|
||||
}
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ package object adapter {
|
|||
* Extension methods added to [[akka.actor.typed.ActorSystem]].
|
||||
*/
|
||||
implicit class TypedActorSystemOps(val sys: ActorSystem[_]) extends AnyVal {
|
||||
def toClassic: akka.actor.ActorSystem = ActorSystemAdapter.toClassic(sys)
|
||||
def toClassic: akka.actor.ActorSystem = sys.classicSystem
|
||||
|
||||
/**
|
||||
* INTERNAL API
|
||||
|
|
|
|||
|
|
@ -976,7 +976,7 @@ private[akka] class ActorSystemImpl(
|
|||
def /(actorName: String): ActorPath = guardian.path / actorName
|
||||
def /(path: Iterable[String]): ActorPath = guardian.path / path
|
||||
|
||||
override private[akka] def classicSystem: ActorSystem = this
|
||||
override def classicSystem: ActorSystem = this
|
||||
|
||||
// Used for ManifestInfo.checkSameVersion
|
||||
private def allModules: List[String] =
|
||||
|
|
|
|||
|
|
@ -15,9 +15,10 @@ import akka.annotation.InternalApi
|
|||
@DoNotInherit
|
||||
trait ClassicActorSystemProvider {
|
||||
|
||||
/** INTERNAL API */
|
||||
@InternalApi
|
||||
private[akka] def classicSystem: ActorSystem
|
||||
/**
|
||||
* Allows access to the classic `akka.actor.ActorSystem` even for `akka.actor.typed.ActorSystem[_]`s.
|
||||
*/
|
||||
def classicSystem: ActorSystem
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue