actor: allow seamless access to untyped extensions given typed ActorSystem (#28294)
* actor: allow seamless access to untyped extensions given typed ActorSystem * add overrides with concrete type for Java API everywhere
This commit is contained in:
parent
2c96a57d89
commit
702b6a7f41
70 changed files with 192 additions and 49 deletions
|
|
@ -0,0 +1,4 @@
|
|||
# Incompatibilities against Akka < 2.5.17 where extra static bridge methods were generated that
|
||||
# Mima now wrongly correlates with the new ones added in the PR
|
||||
ProblemFilters.exclude[IncompatibleResultTypeProblem]("akka.cluster.metrics.ClusterMetricsExtension.get")
|
||||
|
||||
|
|
@ -10,6 +10,7 @@ import akka.actor.SupervisorStrategy
|
|||
import akka.event.LoggingAdapter
|
||||
import akka.event.Logging
|
||||
import com.typesafe.config.Config
|
||||
|
||||
import scala.collection.immutable
|
||||
import akka.actor.Props
|
||||
import akka.actor.Deploy
|
||||
|
|
@ -17,6 +18,7 @@ import akka.actor.ExtensionId
|
|||
import akka.actor.ExtensionIdProvider
|
||||
import akka.actor.ActorSystem
|
||||
import akka.actor.ActorRef
|
||||
import akka.actor.ClassicActorSystemProvider
|
||||
|
||||
/**
|
||||
* Cluster metrics extension.
|
||||
|
|
@ -87,6 +89,7 @@ class ClusterMetricsExtension(system: ExtendedActorSystem) extends Extension {
|
|||
object ClusterMetricsExtension extends ExtensionId[ClusterMetricsExtension] with ExtensionIdProvider {
|
||||
override def lookup = ClusterMetricsExtension
|
||||
override def get(system: ActorSystem): ClusterMetricsExtension = super.get(system)
|
||||
override def get(system: ClassicActorSystemProvider): ClusterMetricsExtension = super.get(system)
|
||||
override def createExtension(system: ExtendedActorSystem): ClusterMetricsExtension =
|
||||
new ClusterMetricsExtension(system)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue