javadsl uses java.util.function.IntFunction instead
This commit is contained in:
parent
e7a7d95e37
commit
6ab23dfd68
3 changed files with 12 additions and 10 deletions
|
|
@ -1,3 +1,5 @@
|
|||
# ShardedDaemonProcess: Use Interger in javadsl function #29235
|
||||
ProblemFilters.exclude[IncompatibleSignatureProblem]("akka.cluster.sharding.typed.javadsl.ShardedDaemonProcess.init")
|
||||
ProblemFilters.exclude[IncompatibleSignatureProblem]("akka.cluster.sharding.typed.internal.ShardedDaemonProcessImpl.init")
|
||||
ProblemFilters.exclude[IncompatibleMethTypeProblem]("akka.cluster.sharding.typed.javadsl.ShardedDaemonProcess.init")
|
||||
ProblemFilters.exclude[ReversedMissingMethodProblem]("akka.cluster.sharding.typed.javadsl.ShardedDaemonProcess.init")
|
||||
ProblemFilters.exclude[IncompatibleMethTypeProblem]("akka.cluster.sharding.typed.internal.ShardedDaemonProcessImpl.init")
|
||||
ProblemFilters.exclude[ReversedMissingMethodProblem]("akka.cluster.sharding.typed.javadsl.ShardedDaemonProcess.init")
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
package akka.cluster.sharding.typed.internal
|
||||
|
||||
import java.util.function.IntFunction
|
||||
import java.util.Optional
|
||||
|
||||
import scala.compat.java8.OptionConverters._
|
||||
|
|
@ -29,7 +30,6 @@ import akka.cluster.sharding.typed.scaladsl.Entity
|
|||
import akka.cluster.sharding.typed.scaladsl.EntityTypeKey
|
||||
import akka.cluster.sharding.typed.scaladsl.StartEntity
|
||||
import akka.cluster.typed.Cluster
|
||||
import akka.japi.function
|
||||
import akka.util.PrettyDuration
|
||||
|
||||
/**
|
||||
|
|
@ -161,14 +161,14 @@ private[akka] final class ShardedDaemonProcessImpl(system: ActorSystem[_])
|
|||
messageClass: Class[T],
|
||||
name: String,
|
||||
numberOfInstances: Int,
|
||||
behaviorFactory: function.Function[Integer, Behavior[T]]): Unit =
|
||||
behaviorFactory: IntFunction[Behavior[T]]): Unit =
|
||||
init(name, numberOfInstances, n => behaviorFactory(n))(ClassTag(messageClass))
|
||||
|
||||
override def init[T](
|
||||
messageClass: Class[T],
|
||||
name: String,
|
||||
numberOfInstances: Int,
|
||||
behaviorFactory: function.Function[Integer, Behavior[T]],
|
||||
behaviorFactory: IntFunction[Behavior[T]],
|
||||
stopMessage: T): Unit =
|
||||
init(name, numberOfInstances, n => behaviorFactory(n), ShardedDaemonProcessSettings(system), Some(stopMessage))(
|
||||
ClassTag(messageClass))
|
||||
|
|
@ -177,7 +177,7 @@ private[akka] final class ShardedDaemonProcessImpl(system: ActorSystem[_])
|
|||
messageClass: Class[T],
|
||||
name: String,
|
||||
numberOfInstances: Int,
|
||||
behaviorFactory: function.Function[Integer, Behavior[T]],
|
||||
behaviorFactory: IntFunction[Behavior[T]],
|
||||
settings: ShardedDaemonProcessSettings,
|
||||
stopMessage: Optional[T]): Unit =
|
||||
init(name, numberOfInstances, n => behaviorFactory(n), settings, stopMessage.asScala)(ClassTag(messageClass))
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
package akka.cluster.sharding.typed.javadsl
|
||||
|
||||
import java.util.function.IntFunction
|
||||
import java.util.Optional
|
||||
|
||||
import akka.actor.typed.ActorSystem
|
||||
|
|
@ -11,7 +12,6 @@ import akka.actor.typed.Behavior
|
|||
import akka.annotation.ApiMayChange
|
||||
import akka.annotation.DoNotInherit
|
||||
import akka.cluster.sharding.typed.ShardedDaemonProcessSettings
|
||||
import akka.japi.function
|
||||
|
||||
object ShardedDaemonProcess {
|
||||
def get(system: ActorSystem[_]): ShardedDaemonProcess =
|
||||
|
|
@ -43,7 +43,7 @@ abstract class ShardedDaemonProcess {
|
|||
messageClass: Class[T],
|
||||
name: String,
|
||||
numberOfInstances: Int,
|
||||
behaviorFactory: function.Function[Integer, Behavior[T]]): Unit
|
||||
behaviorFactory: IntFunction[Behavior[T]]): Unit
|
||||
|
||||
/**
|
||||
* Start a specific number of actors that is then kept alive in the cluster.
|
||||
|
|
@ -56,7 +56,7 @@ abstract class ShardedDaemonProcess {
|
|||
messageClass: Class[T],
|
||||
name: String,
|
||||
numberOfInstances: Int,
|
||||
behaviorFactory: function.Function[Integer, Behavior[T]],
|
||||
behaviorFactory: IntFunction[Behavior[T]],
|
||||
stopMessage: T): Unit
|
||||
|
||||
/**
|
||||
|
|
@ -69,7 +69,7 @@ abstract class ShardedDaemonProcess {
|
|||
messageClass: Class[T],
|
||||
name: String,
|
||||
numberOfInstances: Int,
|
||||
behaviorFactory: function.Function[Integer, Behavior[T]],
|
||||
behaviorFactory: IntFunction[Behavior[T]],
|
||||
settings: ShardedDaemonProcessSettings,
|
||||
stopMessage: Optional[T]): Unit
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue