Merge pull request #2047 from drexin/wip-3858-make-case-classes-final-drexin

=all #3858 Make case classes final
This commit is contained in:
Roland Kuhn 2014-03-11 16:06:31 +01:00
commit 4dd5fe3257
188 changed files with 764 additions and 765 deletions

View file

@ -128,7 +128,7 @@ class ActorLifeCycleSpec extends AkkaSpec("akka.actor.serialize-messages=off") w
} }
"clear the behavior stack upon restart" in { "clear the behavior stack upon restart" in {
case class Become(recv: ActorContext Receive) final case class Become(recv: ActorContext Receive)
val a = system.actorOf(Props(new Actor { val a = system.actorOf(Props(new Actor {
def receive = { def receive = {
case Become(beh) { context.become(beh(context), discardOld = false); sender() ! "ok" } case Become(beh) { context.become(beh(context), discardOld = false); sender() ! "ok" }

View file

@ -12,13 +12,13 @@ import akka.pattern.ask
object ActorLookupSpec { object ActorLookupSpec {
case class Create(child: String) final case class Create(child: String)
trait Query trait Query
case class LookupElems(path: Iterable[String]) extends Query final case class LookupElems(path: Iterable[String]) extends Query
case class LookupString(path: String) extends Query final case class LookupString(path: String) extends Query
case class LookupPath(path: ActorPath) extends Query final case class LookupPath(path: ActorPath) extends Query
case class GetSender(to: ActorRef) extends Query final case class GetSender(to: ActorRef) extends Query
val p = Props[Node] val p = Props[Node]

View file

@ -171,7 +171,7 @@ object ActorMailboxSpec {
classOf[BoundedDequeBasedMessageQueueSemantics]) classOf[BoundedDequeBasedMessageQueueSemantics])
trait MCBoundedMessageQueueSemantics extends MessageQueue with MultipleConsumerSemantics trait MCBoundedMessageQueueSemantics extends MessageQueue with MultipleConsumerSemantics
case class MCBoundedMailbox(val capacity: Int, val pushTimeOut: FiniteDuration) final case class MCBoundedMailbox(val capacity: Int, val pushTimeOut: FiniteDuration)
extends MailboxType with ProducesMessageQueue[MCBoundedMessageQueueSemantics] { extends MailboxType with ProducesMessageQueue[MCBoundedMessageQueueSemantics] {
def this(settings: ActorSystem.Settings, config: Config) = this(config.getInt("mailbox-capacity"), def this(settings: ActorSystem.Settings, config: Config) = this(config.getInt("mailbox-capacity"),

View file

@ -13,11 +13,11 @@ import scala.util.Try
object ActorPerfSpec { object ActorPerfSpec {
case class Create(number: Int, props: () Props) final case class Create(number: Int, props: () Props)
case object Created case object Created
case object IsAlive case object IsAlive
case object Alive case object Alive
case class WaitForChildren(number: Int) final case class WaitForChildren(number: Int)
case object Waited case object Waited
class EmptyActor extends Actor { class EmptyActor extends Actor {

View file

@ -18,7 +18,7 @@ import akka.TestUtils.verifyActorTermination
object ActorRefSpec { object ActorRefSpec {
case class ReplyTo(sender: ActorRef) final case class ReplyTo(sender: ActorRef)
class ReplyActor extends Actor { class ReplyActor extends Actor {
var replyTo: ActorRef = null var replyTo: ActorRef = null

View file

@ -12,13 +12,13 @@ import akka.pattern.ask
object ActorSelectionSpec { object ActorSelectionSpec {
case class Create(child: String) final case class Create(child: String)
trait Query trait Query
case class SelectString(path: String) extends Query final case class SelectString(path: String) extends Query
case class SelectPath(path: ActorPath) extends Query final case class SelectPath(path: ActorPath) extends Query
case class GetSender(to: ActorRef) extends Query final case class GetSender(to: ActorRef) extends Query
case class Forward(path: String, msg: Any) extends Query final case class Forward(path: String, msg: Any) extends Query
val p = Props[Node] val p = Props[Node]

View file

@ -71,7 +71,7 @@ object ActorSystemSpec {
} }
} }
case class FastActor(latch: TestLatch, testActor: ActorRef) extends Actor { final case class FastActor(latch: TestLatch, testActor: ActorRef) extends Actor {
val ref1 = context.actorOf(Props.empty) val ref1 = context.actorOf(Props.empty)
val ref2 = context.actorFor(ref1.path.toString) val ref2 = context.actorFor(ref1.path.toString)
testActor ! ref2.getClass testActor ! ref2.getClass

View file

@ -8,9 +8,9 @@ package akka.actor
object Chameneos { object Chameneos {
sealed trait ChameneosEvent sealed trait ChameneosEvent
case class Meet(from: ActorRef, colour: Colour) extends ChameneosEvent final case class Meet(from: ActorRef, colour: Colour) extends ChameneosEvent
case class Change(colour: Colour) extends ChameneosEvent final case class Change(colour: Colour) extends ChameneosEvent
case class MeetingCount(count: Int) extends ChameneosEvent final case class MeetingCount(count: Int) extends ChameneosEvent
case object Exit extends ChameneosEvent case object Exit extends ChameneosEvent
abstract class Colour abstract class Colour

View file

@ -27,13 +27,13 @@ object DeathWatchSpec {
* Forwarding `Terminated` to non-watching testActor is not possible, * Forwarding `Terminated` to non-watching testActor is not possible,
* and therefore the `Terminated` message is wrapped. * and therefore the `Terminated` message is wrapped.
*/ */
case class WrappedTerminated(t: Terminated) final case class WrappedTerminated(t: Terminated)
case class W(ref: ActorRef) final case class W(ref: ActorRef)
case class U(ref: ActorRef) final case class U(ref: ActorRef)
case class FF(fail: Failed) final case class FF(fail: Failed)
case class Latches(t1: TestLatch, t2: TestLatch) extends NoSerializationVerificationNeeded final case class Latches(t1: TestLatch, t2: TestLatch) extends NoSerializationVerificationNeeded
} }
trait DeathWatchSpec { this: AkkaSpec with ImplicitSender with DefaultTimeout trait DeathWatchSpec { this: AkkaSpec with ImplicitSender with DefaultTimeout

View file

@ -101,7 +101,7 @@ object FSMActorSpec {
private def doUnlock(): Unit = unlockedLatch.open() private def doUnlock(): Unit = unlockedLatch.open()
} }
case class CodeState(soFar: String, code: String) final case class CodeState(soFar: String, code: String)
} }
@org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner]) @org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner])

View file

@ -170,7 +170,7 @@ object FSMTimingSpec {
case object Cancel case object Cancel
case object SetHandler case object SetHandler
case class Unhandled(msg: AnyRef) final case class Unhandled(msg: AnyRef)
class StateMachine(tester: ActorRef) extends Actor with FSM[State, Int] { class StateMachine(tester: ActorRef) extends Actor with FSM[State, Int] {
import FSM._ import FSM._

View file

@ -192,7 +192,7 @@ trait SchedulerSpec extends BeforeAndAfterEach with DefaultTimeout with Implicit
"never fire prematurely" taggedAs TimingTest in { "never fire prematurely" taggedAs TimingTest in {
val ticks = new TestLatch(300) val ticks = new TestLatch(300)
case class Msg(ts: Long) final case class Msg(ts: Long)
val actor = system.actorOf(Props(new Actor { val actor = system.actorOf(Props(new Actor {
def receive = { def receive = {

View file

@ -53,18 +53,18 @@ object SupervisorHierarchySpec {
} }
} }
case class Ready(ref: ActorRef) final case class Ready(ref: ActorRef)
case class Died(path: ActorPath) final case class Died(path: ActorPath)
case object Abort case object Abort
case object PingOfDeath case object PingOfDeath
case object PongOfDeath case object PongOfDeath
case class Event(msg: Any, identity: Long) { val time: Long = System.nanoTime } final case class Event(msg: Any, identity: Long) { val time: Long = System.nanoTime }
case class ErrorLog(msg: String, log: Vector[Event]) final case class ErrorLog(msg: String, log: Vector[Event])
case class Failure(directive: Directive, stop: Boolean, depth: Int, var failPre: Int, var failPost: Int, val failConstr: Int, stopKids: Int) final case class Failure(directive: Directive, stop: Boolean, depth: Int, var failPre: Int, var failPost: Int, val failConstr: Int, stopKids: Int)
extends RuntimeException("Failure") with NoStackTrace { extends RuntimeException("Failure") with NoStackTrace {
override def toString = productPrefix + productIterator.mkString("(", ",", ")") override def toString = productPrefix + productIterator.mkString("(", ",", ")")
} }
case class Dump(level: Int) final case class Dump(level: Int)
val config = ConfigFactory.parseString(""" val config = ConfigFactory.parseString("""
hierarchy { hierarchy {
@ -112,7 +112,7 @@ object SupervisorHierarchySpec {
* upon Restart or would have to be managed by the highest supervisor (which * upon Restart or would have to be managed by the highest supervisor (which
* is undesirable). * is undesirable).
*/ */
case class HierarchyState(log: Vector[Event], kids: Map[ActorPath, Int], failConstr: Failure) final case class HierarchyState(log: Vector[Event], kids: Map[ActorPath, Int], failConstr: Failure)
val stateCache = new ConcurrentHashMap[ActorPath, HierarchyState]() val stateCache = new ConcurrentHashMap[ActorPath, HierarchyState]()
@volatile var ignoreFailConstr = false @volatile var ignoreFailConstr = false
@ -320,11 +320,11 @@ object SupervisorHierarchySpec {
} }
case object Work case object Work
case class GCcheck(kids: Vector[WeakReference[ActorRef]]) final case class GCcheck(kids: Vector[WeakReference[ActorRef]])
sealed trait Action sealed trait Action
case class Ping(ref: ActorRef) extends Action final case class Ping(ref: ActorRef) extends Action
case class Fail(ref: ActorRef, directive: Directive) extends Action final case class Fail(ref: ActorRef, directive: Directive) extends Action
sealed trait State sealed trait State
case object Idle extends State case object Idle extends State

View file

@ -31,35 +31,35 @@ object ActorModelSpec {
sealed trait ActorModelMessage extends NoSerializationVerificationNeeded sealed trait ActorModelMessage extends NoSerializationVerificationNeeded
case class TryReply(expect: Any) extends ActorModelMessage final case class TryReply(expect: Any) extends ActorModelMessage
case class Reply(expect: Any) extends ActorModelMessage final case class Reply(expect: Any) extends ActorModelMessage
case class Forward(to: ActorRef, msg: Any) extends ActorModelMessage final case class Forward(to: ActorRef, msg: Any) extends ActorModelMessage
case class CountDown(latch: CountDownLatch) extends ActorModelMessage final case class CountDown(latch: CountDownLatch) extends ActorModelMessage
case class Increment(counter: AtomicLong) extends ActorModelMessage final case class Increment(counter: AtomicLong) extends ActorModelMessage
case class AwaitLatch(latch: CountDownLatch) extends ActorModelMessage final case class AwaitLatch(latch: CountDownLatch) extends ActorModelMessage
case class Meet(acknowledge: CountDownLatch, waitFor: CountDownLatch) extends ActorModelMessage final case class Meet(acknowledge: CountDownLatch, waitFor: CountDownLatch) extends ActorModelMessage
case class CountDownNStop(latch: CountDownLatch) extends ActorModelMessage final case class CountDownNStop(latch: CountDownLatch) extends ActorModelMessage
case class Wait(time: Long) extends ActorModelMessage final case class Wait(time: Long) extends ActorModelMessage
case class WaitAck(time: Long, latch: CountDownLatch) extends ActorModelMessage final case class WaitAck(time: Long, latch: CountDownLatch) extends ActorModelMessage
case object Interrupt extends ActorModelMessage case object Interrupt extends ActorModelMessage
case class InterruptNicely(expect: Any) extends ActorModelMessage final case class InterruptNicely(expect: Any) extends ActorModelMessage
case object Restart extends ActorModelMessage case object Restart extends ActorModelMessage
case object DoubleStop extends ActorModelMessage case object DoubleStop extends ActorModelMessage
case class ThrowException(e: Throwable) extends ActorModelMessage final case class ThrowException(e: Throwable) extends ActorModelMessage
val Ping = "Ping" val Ping = "Ping"
val Pong = "Pong" val Pong = "Pong"

View file

@ -49,8 +49,8 @@ object FutureSpec {
} }
} }
case class Req[T](req: T) final case class Req[T](req: T)
case class Res[T](res: T) final case class Res[T](res: T)
} }
class JavaFutureSpec extends JavaFutureTests with JUnitSuiteLike class JavaFutureSpec extends JavaFutureTests with JUnitSuiteLike
@ -704,22 +704,22 @@ class FutureSpec extends AkkaSpec with Checkers with BeforeAndAfterAll with Defa
} }
sealed trait IntAction { def apply(that: Int): Int } sealed trait IntAction { def apply(that: Int): Int }
case class IntAdd(n: Int) extends IntAction { def apply(that: Int) = that + n } final case class IntAdd(n: Int) extends IntAction { def apply(that: Int) = that + n }
case class IntSub(n: Int) extends IntAction { def apply(that: Int) = that - n } final case class IntSub(n: Int) extends IntAction { def apply(that: Int) = that - n }
case class IntMul(n: Int) extends IntAction { def apply(that: Int) = that * n } final case class IntMul(n: Int) extends IntAction { def apply(that: Int) = that * n }
case class IntDiv(n: Int) extends IntAction { def apply(that: Int) = that / n } final case class IntDiv(n: Int) extends IntAction { def apply(that: Int) = that / n }
sealed trait FutureAction { sealed trait FutureAction {
def /:(that: Try[Int]): Try[Int] def /:(that: Try[Int]): Try[Int]
def /:(that: Future[Int]): Future[Int] def /:(that: Future[Int]): Future[Int]
} }
case class MapAction(action: IntAction) extends FutureAction { final case class MapAction(action: IntAction) extends FutureAction {
def /:(that: Try[Int]): Try[Int] = that map action.apply def /:(that: Try[Int]): Try[Int] = that map action.apply
def /:(that: Future[Int]): Future[Int] = that map action.apply def /:(that: Future[Int]): Future[Int] = that map action.apply
} }
case class FlatMapAction(action: IntAction) extends FutureAction { final case class FlatMapAction(action: IntAction) extends FutureAction {
def /:(that: Try[Int]): Try[Int] = that map action.apply def /:(that: Try[Int]): Try[Int] = that map action.apply
def /:(that: Future[Int]): Future[Int] = that flatMap (n Future.successful(action(n))) def /:(that: Future[Int]): Future[Int] = that flatMap (n Future.successful(action(n)))
} }

View file

@ -33,9 +33,9 @@ object EventStreamSpec {
} }
""") """)
case class M(i: Int) final case class M(i: Int)
case class SetTarget(ref: ActorRef) final case class SetTarget(ref: ActorRef)
class MyLog extends Actor { class MyLog extends Actor {
var dst: ActorRef = context.system.deadLetters var dst: ActorRef = context.system.deadLetters

View file

@ -69,7 +69,7 @@ object LoggerSpec {
} }
""").withFallback(AkkaSpec.testConf) """).withFallback(AkkaSpec.testConf)
case class SetTarget(ref: ActorRef, qualifier: Int) final case class SetTarget(ref: ActorRef, qualifier: Int)
class TestLogger1 extends TestLogger(1) class TestLogger1 extends TestLogger(1)
class TestLogger2 extends TestLogger(2) class TestLogger2 extends TestLogger(2)

View file

@ -27,7 +27,7 @@ import java.util.Random
object TcpConnectionSpec { object TcpConnectionSpec {
case class Ack(i: Int) extends Event case class Ack(i: Int) extends Event
object Ack extends Ack(0) object Ack extends Ack(0)
case class Registration(channel: SelectableChannel, initialOps: Int) extends NoSerializationVerificationNeeded final case class Registration(channel: SelectableChannel, initialOps: Int) extends NoSerializationVerificationNeeded
} }
class TcpConnectionSpec extends AkkaSpec(""" class TcpConnectionSpec extends AkkaSpec("""

View file

@ -39,13 +39,13 @@ object ConsistentHashingRouterSpec {
} }
} }
case class Msg(key: Any, data: String) extends ConsistentHashable { final case class Msg(key: Any, data: String) extends ConsistentHashable {
override def consistentHashKey = key override def consistentHashKey = key
} }
case class MsgKey(name: String) final case class MsgKey(name: String)
case class Msg2(key: Any, data: String) final case class Msg2(key: Any, data: String)
} }
@org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner]) @org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner])

View file

@ -105,7 +105,7 @@ class RoutingSpec extends AkkaSpec(RoutingSpec.config) with DefaultTimeout with
} }
"be able to send their routees" in { "be able to send their routees" in {
case class TestRun(id: String, names: immutable.Iterable[String], actors: Int) final case class TestRun(id: String, names: immutable.Iterable[String], actors: Int)
val actor = system.actorOf(Props(new Actor { val actor = system.actorOf(Props(new Actor {
def receive = { def receive = {
case TestRun(id, names, actors) case TestRun(id, names, actors)
@ -543,7 +543,7 @@ class RoutingSpec extends AkkaSpec(RoutingSpec.config) with DefaultTimeout with
Await.result(routedActor ? Broadcast(0), timeout.duration) should be(14) Await.result(routedActor ? Broadcast(0), timeout.duration) should be(14)
} }
case class Stop(id: Option[Int] = None) final case class Stop(id: Option[Int] = None)
def newActor(id: Int, shudownLatch: Option[TestLatch] = None) = system.actorOf(Props(new Actor { def newActor(id: Int, shudownLatch: Option[TestLatch] = None) = system.actorOf(Props(new Actor {
def receive = { def receive = {

View file

@ -13,7 +13,7 @@ import scala.concurrent.{ Future, Promise, Await }
import scala.concurrent.duration._ import scala.concurrent.duration._
object PatternSpec { object PatternSpec {
case class Work(duration: Duration) final case class Work(duration: Duration)
class TargetActor extends Actor { class TargetActor extends Actor {
def receive = { def receive = {
case (testLatch: TestLatch, duration: FiniteDuration) case (testLatch: TestLatch, duration: FiniteDuration)

View file

@ -83,7 +83,7 @@ object TellLatencyPerformanceSpec {
val random: Random = new Random(0) val random: Random = new Random(0)
case object Run case object Run
case class Msg(nanoTime: Long = System.nanoTime) final case class Msg(nanoTime: Long = System.nanoTime)
class Waypoint(next: ActorRef) extends Actor { class Waypoint(next: ActorRef) extends Actor {
def receive = { def receive = {

View file

@ -8,7 +8,7 @@ trait Order {
def withNanoTime: Order def withNanoTime: Order
} }
case class Bid( final case class Bid(
orderbookSymbol: String, orderbookSymbol: String,
price: Long, price: Long,
volume: Long, volume: Long,
@ -22,7 +22,7 @@ case class Bid(
def withNanoTime: Bid = copy(nanoTime = System.nanoTime) def withNanoTime: Bid = copy(nanoTime = System.nanoTime)
} }
case class Ask( final case class Ask(
orderbookSymbol: String, orderbookSymbol: String,
price: Long, price: Long,
volume: Long, volume: Long,

View file

@ -46,4 +46,4 @@ class AkkaOrderReceiver extends Actor with OrderReceiver with ActorLogging {
} }
} }
case class MatchingEngineRouting[ME](mapping: Map[ME, List[String]]) final case class MatchingEngineRouting[ME](mapping: Map[ME, List[String]])

View file

@ -2,4 +2,4 @@ package akka.performance.trading.system
import akka.performance.trading.domain.Order import akka.performance.trading.domain.Order
case class Rsp(order: Order, status: Boolean) final case class Rsp(order: Order, status: Boolean)

View file

@ -31,7 +31,7 @@ trait TradingSystem {
def shutdown() def shutdown()
case class MatchingEngineInfo(primary: ME, standby: Option[ME], orderbooks: List[Orderbook]) final case class MatchingEngineInfo(primary: ME, standby: Option[ME], orderbooks: List[Orderbook])
} }
class AkkaTradingSystem(val system: ActorSystem) extends TradingSystem { class AkkaTradingSystem(val system: ActorSystem) extends TradingSystem {

View file

@ -49,7 +49,7 @@ class FileBenchResultRepository extends BenchResultRepository {
private def htmlDirExists: Boolean = new File(htmlDir).exists private def htmlDirExists: Boolean = new File(htmlDir).exists
protected val maxHistorical = 7 protected val maxHistorical = 7
case class Key(name: String, load: Int) final case class Key(name: String, load: Int)
def add(stats: Stats): Unit = synchronized { def add(stats: Stats): Unit = synchronized {
val values = statsByName.getOrElseUpdate(stats.name, Vector.empty) val values = statsByName.getOrElseUpdate(stats.name, Vector.empty)

View file

@ -3,7 +3,7 @@ package akka.performance.workbench
import scala.collection.immutable.TreeMap import scala.collection.immutable.TreeMap
@SerialVersionUID(1L) @SerialVersionUID(1L)
case class Stats( final case class Stats(
name: String, name: String,
load: Int, load: Int,
timestamp: Long = System.currentTimeMillis, timestamp: Long = System.currentTimeMillis,

View file

@ -60,12 +60,12 @@ object ConfiguredLocalRoutingSpec {
override def createRouter(system: ActorSystem): Router = Router(MyRoutingLogic(config)) override def createRouter(system: ActorSystem): Router = Router(MyRoutingLogic(config))
} }
case class MyRoutingLogic(config: Config) extends RoutingLogic { final case class MyRoutingLogic(config: Config) extends RoutingLogic {
override def select(message: Any, routees: immutable.IndexedSeq[Routee]): Routee = override def select(message: Any, routees: immutable.IndexedSeq[Routee]): Routee =
MyRoutee(config.getString(message.toString)) MyRoutee(config.getString(message.toString))
} }
case class MyRoutee(reply: String) extends Routee { final case class MyRoutee(reply: String) extends Routee {
override def send(message: Any, sender: ActorRef): Unit = override def send(message: Any, sender: ActorRef): Unit =
sender ! reply sender ! reply
} }

View file

@ -37,13 +37,13 @@ object ConsistentHashingRouterSpec {
} }
} }
case class Msg(key: Any, data: String) extends ConsistentHashable { final case class Msg(key: Any, data: String) extends ConsistentHashable {
override def consistentHashKey = key override def consistentHashKey = key
} }
case class MsgKey(name: String) final case class MsgKey(name: String)
case class Msg2(key: Any, data: String) final case class Msg2(key: Any, data: String)
} }
@org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner]) @org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner])

View file

@ -16,7 +16,7 @@ object ScatterGatherFirstCompletedSpec {
def receive = { case _ } def receive = { case _ }
} }
case class Stop(id: Option[Int] = None) final case class Stop(id: Option[Int] = None)
def newActor(id: Int, shudownLatch: Option[TestLatch] = None)(implicit system: ActorSystem) = def newActor(id: Int, shudownLatch: Option[TestLatch] = None)(implicit system: ActorSystem) =
system.actorOf(Props(new Actor { system.actorOf(Props(new Actor {

View file

@ -42,11 +42,11 @@ object SerializationTests {
""" """
@BeanInfo @BeanInfo
case class Address(no: String, street: String, city: String, zip: String) { def this() = this("", "", "", "") } final case class Address(no: String, street: String, city: String, zip: String) { def this() = this("", "", "", "") }
@BeanInfo @BeanInfo
case class Person(name: String, age: Int, address: Address) { def this() = this("", 0, null) } final case class Person(name: String, age: Int, address: Address) { def this() = this("", 0, null) }
case class Record(id: Int, person: Person) final case class Record(id: Int, person: Person)
class SimpleMessage(s: String) extends TestSerializable class SimpleMessage(s: String) extends TestSerializable
@ -424,6 +424,6 @@ protected[akka] class TestSerializer extends Serializer {
} }
@SerialVersionUID(1) @SerialVersionUID(1)
protected[akka] case class FakeThrowable(msg: String) extends Throwable(msg) with Serializable { protected[akka] final case class FakeThrowable(msg: String) extends Throwable(msg) with Serializable {
override def fillInStackTrace = null override def fillInStackTrace = null
} }

View file

@ -60,7 +60,7 @@ case object Kill extends Kill {
* is returned in the `ActorIdentity` message as `correlationId`. * is returned in the `ActorIdentity` message as `correlationId`.
*/ */
@SerialVersionUID(1L) @SerialVersionUID(1L)
case class Identify(messageId: Any) extends AutoReceivedMessage final case class Identify(messageId: Any) extends AutoReceivedMessage
/** /**
* Reply to [[akka.actor.Identify]]. Contains * Reply to [[akka.actor.Identify]]. Contains
@ -70,7 +70,7 @@ case class Identify(messageId: Any) extends AutoReceivedMessage
* the `Identify` message. * the `Identify` message.
*/ */
@SerialVersionUID(1L) @SerialVersionUID(1L)
case class ActorIdentity(correlationId: Any, ref: Option[ActorRef]) { final case class ActorIdentity(correlationId: Any, ref: Option[ActorRef]) {
/** /**
* Java API: `ActorRef` of the actor replying to the request or * Java API: `ActorRef` of the actor replying to the request or
* null if no actor matched the request. * null if no actor matched the request.
@ -93,7 +93,7 @@ case class ActorIdentity(correlationId: Any, ref: Option[ActorRef]) {
* that the remote node hosting the watched actor was detected as unreachable * that the remote node hosting the watched actor was detected as unreachable
*/ */
@SerialVersionUID(1L) @SerialVersionUID(1L)
case class Terminated private[akka] (@BeanProperty actor: ActorRef)( final case class Terminated private[akka] (@BeanProperty actor: ActorRef)(
@BeanProperty val existenceConfirmed: Boolean, @BeanProperty val existenceConfirmed: Boolean,
@BeanProperty val addressTerminated: Boolean) extends AutoReceivedMessage with PossiblyHarmful @BeanProperty val addressTerminated: Boolean) extends AutoReceivedMessage with PossiblyHarmful
@ -107,7 +107,7 @@ case class Terminated private[akka] (@BeanProperty actor: ActorRef)(
* and translates this event to [[akka.actor.Terminated]], which is sent itself. * and translates this event to [[akka.actor.Terminated]], which is sent itself.
*/ */
@SerialVersionUID(1L) @SerialVersionUID(1L)
private[akka] case class AddressTerminated(address: Address) extends AutoReceivedMessage with PossiblyHarmful private[akka] final case class AddressTerminated(address: Address) extends AutoReceivedMessage with PossiblyHarmful
abstract class ReceiveTimeout extends PossiblyHarmful abstract class ReceiveTimeout extends PossiblyHarmful
@ -128,20 +128,20 @@ case object ReceiveTimeout extends ReceiveTimeout {
* For instance, if you try to create an Actor that doesn't extend Actor. * For instance, if you try to create an Actor that doesn't extend Actor.
*/ */
@SerialVersionUID(1L) @SerialVersionUID(1L)
case class IllegalActorStateException private[akka] (message: String) extends AkkaException(message) final case class IllegalActorStateException private[akka] (message: String) extends AkkaException(message)
/** /**
* ActorKilledException is thrown when an Actor receives the [[akka.actor.Kill]] message * ActorKilledException is thrown when an Actor receives the [[akka.actor.Kill]] message
*/ */
@SerialVersionUID(1L) @SerialVersionUID(1L)
case class ActorKilledException private[akka] (message: String) extends AkkaException(message) with NoStackTrace final case class ActorKilledException private[akka] (message: String) extends AkkaException(message) with NoStackTrace
/** /**
* An InvalidActorNameException is thrown when you try to convert something, usually a String, to an Actor name * An InvalidActorNameException is thrown when you try to convert something, usually a String, to an Actor name
* which doesn't validate. * which doesn't validate.
*/ */
@SerialVersionUID(1L) @SerialVersionUID(1L)
case class InvalidActorNameException(message: String) extends AkkaException(message) final case class InvalidActorNameException(message: String) extends AkkaException(message)
/** /**
* An ActorInitializationException is thrown when the the initialization logic for an Actor fails. * An ActorInitializationException is thrown when the the initialization logic for an Actor fails.
@ -178,7 +178,7 @@ object ActorInitializationException {
* @param messageOption is the message which was optionally passed into preRestart() * @param messageOption is the message which was optionally passed into preRestart()
*/ */
@SerialVersionUID(1L) @SerialVersionUID(1L)
case class PreRestartException private[akka] (actor: ActorRef, cause: Throwable, originalCause: Throwable, messageOption: Option[Any]) final case class PreRestartException private[akka] (actor: ActorRef, cause: Throwable, originalCause: Throwable, messageOption: Option[Any])
extends ActorInitializationException(actor, extends ActorInitializationException(actor,
"exception in preRestart(" + "exception in preRestart(" +
(if (originalCause == null) "null" else originalCause.getClass) + ", " + (if (originalCause == null) "null" else originalCause.getClass) + ", " +
@ -194,7 +194,7 @@ case class PreRestartException private[akka] (actor: ActorRef, cause: Throwable,
* @param originalCause is the exception which caused the restart in the first place * @param originalCause is the exception which caused the restart in the first place
*/ */
@SerialVersionUID(1L) @SerialVersionUID(1L)
case class PostRestartException private[akka] (actor: ActorRef, cause: Throwable, originalCause: Throwable) final case class PostRestartException private[akka] (actor: ActorRef, cause: Throwable, originalCause: Throwable)
extends ActorInitializationException(actor, extends ActorInitializationException(actor,
"exception post restart (" + (if (originalCause == null) "null" else originalCause.getClass) + ")", cause) "exception post restart (" + (if (originalCause == null) "null" else originalCause.getClass) + ")", cause)
@ -220,14 +220,14 @@ object OriginalRestartException {
* Currently only `null` is an invalid message. * Currently only `null` is an invalid message.
*/ */
@SerialVersionUID(1L) @SerialVersionUID(1L)
case class InvalidMessageException private[akka] (message: String) extends AkkaException(message) final case class InvalidMessageException private[akka] (message: String) extends AkkaException(message)
/** /**
* A DeathPactException is thrown by an Actor that receives a Terminated(someActor) message * A DeathPactException is thrown by an Actor that receives a Terminated(someActor) message
* that it doesn't handle itself, effectively crashing the Actor and escalating to the supervisor. * that it doesn't handle itself, effectively crashing the Actor and escalating to the supervisor.
*/ */
@SerialVersionUID(1L) @SerialVersionUID(1L)
case class DeathPactException private[akka] (dead: ActorRef) final case class DeathPactException private[akka] (dead: ActorRef)
extends AkkaException("Monitored actor [" + dead + "] terminated") extends AkkaException("Monitored actor [" + dead + "] terminated")
with NoStackTrace with NoStackTrace
@ -242,7 +242,7 @@ class ActorInterruptedException private[akka] (cause: Throwable) extends AkkaExc
* This message is published to the EventStream whenever an Actor receives a message it doesn't understand * This message is published to the EventStream whenever an Actor receives a message it doesn't understand
*/ */
@SerialVersionUID(1L) @SerialVersionUID(1L)
case class UnhandledMessage(@BeanProperty message: Any, @BeanProperty sender: ActorRef, @BeanProperty recipient: ActorRef) final case class UnhandledMessage(@BeanProperty message: Any, @BeanProperty sender: ActorRef, @BeanProperty recipient: ActorRef)
/** /**
* Classes for passing status back to the sender. * Classes for passing status back to the sender.
@ -255,14 +255,14 @@ object Status {
* This class/message type is preferably used to indicate success of some operation performed. * This class/message type is preferably used to indicate success of some operation performed.
*/ */
@SerialVersionUID(1L) @SerialVersionUID(1L)
case class Success(status: Any) extends Status final case class Success(status: Any) extends Status
/** /**
* This class/message type is preferably used to indicate failure of some operation performed. * This class/message type is preferably used to indicate failure of some operation performed.
* As an example, it is used to signal failure with AskSupport is used (ask/?). * As an example, it is used to signal failure with AskSupport is used (ask/?).
*/ */
@SerialVersionUID(1L) @SerialVersionUID(1L)
case class Failure(cause: Throwable) extends Status final case class Failure(cause: Throwable) extends Status
} }
/** /**

View file

@ -394,7 +394,7 @@ private[akka] class LocalActorRef private[akka] (
* INTERNAL API * INTERNAL API
*/ */
@SerialVersionUID(1L) @SerialVersionUID(1L)
private[akka] case class SerializedActorRef private (path: String) { private[akka] final case class SerializedActorRef private (path: String) {
import akka.serialization.JavaSerializer.currentSystem import akka.serialization.JavaSerializer.currentSystem
def this(actorRef: ActorRef) = { def this(actorRef: ActorRef) = {
@ -451,7 +451,7 @@ private[akka] trait MinimalActorRef extends InternalActorRef with LocalRef {
* to the ActorSystem's EventStream * to the ActorSystem's EventStream
*/ */
@SerialVersionUID(1L) @SerialVersionUID(1L)
case class DeadLetter(message: Any, sender: ActorRef, recipient: ActorRef) { final case class DeadLetter(message: Any, sender: ActorRef, recipient: ActorRef) {
require(sender ne null, "DeadLetter sender may not be null") require(sender ne null, "DeadLetter sender may not be null")
require(recipient ne null, "DeadLetter recipient may not be null") require(recipient ne null, "DeadLetter recipient may not be null")
} }

View file

@ -340,7 +340,7 @@ trait ActorRefFactory {
/** /**
* Internal Akka use only, used in implementation of system.stop(child). * Internal Akka use only, used in implementation of system.stop(child).
*/ */
private[akka] case class StopChild(child: ActorRef) private[akka] final case class StopChild(child: ActorRef)
/** /**
* INTERNAL API * INTERNAL API

View file

@ -239,7 +239,7 @@ trait ScalaActorSelection {
* message is delivered by traversing the various actor paths involved. * message is delivered by traversing the various actor paths involved.
*/ */
@SerialVersionUID(1L) @SerialVersionUID(1L)
private[akka] case class ActorSelectionMessage(msg: Any, elements: immutable.Iterable[SelectionPathElement]) private[akka] final case class ActorSelectionMessage(msg: Any, elements: immutable.Iterable[SelectionPathElement])
extends AutoReceivedMessage with PossiblyHarmful { extends AutoReceivedMessage with PossiblyHarmful {
def identifyRequest: Option[Identify] = msg match { def identifyRequest: Option[Identify] = msg match {
@ -258,7 +258,7 @@ private[akka] sealed trait SelectionPathElement
* INTERNAL API * INTERNAL API
*/ */
@SerialVersionUID(2L) @SerialVersionUID(2L)
private[akka] case class SelectChildName(name: String) extends SelectionPathElement { private[akka] final case class SelectChildName(name: String) extends SelectionPathElement {
override def toString: String = name override def toString: String = name
} }
@ -266,7 +266,7 @@ private[akka] case class SelectChildName(name: String) extends SelectionPathElem
* INTERNAL API * INTERNAL API
*/ */
@SerialVersionUID(2L) @SerialVersionUID(2L)
private[akka] case class SelectChildPattern(patternStr: String) extends SelectionPathElement { private[akka] final case class SelectChildPattern(patternStr: String) extends SelectionPathElement {
val pattern: Pattern = Helpers.makePattern(patternStr) val pattern: Pattern = Helpers.makePattern(patternStr)
override def toString: String = patternStr override def toString: String = patternStr
} }
@ -284,5 +284,5 @@ private[akka] case object SelectParent extends SelectionPathElement {
* `Future` is completed with this failure. * `Future` is completed with this failure.
*/ */
@SerialVersionUID(1L) @SerialVersionUID(1L)
case class ActorNotFound(selection: ActorSelection) extends RuntimeException("Actor not found for: " + selection) final case class ActorNotFound(selection: ActorSelection) extends RuntimeException("Actor not found for: " + selection)

View file

@ -29,26 +29,26 @@ object FSM {
* [[akka.actor.FSM.SubscribeTransitionCallBack]] before sending any * [[akka.actor.FSM.SubscribeTransitionCallBack]] before sending any
* [[akka.actor.FSM.Transition]] messages. * [[akka.actor.FSM.Transition]] messages.
*/ */
case class CurrentState[S](fsmRef: ActorRef, state: S) final case class CurrentState[S](fsmRef: ActorRef, state: S)
/** /**
* Message type which is used to communicate transitions between states to * Message type which is used to communicate transitions between states to
* all subscribed listeners (use [[akka.actor.FSM.SubscribeTransitionCallBack]]). * all subscribed listeners (use [[akka.actor.FSM.SubscribeTransitionCallBack]]).
*/ */
case class Transition[S](fsmRef: ActorRef, from: S, to: S) final case class Transition[S](fsmRef: ActorRef, from: S, to: S)
/** /**
* Send this to an [[akka.actor.FSM]] to request first the [[FSM.CurrentState]] * Send this to an [[akka.actor.FSM]] to request first the [[FSM.CurrentState]]
* and then a series of [[FSM.Transition]] updates. Cancel the subscription * and then a series of [[FSM.Transition]] updates. Cancel the subscription
* using [[FSM.UnsubscribeTransitionCallBack]]. * using [[FSM.UnsubscribeTransitionCallBack]].
*/ */
case class SubscribeTransitionCallBack(actorRef: ActorRef) final case class SubscribeTransitionCallBack(actorRef: ActorRef)
/** /**
* Unsubscribe from [[akka.actor.FSM.Transition]] notifications which was * Unsubscribe from [[akka.actor.FSM.Transition]] notifications which was
* effected by sending the corresponding [[akka.actor.FSM.SubscribeTransitionCallBack]]. * effected by sending the corresponding [[akka.actor.FSM.SubscribeTransitionCallBack]].
*/ */
case class UnsubscribeTransitionCallBack(actorRef: ActorRef) final case class UnsubscribeTransitionCallBack(actorRef: ActorRef)
/** /**
* Reason why this [[akka.actor.FSM]] is shutting down. * Reason why this [[akka.actor.FSM]] is shutting down.
@ -71,7 +71,7 @@ object FSM {
* an error, e.g. if the state to transition into does not exist. You can use * an error, e.g. if the state to transition into does not exist. You can use
* this to communicate a more precise cause to the [[akka.actor.FSM.onTermination]] block. * this to communicate a more precise cause to the [[akka.actor.FSM.onTermination]] block.
*/ */
case class Failure(cause: Any) extends Reason final case class Failure(cause: Any) extends Reason
/** /**
* This case object is received in case of a state timeout. * This case object is received in case of a state timeout.
@ -81,13 +81,13 @@ object FSM {
/** /**
* INTERNAL API * INTERNAL API
*/ */
private case class TimeoutMarker(generation: Long) private final case class TimeoutMarker(generation: Long)
/** /**
* INTERNAL API * INTERNAL API
*/ */
// FIXME: what about the cancellable? // FIXME: what about the cancellable?
private[akka] case class Timer(name: String, msg: Any, repeat: Boolean, generation: Int)(context: ActorContext) private[akka] final case class Timer(name: String, msg: Any, repeat: Boolean, generation: Int)(context: ActorContext)
extends NoSerializationVerificationNeeded { extends NoSerializationVerificationNeeded {
private var ref: Option[Cancellable] = _ private var ref: Option[Cancellable] = _
private val scheduler = context.system.scheduler private val scheduler = context.system.scheduler
@ -116,14 +116,14 @@ object FSM {
/** /**
* Log Entry of the [[akka.actor.LoggingFSM]], can be obtained by calling `getLog`. * Log Entry of the [[akka.actor.LoggingFSM]], can be obtained by calling `getLog`.
*/ */
case class LogEntry[S, D](stateName: S, stateData: D, event: Any) final case class LogEntry[S, D](stateName: S, stateData: D, event: Any)
/** /**
* This captures all of the managed state of the [[akka.actor.FSM]]: the state * This captures all of the managed state of the [[akka.actor.FSM]]: the state
* name, the state data, possibly custom timeout, stop reason and replies * name, the state data, possibly custom timeout, stop reason and replies
* accumulated while processing the last message. * accumulated while processing the last message.
*/ */
case class State[S, D](stateName: S, stateData: D, timeout: Option[FiniteDuration] = None, stopReason: Option[Reason] = None, replies: List[Any] = Nil) { final case class State[S, D](stateName: S, stateData: D, timeout: Option[FiniteDuration] = None, stopReason: Option[Reason] = None, replies: List[Any] = Nil) {
/** /**
* Modify state transition descriptor to include a state timeout for the * Modify state transition descriptor to include a state timeout for the
@ -165,13 +165,13 @@ object FSM {
* All messages sent to the [[akka.actor.FSM]] will be wrapped inside an * All messages sent to the [[akka.actor.FSM]] will be wrapped inside an
* `Event`, which allows pattern matching to extract both state and data. * `Event`, which allows pattern matching to extract both state and data.
*/ */
case class Event[D](event: Any, stateData: D) extends NoSerializationVerificationNeeded final case class Event[D](event: Any, stateData: D) extends NoSerializationVerificationNeeded
/** /**
* Case class representing the state of the [[akka.actor.FSM]] whithin the * Case class representing the state of the [[akka.actor.FSM]] whithin the
* `onTermination` block. * `onTermination` block.
*/ */
case class StopEvent[S, D](reason: Reason, currentState: S, stateData: D) extends NoSerializationVerificationNeeded final case class StopEvent[S, D](reason: Reason, currentState: S, stateData: D) extends NoSerializationVerificationNeeded
} }

View file

@ -29,7 +29,7 @@ private[akka] case object ChildNameReserved extends ChildStats
* ChildRestartStats is the statistics kept by every parent Actor for every child Actor * ChildRestartStats is the statistics kept by every parent Actor for every child Actor
* and is used for SupervisorStrategies to know how to deal with problems that occur for the children. * and is used for SupervisorStrategies to know how to deal with problems that occur for the children.
*/ */
case class ChildRestartStats(child: ActorRef, var maxNrOfRetriesCount: Int = 0, var restartTimeWindowStartNanos: Long = 0L) final case class ChildRestartStats(child: ActorRef, var maxNrOfRetriesCount: Int = 0, var restartTimeWindowStartNanos: Long = 0L)
extends ChildStats { extends ChildStats {
def uid: Int = child.path.uid def uid: Int = child.path.uid
@ -459,4 +459,3 @@ case class OneForOneStrategy(
context.stop(child) //TODO optimization to drop child here already? context.stop(child) //TODO optimization to drop child here already?
} }
} }

View file

@ -22,7 +22,7 @@ import akka.dispatch.AbstractNodeQueue
* This exception is thrown by Scheduler.schedule* when scheduling is not * This exception is thrown by Scheduler.schedule* when scheduling is not
* possible, e.g. after shutting down the Scheduler. * possible, e.g. after shutting down the Scheduler.
*/ */
private case class SchedulerException(msg: String) extends akka.AkkaException(msg) with NoStackTrace private final case class SchedulerException(msg: String) extends akka.AkkaException(msg) with NoStackTrace
// The Scheduler trait is included in the documentation. KEEP THE LINES SHORT!!! // The Scheduler trait is included in the documentation. KEEP THE LINES SHORT!!!
//#scheduler //#scheduler

View file

@ -128,7 +128,7 @@ object TypedActor extends ExtensionId[TypedActorExtension] with ExtensionIdProvi
* This class represents a Method call, and has a reference to the Method to be called and the parameters to supply * This class represents a Method call, and has a reference to the Method to be called and the parameters to supply
* It's sent to the ActorRef backing the TypedActor and can be serialized and deserialized * It's sent to the ActorRef backing the TypedActor and can be serialized and deserialized
*/ */
case class MethodCall(method: Method, parameters: Array[AnyRef]) { final case class MethodCall(method: Method, parameters: Array[AnyRef]) {
def isOneWay = method.getReturnType == java.lang.Void.TYPE def isOneWay = method.getReturnType == java.lang.Void.TYPE
def returnsFuture = classOf[Future[_]] isAssignableFrom method.getReturnType def returnsFuture = classOf[Future[_]] isAssignableFrom method.getReturnType
@ -170,7 +170,7 @@ object TypedActor extends ExtensionId[TypedActorExtension] with ExtensionIdProvi
* *
* Represents the serialized form of a MethodCall, uses readResolve and writeReplace to marshall the call * Represents the serialized form of a MethodCall, uses readResolve and writeReplace to marshall the call
*/ */
private[akka] case class SerializedMethodCall(ownerType: Class[_], methodName: String, parameterTypes: Array[Class[_]], serializedParameters: Array[(Int, Class[_], Array[Byte])]) { private[akka] final case class SerializedMethodCall(ownerType: Class[_], methodName: String, parameterTypes: Array[Class[_]], serializedParameters: Array[(Int, Class[_], Array[Byte])]) {
//TODO implement writeObject and readObject to serialize //TODO implement writeObject and readObject to serialize
//TODO Possible optimization is to special encode the parameter-types to conserve space //TODO Possible optimization is to special encode the parameter-types to conserve space
@ -442,7 +442,7 @@ object TypedActor extends ExtensionId[TypedActorExtension] with ExtensionIdProvi
/** /**
* INTERNAL API * INTERNAL API
*/ */
private[akka] case class SerializedTypedActorInvocationHandler(val actor: ActorRef, val timeout: FiniteDuration) { private[akka] final case class SerializedTypedActorInvocationHandler(val actor: ActorRef, val timeout: FiniteDuration) {
@throws(classOf[ObjectStreamException]) private def readResolve(): AnyRef = JavaSerializer.currentSystem.value match { @throws(classOf[ObjectStreamException]) private def readResolve(): AnyRef = JavaSerializer.currentSystem.value match {
case null throw new IllegalStateException("SerializedTypedActorInvocationHandler.readResolve requires that JavaSerializer.currentSystem.value is set to a non-null value") case null throw new IllegalStateException("SerializedTypedActorInvocationHandler.readResolve requires that JavaSerializer.currentSystem.value is set to a non-null value")
case some toTypedActorInvocationHandler(some) case some toTypedActorInvocationHandler(some)
@ -522,7 +522,7 @@ object TypedProps {
* It's used in TypedActorFactory.typedActorOf to configure a TypedActor instance. * It's used in TypedActorFactory.typedActorOf to configure a TypedActor instance.
*/ */
@SerialVersionUID(1L) @SerialVersionUID(1L)
case class TypedProps[T <: AnyRef] protected[TypedProps] ( final case class TypedProps[T <: AnyRef] protected[TypedProps] (
interfaces: immutable.Seq[Class[_]], interfaces: immutable.Seq[Class[_]],
creator: () T, creator: () T,
dispatcher: String = TypedProps.defaultDispatcherId, dispatcher: String = TypedProps.defaultDispatcherId,
@ -626,7 +626,7 @@ case class TypedProps[T <: AnyRef] protected[TypedProps] (
* ContextualTypedActorFactory allows TypedActors to create children, effectively forming the same Actor Supervision Hierarchies * ContextualTypedActorFactory allows TypedActors to create children, effectively forming the same Actor Supervision Hierarchies
* as normal Actors can. * as normal Actors can.
*/ */
case class ContextualTypedActorFactory(typedActor: TypedActorExtension, actorFactory: ActorContext) extends TypedActorFactory { final case class ContextualTypedActorFactory(typedActor: TypedActorExtension, actorFactory: ActorContext) extends TypedActorFactory {
override def getActorRefFor(proxy: AnyRef): ActorRef = typedActor.getActorRefFor(proxy) override def getActorRefFor(proxy: AnyRef): ActorRef = typedActor.getActorRefFor(proxy)
override def isTypedActor(proxyOrNot: AnyRef): Boolean = typedActor.isTypedActor(proxyOrNot) override def isTypedActor(proxyOrNot: AnyRef): Boolean = typedActor.isTypedActor(proxyOrNot)
} }

View file

@ -31,13 +31,13 @@ private[akka] object Inbox {
def withClient(c: ActorRef): Query def withClient(c: ActorRef): Query
def client: ActorRef def client: ActorRef
} }
private case class Get(deadline: Deadline, client: ActorRef = null) extends Query { private final case class Get(deadline: Deadline, client: ActorRef = null) extends Query {
def withClient(c: ActorRef) = copy(client = c) def withClient(c: ActorRef) = copy(client = c)
} }
private case class Select(deadline: Deadline, predicate: PartialFunction[Any, Any], client: ActorRef = null) extends Query { private final case class Select(deadline: Deadline, predicate: PartialFunction[Any, Any], client: ActorRef = null) extends Query {
def withClient(c: ActorRef) = copy(client = c) def withClient(c: ActorRef) = copy(client = c)
} }
private case class StartWatch(target: ActorRef) private final case class StartWatch(target: ActorRef)
private case object Kick private case object Kick
} }

View file

@ -46,8 +46,8 @@ private[akka] object ChildrenContainer {
sealed trait SuspendReason sealed trait SuspendReason
case object UserRequest extends SuspendReason case object UserRequest extends SuspendReason
// careful with those system messages, all handling to be taking place in ActorCell.scala! // careful with those system messages, all handling to be taking place in ActorCell.scala!
case class Recreation(cause: Throwable) extends SuspendReason with WaitingForChildren final case class Recreation(cause: Throwable) extends SuspendReason with WaitingForChildren
case class Creation() extends SuspendReason with WaitingForChildren final case class Creation() extends SuspendReason with WaitingForChildren
case object Termination extends SuspendReason case object Termination extends SuspendReason
class ChildRestartsIterable(stats: immutable.MapLike[_, ChildStats, _]) extends PartialImmutableValuesIterable[ChildStats, ChildRestartStats] { class ChildRestartsIterable(stats: immutable.MapLike[_, ChildStats, _]) extends PartialImmutableValuesIterable[ChildStats, ChildRestartStats] {
@ -156,7 +156,7 @@ private[akka] object ChildrenContainer {
* type of container, depending on whether or not children are left and whether or not * type of container, depending on whether or not children are left and whether or not
* the reason was Terminating. * the reason was Terminating.
*/ */
case class TerminatingChildrenContainer(c: immutable.TreeMap[String, ChildStats], toDie: Set[ActorRef], reason: SuspendReason) final case class TerminatingChildrenContainer(c: immutable.TreeMap[String, ChildStats], toDie: Set[ActorRef], reason: SuspendReason)
extends ChildrenContainer { extends ChildrenContainer {
override def add(name: String, stats: ChildRestartStats): ChildrenContainer = copy(c.updated(name, stats)) override def add(name: String, stats: ChildRestartStats): ChildrenContainer = copy(c.updated(name, stats))

View file

@ -20,8 +20,8 @@ private[akka] object CachingConfig {
val exists: Boolean val exists: Boolean
val config: Config val config: Config
} }
case class ValuePathEntry(valid: Boolean, exists: Boolean, config: Config = emptyConfig) extends PathEntry final case class ValuePathEntry(valid: Boolean, exists: Boolean, config: Config = emptyConfig) extends PathEntry
case class StringPathEntry(valid: Boolean, exists: Boolean, config: Config, value: String) extends PathEntry final case class StringPathEntry(valid: Boolean, exists: Boolean, config: Config, value: String) extends PathEntry
val invalidPathEntry = ValuePathEntry(false, true) val invalidPathEntry = ValuePathEntry(false, true)
val nonExistingPathEntry = ValuePathEntry(true, false) val nonExistingPathEntry = ValuePathEntry(true, false)

View file

@ -31,7 +31,7 @@ trait DispatcherPrerequisites {
/** /**
* INTERNAL API * INTERNAL API
*/ */
private[akka] case class DefaultDispatcherPrerequisites( private[akka] final case class DefaultDispatcherPrerequisites(
val threadFactory: ThreadFactory, val threadFactory: ThreadFactory,
val eventStream: EventStream, val eventStream: EventStream,
val scheduler: Scheduler, val scheduler: Scheduler,

View file

@ -547,7 +547,7 @@ trait ProducesMessageQueue[T <: MessageQueue]
/** /**
* UnboundedMailbox is the default unbounded MailboxType used by Akka Actors. * UnboundedMailbox is the default unbounded MailboxType used by Akka Actors.
*/ */
case class UnboundedMailbox() extends MailboxType with ProducesMessageQueue[UnboundedMailbox.MessageQueue] { final case class UnboundedMailbox() extends MailboxType with ProducesMessageQueue[UnboundedMailbox.MessageQueue] {
def this(settings: ActorSystem.Settings, config: Config) = this() def this(settings: ActorSystem.Settings, config: Config) = this()
@ -566,7 +566,7 @@ object UnboundedMailbox {
* the only drawback is that you can't have multiple consumers, * the only drawback is that you can't have multiple consumers,
* which rules out using it with BalancingPool (BalancingDispatcher) for instance. * which rules out using it with BalancingPool (BalancingDispatcher) for instance.
*/ */
case class SingleConsumerOnlyUnboundedMailbox() extends MailboxType with ProducesMessageQueue[NodeMessageQueue] { final case class SingleConsumerOnlyUnboundedMailbox() extends MailboxType with ProducesMessageQueue[NodeMessageQueue] {
def this(settings: ActorSystem.Settings, config: Config) = this() def this(settings: ActorSystem.Settings, config: Config) = this()
@ -576,7 +576,7 @@ case class SingleConsumerOnlyUnboundedMailbox() extends MailboxType with Produce
/** /**
* BoundedMailbox is the default bounded MailboxType used by Akka Actors. * BoundedMailbox is the default bounded MailboxType used by Akka Actors.
*/ */
case class BoundedMailbox(val capacity: Int, val pushTimeOut: FiniteDuration) final case class BoundedMailbox(val capacity: Int, val pushTimeOut: FiniteDuration)
extends MailboxType with ProducesMessageQueue[BoundedMailbox.MessageQueue] { extends MailboxType with ProducesMessageQueue[BoundedMailbox.MessageQueue] {
def this(settings: ActorSystem.Settings, config: Config) = this(config.getInt("mailbox-capacity"), def this(settings: ActorSystem.Settings, config: Config) = this(config.getInt("mailbox-capacity"),
@ -639,7 +639,7 @@ object BoundedPriorityMailbox {
/** /**
* UnboundedDequeBasedMailbox is an unbounded MailboxType, backed by a Deque. * UnboundedDequeBasedMailbox is an unbounded MailboxType, backed by a Deque.
*/ */
case class UnboundedDequeBasedMailbox() extends MailboxType with ProducesMessageQueue[UnboundedDequeBasedMailbox.MessageQueue] { final case class UnboundedDequeBasedMailbox() extends MailboxType with ProducesMessageQueue[UnboundedDequeBasedMailbox.MessageQueue] {
def this(settings: ActorSystem.Settings, config: Config) = this() def this(settings: ActorSystem.Settings, config: Config) = this()

View file

@ -65,7 +65,7 @@ trait ExecutorServiceFactoryProvider {
/** /**
* A small configuration DSL to create ThreadPoolExecutors that can be provided as an ExecutorServiceFactoryProvider to Dispatcher * A small configuration DSL to create ThreadPoolExecutors that can be provided as an ExecutorServiceFactoryProvider to Dispatcher
*/ */
case class ThreadPoolConfig(allowCorePoolTimeout: Boolean = ThreadPoolConfig.defaultAllowCoreThreadTimeout, final case class ThreadPoolConfig(allowCorePoolTimeout: Boolean = ThreadPoolConfig.defaultAllowCoreThreadTimeout,
corePoolSize: Int = ThreadPoolConfig.defaultCorePoolSize, corePoolSize: Int = ThreadPoolConfig.defaultCorePoolSize,
maxPoolSize: Int = ThreadPoolConfig.defaultMaxPoolSize, maxPoolSize: Int = ThreadPoolConfig.defaultMaxPoolSize,
threadTimeout: Duration = ThreadPoolConfig.defaultTimeout, threadTimeout: Duration = ThreadPoolConfig.defaultTimeout,
@ -102,7 +102,7 @@ case class ThreadPoolConfig(allowCorePoolTimeout: Boolean = ThreadPoolConfig.def
/** /**
* A DSL to configure and create a MessageDispatcher with a ThreadPoolExecutor * A DSL to configure and create a MessageDispatcher with a ThreadPoolExecutor
*/ */
case class ThreadPoolConfigBuilder(config: ThreadPoolConfig) { final case class ThreadPoolConfigBuilder(config: ThreadPoolConfig) {
import ThreadPoolConfig._ import ThreadPoolConfig._
def withNewThreadPoolWithCustomBlockingQueue(newQueueFactory: QueueFactory): ThreadPoolConfigBuilder = def withNewThreadPoolWithCustomBlockingQueue(newQueueFactory: QueueFactory): ThreadPoolConfigBuilder =
@ -176,7 +176,7 @@ object MonitorableThreadFactory {
} }
} }
case class MonitorableThreadFactory(name: String, final case class MonitorableThreadFactory(name: String,
daemonic: Boolean, daemonic: Boolean,
contextClassLoader: Option[ClassLoader], contextClassLoader: Option[ClassLoader],
exceptionHandler: Thread.UncaughtExceptionHandler = MonitorableThreadFactory.doNothing, exceptionHandler: Thread.UncaughtExceptionHandler = MonitorableThreadFactory.doNothing,

View file

@ -207,32 +207,32 @@ private[akka] trait StashWhenFailed
* INTERNAL API * INTERNAL API
*/ */
@SerialVersionUID(1L) @SerialVersionUID(1L)
private[akka] case class Create(failure: Option[ActorInitializationException]) extends SystemMessage // sent to self from Dispatcher.register private[akka] final case class Create(failure: Option[ActorInitializationException]) extends SystemMessage // sent to self from Dispatcher.register
/** /**
* INTERNAL API * INTERNAL API
*/ */
@SerialVersionUID(1L) @SerialVersionUID(1L)
private[akka] case class Recreate(cause: Throwable) extends SystemMessage with StashWhenWaitingForChildren // sent to self from ActorCell.restart private[akka] final case class Recreate(cause: Throwable) extends SystemMessage with StashWhenWaitingForChildren // sent to self from ActorCell.restart
/** /**
* INTERNAL API * INTERNAL API
*/ */
@SerialVersionUID(1L) @SerialVersionUID(1L)
private[akka] case class Suspend() extends SystemMessage with StashWhenWaitingForChildren // sent to self from ActorCell.suspend private[akka] final case class Suspend() extends SystemMessage with StashWhenWaitingForChildren // sent to self from ActorCell.suspend
/** /**
* INTERNAL API * INTERNAL API
*/ */
@SerialVersionUID(1L) @SerialVersionUID(1L)
private[akka] case class Resume(causedByFailure: Throwable) extends SystemMessage with StashWhenWaitingForChildren // sent to self from ActorCell.resume private[akka] final case class Resume(causedByFailure: Throwable) extends SystemMessage with StashWhenWaitingForChildren // sent to self from ActorCell.resume
/** /**
* INTERNAL API * INTERNAL API
*/ */
@SerialVersionUID(1L) @SerialVersionUID(1L)
private[akka] case class Terminate() extends SystemMessage // sent to self from ActorCell.stop private[akka] final case class Terminate() extends SystemMessage // sent to self from ActorCell.stop
/** /**
* INTERNAL API * INTERNAL API
*/ */
@SerialVersionUID(1L) @SerialVersionUID(1L)
private[akka] case class Supervise(child: ActorRef, async: Boolean) extends SystemMessage // sent to supervisor ActorRef from ActorCell.start private[akka] final case class Supervise(child: ActorRef, async: Boolean) extends SystemMessage // sent to supervisor ActorRef from ActorCell.start
/** /**
* INTERNAL API * INTERNAL API
*/ */
@ -242,7 +242,7 @@ private[akka] case class Watch(watchee: InternalActorRef, watcher: InternalActor
* INTERNAL API * INTERNAL API
*/ */
@SerialVersionUID(1L) @SerialVersionUID(1L)
private[akka] case class Unwatch(watchee: ActorRef, watcher: ActorRef) extends SystemMessage // sent to tear down a DeathWatch private[akka] final case class Unwatch(watchee: ActorRef, watcher: ActorRef) extends SystemMessage // sent to tear down a DeathWatch
/** /**
* INTERNAL API * INTERNAL API
*/ */
@ -253,12 +253,12 @@ private[akka] case object NoMessage extends SystemMessage // switched into the m
* INTERNAL API * INTERNAL API
*/ */
@SerialVersionUID(1L) @SerialVersionUID(1L)
private[akka] case class Failed(child: ActorRef, cause: Throwable, uid: Int) extends SystemMessage private[akka] final case class Failed(child: ActorRef, cause: Throwable, uid: Int) extends SystemMessage
with StashWhenFailed with StashWhenFailed
with StashWhenWaitingForChildren with StashWhenWaitingForChildren
@SerialVersionUID(1L) @SerialVersionUID(1L)
private[akka] case class DeathWatchNotification( private[akka] final case class DeathWatchNotification(
actor: ActorRef, actor: ActorRef,
existenceConfirmed: Boolean, existenceConfirmed: Boolean,
addressTerminated: Boolean) extends SystemMessage addressTerminated: Boolean) extends SystemMessage

View file

@ -408,7 +408,7 @@ object Logging {
/** /**
* Marker trait for annotating LogLevel, which must be Int after erasure. * Marker trait for annotating LogLevel, which must be Int after erasure.
*/ */
case class LogLevel(asInt: Int) extends AnyVal { final case class LogLevel(asInt: Int) extends AnyVal {
@inline final def >=(other: LogLevel): Boolean = asInt >= other.asInt @inline final def >=(other: LogLevel): Boolean = asInt >= other.asInt
@inline final def <=(other: LogLevel): Boolean = asInt <= other.asInt @inline final def <=(other: LogLevel): Boolean = asInt <= other.asInt
@inline final def >(other: LogLevel): Boolean = asInt > other.asInt @inline final def >(other: LogLevel): Boolean = asInt > other.asInt
@ -684,7 +684,7 @@ object Logging {
* message. This is necessary to ensure that additional subscriptions are in * message. This is necessary to ensure that additional subscriptions are in
* effect when the logging system finished starting. * effect when the logging system finished starting.
*/ */
case class InitializeLogger(bus: LoggingBus) extends NoSerializationVerificationNeeded final case class InitializeLogger(bus: LoggingBus) extends NoSerializationVerificationNeeded
/** /**
* Response message each logger must send within 1 second after receiving the * Response message each logger must send within 1 second after receiving the

View file

@ -35,7 +35,7 @@ object Inet {
* *
* For more information see [[java.net.Socket.setReceiveBufferSize]] * For more information see [[java.net.Socket.setReceiveBufferSize]]
*/ */
case class ReceiveBufferSize(size: Int) extends SocketOption { final case class ReceiveBufferSize(size: Int) extends SocketOption {
require(size > 0, "ReceiveBufferSize must be > 0") require(size > 0, "ReceiveBufferSize must be > 0")
override def beforeServerSocketBind(s: ServerSocket): Unit = s.setReceiveBufferSize(size) override def beforeServerSocketBind(s: ServerSocket): Unit = s.setReceiveBufferSize(size)
override def beforeDatagramBind(s: DatagramSocket): Unit = s.setReceiveBufferSize(size) override def beforeDatagramBind(s: DatagramSocket): Unit = s.setReceiveBufferSize(size)
@ -49,7 +49,7 @@ object Inet {
* *
* For more information see [[java.net.Socket.setReuseAddress]] * For more information see [[java.net.Socket.setReuseAddress]]
*/ */
case class ReuseAddress(on: Boolean) extends SocketOption { final case class ReuseAddress(on: Boolean) extends SocketOption {
override def beforeServerSocketBind(s: ServerSocket): Unit = s.setReuseAddress(on) override def beforeServerSocketBind(s: ServerSocket): Unit = s.setReuseAddress(on)
override def beforeDatagramBind(s: DatagramSocket): Unit = s.setReuseAddress(on) override def beforeDatagramBind(s: DatagramSocket): Unit = s.setReuseAddress(on)
override def beforeConnect(s: Socket): Unit = s.setReuseAddress(on) override def beforeConnect(s: Socket): Unit = s.setReuseAddress(on)
@ -60,7 +60,7 @@ object Inet {
* *
* For more information see [[java.net.Socket.setSendBufferSize]] * For more information see [[java.net.Socket.setSendBufferSize]]
*/ */
case class SendBufferSize(size: Int) extends SocketOption { final case class SendBufferSize(size: Int) extends SocketOption {
require(size > 0, "SendBufferSize must be > 0") require(size > 0, "SendBufferSize must be > 0")
override def afterConnect(s: Socket): Unit = s.setSendBufferSize(size) override def afterConnect(s: Socket): Unit = s.setSendBufferSize(size)
} }
@ -72,7 +72,7 @@ object Inet {
* *
* For more information see [[java.net.Socket.setTrafficClass]] * For more information see [[java.net.Socket.setTrafficClass]]
*/ */
case class TrafficClass(tc: Int) extends SocketOption { final case class TrafficClass(tc: Int) extends SocketOption {
require(0 <= tc && tc <= 255, "TrafficClass needs to be in the interval [0, 255]") require(0 <= tc && tc <= 255, "TrafficClass needs to be in the interval [0, 255]")
override def afterConnect(s: Socket): Unit = s.setTrafficClass(tc) override def afterConnect(s: Socket): Unit = s.setTrafficClass(tc)
} }

View file

@ -65,10 +65,10 @@ private[io] object SelectionHandler {
def failureMessage: Any def failureMessage: Any
} }
case class WorkerForCommand(apiCommand: HasFailureMessage, commander: ActorRef, childProps: ChannelRegistry Props) final case class WorkerForCommand(apiCommand: HasFailureMessage, commander: ActorRef, childProps: ChannelRegistry Props)
extends NoSerializationVerificationNeeded extends NoSerializationVerificationNeeded
case class Retry(command: WorkerForCommand, retriesLeft: Int) extends NoSerializationVerificationNeeded { require(retriesLeft >= 0) } final case class Retry(command: WorkerForCommand, retriesLeft: Int) extends NoSerializationVerificationNeeded { require(retriesLeft >= 0) }
case object ChannelConnectable case object ChannelConnectable
case object ChannelAcceptable case object ChannelAcceptable

View file

@ -55,7 +55,7 @@ object Tcp extends ExtensionId[TcpExt] with ExtensionIdProvider {
* *
* For more information see [[java.net.Socket.setKeepAlive]] * For more information see [[java.net.Socket.setKeepAlive]]
*/ */
case class KeepAlive(on: Boolean) extends SocketOption { final case class KeepAlive(on: Boolean) extends SocketOption {
override def afterConnect(s: Socket): Unit = s.setKeepAlive(on) override def afterConnect(s: Socket): Unit = s.setKeepAlive(on)
} }
@ -66,7 +66,7 @@ object Tcp extends ExtensionId[TcpExt] with ExtensionIdProvider {
* *
* For more information see [[java.net.Socket.setOOBInline]] * For more information see [[java.net.Socket.setOOBInline]]
*/ */
case class OOBInline(on: Boolean) extends SocketOption { final case class OOBInline(on: Boolean) extends SocketOption {
override def afterConnect(s: Socket): Unit = s.setOOBInline(on) override def afterConnect(s: Socket): Unit = s.setOOBInline(on)
} }
@ -80,7 +80,7 @@ object Tcp extends ExtensionId[TcpExt] with ExtensionIdProvider {
* *
* For more information see [[java.net.Socket.setTcpNoDelay]] * For more information see [[java.net.Socket.setTcpNoDelay]]
*/ */
case class TcpNoDelay(on: Boolean) extends SocketOption { final case class TcpNoDelay(on: Boolean) extends SocketOption {
override def afterConnect(s: Socket): Unit = s.setTcpNoDelay(on) override def afterConnect(s: Socket): Unit = s.setTcpNoDelay(on)
} }
@ -110,7 +110,7 @@ object Tcp extends ExtensionId[TcpExt] with ExtensionIdProvider {
* @param localAddress optionally specifies a specific address to bind to * @param localAddress optionally specifies a specific address to bind to
* @param options Please refer to the [[SO]] object for a list of all supported options. * @param options Please refer to the [[SO]] object for a list of all supported options.
*/ */
case class Connect(remoteAddress: InetSocketAddress, final case class Connect(remoteAddress: InetSocketAddress,
localAddress: Option[InetSocketAddress] = None, localAddress: Option[InetSocketAddress] = None,
options: immutable.Traversable[SocketOption] = Nil, options: immutable.Traversable[SocketOption] = Nil,
timeout: Option[FiniteDuration] = None, timeout: Option[FiniteDuration] = None,
@ -135,7 +135,7 @@ object Tcp extends ExtensionId[TcpExt] with ExtensionIdProvider {
* *
* @param options Please refer to the [[SO]] object for a list of all supported options. * @param options Please refer to the [[SO]] object for a list of all supported options.
*/ */
case class Bind(handler: ActorRef, final case class Bind(handler: ActorRef,
localAddress: InetSocketAddress, localAddress: InetSocketAddress,
backlog: Int = 100, backlog: Int = 100,
options: immutable.Traversable[SocketOption] = Nil, options: immutable.Traversable[SocketOption] = Nil,
@ -159,7 +159,7 @@ object Tcp extends ExtensionId[TcpExt] with ExtensionIdProvider {
* notification until [[ResumeWriting]] is received. This can * notification until [[ResumeWriting]] is received. This can
* be used to implement NACK-based write backpressure. * be used to implement NACK-based write backpressure.
*/ */
case class Register(handler: ActorRef, keepOpenOnPeerClosed: Boolean = false, useResumeWriting: Boolean = true) extends Command final case class Register(handler: ActorRef, keepOpenOnPeerClosed: Boolean = false, useResumeWriting: Boolean = true) extends Command
/** /**
* In order to close down a listening socket, send this message to that sockets * In order to close down a listening socket, send this message to that sockets
@ -316,7 +316,7 @@ object Tcp extends ExtensionId[TcpExt] with ExtensionIdProvider {
* or have been sent!</b> Unfortunately there is no way to determine whether * or have been sent!</b> Unfortunately there is no way to determine whether
* a particular write has been sent by the O/S. * a particular write has been sent by the O/S.
*/ */
case class Write(data: ByteString, ack: Event) extends SimpleWriteCommand final case class Write(data: ByteString, ack: Event) extends SimpleWriteCommand
object Write { object Write {
/** /**
* The empty Write doesn't write anything and isn't acknowledged. * The empty Write doesn't write anything and isn't acknowledged.
@ -343,7 +343,7 @@ object Tcp extends ExtensionId[TcpExt] with ExtensionIdProvider {
* or have been sent!</b> Unfortunately there is no way to determine whether * or have been sent!</b> Unfortunately there is no way to determine whether
* a particular write has been sent by the O/S. * a particular write has been sent by the O/S.
*/ */
case class WriteFile(filePath: String, position: Long, count: Long, ack: Event) extends SimpleWriteCommand { final case class WriteFile(filePath: String, position: Long, count: Long, ack: Event) extends SimpleWriteCommand {
require(position >= 0, "WriteFile.position must be >= 0") require(position >= 0, "WriteFile.position must be >= 0")
require(count > 0, "WriteFile.count must be > 0") require(count > 0, "WriteFile.count must be > 0")
} }
@ -356,7 +356,7 @@ object Tcp extends ExtensionId[TcpExt] with ExtensionIdProvider {
* If the sub commands contain `ack` requests they will be honored as soon as the * If the sub commands contain `ack` requests they will be honored as soon as the
* respective write has been written completely. * respective write has been written completely.
*/ */
case class CompoundWrite(override val head: SimpleWriteCommand, tailCommand: WriteCommand) extends WriteCommand final case class CompoundWrite(override val head: SimpleWriteCommand, tailCommand: WriteCommand) extends WriteCommand
with immutable.Iterable[SimpleWriteCommand] { with immutable.Iterable[SimpleWriteCommand] {
def iterator: Iterator[SimpleWriteCommand] = def iterator: Iterator[SimpleWriteCommand] =
@ -399,7 +399,7 @@ object Tcp extends ExtensionId[TcpExt] with ExtensionIdProvider {
* for connection actors. * for connection actors.
* @param batchSize The number of connections to accept before waiting for the next resume command * @param batchSize The number of connections to accept before waiting for the next resume command
*/ */
case class ResumeAccepting(batchSize: Int) extends Command final case class ResumeAccepting(batchSize: Int) extends Command
/// EVENTS /// EVENTS
/** /**
@ -411,7 +411,7 @@ object Tcp extends ExtensionId[TcpExt] with ExtensionIdProvider {
* Whenever data are read from a socket they will be transferred within this * Whenever data are read from a socket they will be transferred within this
* class to the handler actor which was designated in the [[Register]] message. * class to the handler actor which was designated in the [[Register]] message.
*/ */
case class Received(data: ByteString) extends Event final case class Received(data: ByteString) extends Event
/** /**
* The connection actor sends this message either to the sender of a [[Connect]] * The connection actor sends this message either to the sender of a [[Connect]]
@ -419,13 +419,13 @@ object Tcp extends ExtensionId[TcpExt] with ExtensionIdProvider {
* in the [[Bind]] message. The connection is characterized by the `remoteAddress` * in the [[Bind]] message. The connection is characterized by the `remoteAddress`
* and `localAddress` TCP endpoints. * and `localAddress` TCP endpoints.
*/ */
case class Connected(remoteAddress: InetSocketAddress, localAddress: InetSocketAddress) extends Event final case class Connected(remoteAddress: InetSocketAddress, localAddress: InetSocketAddress) extends Event
/** /**
* Whenever a command cannot be completed, the queried actor will reply with * Whenever a command cannot be completed, the queried actor will reply with
* this message, wrapping the original command which failed. * this message, wrapping the original command which failed.
*/ */
case class CommandFailed(cmd: Command) extends Event final case class CommandFailed(cmd: Command) extends Event
/** /**
* When `useResumeWriting` is in effect as indicated in the [[Register]] message, * When `useResumeWriting` is in effect as indicated in the [[Register]] message,
@ -442,7 +442,7 @@ object Tcp extends ExtensionId[TcpExt] with ExtensionIdProvider {
* in this form. If the bind address indicated a 0 port number, then the contained * in this form. If the bind address indicated a 0 port number, then the contained
* `localAddress` can be used to find out which port was automatically assigned. * `localAddress` can be used to find out which port was automatically assigned.
*/ */
case class Bound(localAddress: InetSocketAddress) extends Event final case class Bound(localAddress: InetSocketAddress) extends Event
/** /**
* The sender of an [[Unbind]] command will receive confirmation through this * The sender of an [[Unbind]] command will receive confirmation through this
@ -507,7 +507,7 @@ object Tcp extends ExtensionId[TcpExt] with ExtensionIdProvider {
/** /**
* The connection has been closed due to an IO error. * The connection has been closed due to an IO error.
*/ */
case class ErrorClosed(cause: String) extends ConnectionClosed { final case class ErrorClosed(cause: String) extends ConnectionClosed {
override def isErrorClosed = true override def isErrorClosed = true
override def getErrorCause = cause override def getErrorCause = cause
} }

View file

@ -443,20 +443,20 @@ private[io] object TcpConnection {
* Used to transport information to the postStop method to notify * Used to transport information to the postStop method to notify
* interested party about a connection close. * interested party about a connection close.
*/ */
case class CloseInformation(notificationsTo: Set[ActorRef], closedEvent: Event) final case class CloseInformation(notificationsTo: Set[ActorRef], closedEvent: Event)
/** /**
* Groups required connection-related data that are only available once the connection has been fully established. * Groups required connection-related data that are only available once the connection has been fully established.
*/ */
case class ConnectionInfo(registration: ChannelRegistration, final case class ConnectionInfo(registration: ChannelRegistration,
handler: ActorRef, handler: ActorRef,
keepOpenOnPeerClosed: Boolean, keepOpenOnPeerClosed: Boolean,
useResumeWriting: Boolean) useResumeWriting: Boolean)
// INTERNAL MESSAGES // INTERNAL MESSAGES
case class UpdatePendingWrite(remainingWrite: PendingWrite) extends NoSerializationVerificationNeeded final case class UpdatePendingWrite(remainingWrite: PendingWrite) extends NoSerializationVerificationNeeded
case class WriteFileFailed(e: IOException) final case class WriteFileFailed(e: IOException)
sealed abstract class PendingWrite { sealed abstract class PendingWrite {
def commander: ActorRef def commander: ActorRef

View file

@ -18,11 +18,11 @@ import akka.dispatch.{ UnboundedMessageQueueSemantics, RequiresMessageQueue }
*/ */
private[io] object TcpListener { private[io] object TcpListener {
case class RegisterIncoming(channel: SocketChannel) extends HasFailureMessage with NoSerializationVerificationNeeded { final case class RegisterIncoming(channel: SocketChannel) extends HasFailureMessage with NoSerializationVerificationNeeded {
def failureMessage = FailedRegisterIncoming(channel) def failureMessage = FailedRegisterIncoming(channel)
} }
case class FailedRegisterIncoming(channel: SocketChannel) extends NoSerializationVerificationNeeded final case class FailedRegisterIncoming(channel: SocketChannel) extends NoSerializationVerificationNeeded
} }

View file

@ -77,7 +77,7 @@ object Udp extends ExtensionId[UdpExt] with ExtensionIdProvider {
* sending using this mechanism is not suitable if replies are expected, use * sending using this mechanism is not suitable if replies are expected, use
* [[Bind]] in that case. * [[Bind]] in that case.
*/ */
case class Send(payload: ByteString, target: InetSocketAddress, ack: Event) extends Command { final case class Send(payload: ByteString, target: InetSocketAddress, ack: Event) extends Command {
require(ack != null, "ack must be non-null. Use NoAck if you don't want acks.") require(ack != null, "ack must be non-null. Use NoAck if you don't want acks.")
def wantsAck: Boolean = !ack.isInstanceOf[NoAck] def wantsAck: Boolean = !ack.isInstanceOf[NoAck]
@ -92,7 +92,7 @@ object Udp extends ExtensionId[UdpExt] with ExtensionIdProvider {
* The listener actor for the newly bound port will reply with a [[Bound]] * The listener actor for the newly bound port will reply with a [[Bound]]
* message, or the manager will reply with a [[CommandFailed]] message. * message, or the manager will reply with a [[CommandFailed]] message.
*/ */
case class Bind(handler: ActorRef, final case class Bind(handler: ActorRef,
localAddress: InetSocketAddress, localAddress: InetSocketAddress,
options: immutable.Traversable[SocketOption] = Nil) extends Command options: immutable.Traversable[SocketOption] = Nil) extends Command
@ -139,20 +139,20 @@ object Udp extends ExtensionId[UdpExt] with ExtensionIdProvider {
* When a listener actor receives a datagram from its socket it will send * When a listener actor receives a datagram from its socket it will send
* it to the handler designated in the [[Bind]] message using this message type. * it to the handler designated in the [[Bind]] message using this message type.
*/ */
case class Received(data: ByteString, sender: InetSocketAddress) extends Event final case class Received(data: ByteString, sender: InetSocketAddress) extends Event
/** /**
* When a command fails it will be replied to with this message type, * When a command fails it will be replied to with this message type,
* wrapping the failing command object. * wrapping the failing command object.
*/ */
case class CommandFailed(cmd: Command) extends Event final case class CommandFailed(cmd: Command) extends Event
/** /**
* This message is sent by the listener actor in response to a [[Bind]] command. * This message is sent by the listener actor in response to a [[Bind]] command.
* If the address to bind to specified a port number of zero, then this message * If the address to bind to specified a port number of zero, then this message
* can be inspected to find out which port was automatically assigned. * can be inspected to find out which port was automatically assigned.
*/ */
case class Bound(localAddress: InetSocketAddress) extends Event final case class Bound(localAddress: InetSocketAddress) extends Event
/** /**
* The simple sender sends this message type in response to a [[SimpleSender]] query. * The simple sender sends this message type in response to a [[SimpleSender]] query.
@ -179,7 +179,7 @@ object Udp extends ExtensionId[UdpExt] with ExtensionIdProvider {
* *
* For more information see [[java.net.DatagramSocket#setBroadcast]] * For more information see [[java.net.DatagramSocket#setBroadcast]]
*/ */
case class Broadcast(on: Boolean) extends SocketOption { final case class Broadcast(on: Boolean) extends SocketOption {
override def beforeDatagramBind(s: DatagramSocket): Unit = s.setBroadcast(on) override def beforeDatagramBind(s: DatagramSocket): Unit = s.setBroadcast(on)
} }

View file

@ -68,7 +68,7 @@ object UdpConnected extends ExtensionId[UdpConnectedExt] with ExtensionIdProvide
* the connection actor will reply with the given object as soon as the datagram * the connection actor will reply with the given object as soon as the datagram
* has been successfully enqueued to the O/S kernel. * has been successfully enqueued to the O/S kernel.
*/ */
case class Send(payload: ByteString, ack: Any) extends Command { final case class Send(payload: ByteString, ack: Any) extends Command {
require(ack require(ack
!= null, "ack must be non-null. Use NoAck if you don't want acks.") != null, "ack must be non-null. Use NoAck if you don't want acks.")
@ -84,7 +84,7 @@ object UdpConnected extends ExtensionId[UdpConnectedExt] with ExtensionIdProvide
* which is restricted to sending to and receiving from the given `remoteAddress`. * which is restricted to sending to and receiving from the given `remoteAddress`.
* All received datagrams will be sent to the designated `handler` actor. * All received datagrams will be sent to the designated `handler` actor.
*/ */
case class Connect(handler: ActorRef, final case class Connect(handler: ActorRef,
remoteAddress: InetSocketAddress, remoteAddress: InetSocketAddress,
localAddress: Option[InetSocketAddress] = None, localAddress: Option[InetSocketAddress] = None,
options: immutable.Traversable[SocketOption] = Nil) extends Command options: immutable.Traversable[SocketOption] = Nil) extends Command
@ -119,13 +119,13 @@ object UdpConnected extends ExtensionId[UdpConnectedExt] with ExtensionIdProvide
* When a connection actor receives a datagram from its socket it will send * When a connection actor receives a datagram from its socket it will send
* it to the handler designated in the [[Udp.Bind]] message using this message type. * it to the handler designated in the [[Udp.Bind]] message using this message type.
*/ */
case class Received(data: ByteString) extends Event final case class Received(data: ByteString) extends Event
/** /**
* When a command fails it will be replied to with this message type, * When a command fails it will be replied to with this message type,
* wrapping the failing command object. * wrapping the failing command object.
*/ */
case class CommandFailed(cmd: Command) extends Event final case class CommandFailed(cmd: Command) extends Event
/** /**
* This message is sent by the connection actor to the actor which sent the * This message is sent by the connection actor to the actor which sent the

View file

@ -322,7 +322,7 @@ private[akka] final class PromiseActorRef private (val provider: ActorRefProvide
private[akka] object PromiseActorRef { private[akka] object PromiseActorRef {
private case object Registering private case object Registering
private case object Stopped private case object Stopped
private case class StoppedWithPath(path: ActorPath) private final case class StoppedWithPath(path: ActorPath)
def apply(provider: ActorRefProvider, timeout: Timeout, targetName: String): PromiseActorRef = { def apply(provider: ActorRefProvider, timeout: Timeout, targetName: String): PromiseActorRef = {
val result = Promise[Any]() val result = Promise[Any]()

View file

@ -414,7 +414,7 @@ final case class ConsistentHashingGroup(
* isn't a good representation, because LocalActorRef doesn't include the * isn't a good representation, because LocalActorRef doesn't include the
* host and port. * host and port.
*/ */
private[akka] case class ConsistentRoutee(routee: Routee, selfAddress: Address) { private[akka] final case class ConsistentRoutee(routee: Routee, selfAddress: Address) {
override def toString: String = routee match { override def toString: String = routee match {
case ActorRefRoutee(ref) toStringWithfullAddress(ref.path) case ActorRefRoutee(ref) toStringWithfullAddress(ref.path)
@ -481,7 +481,7 @@ private[akka] case class ConsistentRoutee(routee: Routee, selfAddress: Address)
*/ */
@SerialVersionUID(1L) @SerialVersionUID(1L)
@deprecated("Use ConsistentHashingPool or ConsistentHashingGroup", "2.3") @deprecated("Use ConsistentHashingPool or ConsistentHashingGroup", "2.3")
case class ConsistentHashingRouter( final case class ConsistentHashingRouter(
nrOfInstances: Int = 0, routees: immutable.Iterable[String] = Nil, override val resizer: Option[Resizer] = None, nrOfInstances: Int = 0, routees: immutable.Iterable[String] = Nil, override val resizer: Option[Resizer] = None,
val routerDispatcher: String = Dispatchers.DefaultDispatcherId, val routerDispatcher: String = Dispatchers.DefaultDispatcherId,
val supervisorStrategy: SupervisorStrategy = Pool.defaultSupervisorStrategy, val supervisorStrategy: SupervisorStrategy = Pool.defaultSupervisorStrategy,
@ -561,7 +561,7 @@ case class ConsistentHashingRouter(
* host and port. * host and port.
*/ */
@deprecated("Replaced by ConsistentRoutee", "2.3") @deprecated("Replaced by ConsistentRoutee", "2.3")
private[akka] case class ConsistentActorRef(actorRef: ActorRef, selfAddress: Address) { private[akka] final case class ConsistentActorRef(actorRef: ActorRef, selfAddress: Address) {
override def toString: String = { override def toString: String = {
actorRef.path.address match { actorRef.path.address match {
case Address(_, _, None, None) actorRef.path.toStringWithAddress(selfAddress) case Address(_, _, None, None) actorRef.path.toStringWithAddress(selfAddress)

View file

@ -42,7 +42,7 @@ import akka.dispatch.{ MailboxType, MessageDispatcher }
*/ */
@deprecated("Use GetRoutees", "2.3") @deprecated("Use GetRoutees", "2.3")
@SerialVersionUID(1L) @SerialVersionUID(1L)
case class RouterRoutees(routees: immutable.IndexedSeq[ActorRef]) { final case class RouterRoutees(routees: immutable.IndexedSeq[ActorRef]) {
/** /**
* Java API * Java API
*/ */
@ -99,7 +99,7 @@ object RoundRobinRouter {
*/ */
@SerialVersionUID(1L) @SerialVersionUID(1L)
@deprecated("Use RoundRobinPool or RoundRobinGroup", "2.3") @deprecated("Use RoundRobinPool or RoundRobinGroup", "2.3")
case class RoundRobinRouter(nrOfInstances: Int = 0, routees: immutable.Iterable[String] = Nil, override val resizer: Option[Resizer] = None, final case class RoundRobinRouter(nrOfInstances: Int = 0, routees: immutable.Iterable[String] = Nil, override val resizer: Option[Resizer] = None,
val routerDispatcher: String = Dispatchers.DefaultDispatcherId, val routerDispatcher: String = Dispatchers.DefaultDispatcherId,
val supervisorStrategy: SupervisorStrategy = Pool.defaultSupervisorStrategy) val supervisorStrategy: SupervisorStrategy = Pool.defaultSupervisorStrategy)
extends DeprecatedRouterConfig with PoolOverrideUnsetConfig[RoundRobinRouter] { extends DeprecatedRouterConfig with PoolOverrideUnsetConfig[RoundRobinRouter] {
@ -193,7 +193,7 @@ object RandomRouter {
*/ */
@SerialVersionUID(1L) @SerialVersionUID(1L)
@deprecated("Use RandomPool or RandomGroup", "2.3") @deprecated("Use RandomPool or RandomGroup", "2.3")
case class RandomRouter(nrOfInstances: Int = 0, routees: immutable.Iterable[String] = Nil, override val resizer: Option[Resizer] = None, final case class RandomRouter(nrOfInstances: Int = 0, routees: immutable.Iterable[String] = Nil, override val resizer: Option[Resizer] = None,
val routerDispatcher: String = Dispatchers.DefaultDispatcherId, val routerDispatcher: String = Dispatchers.DefaultDispatcherId,
val supervisorStrategy: SupervisorStrategy = Pool.defaultSupervisorStrategy) val supervisorStrategy: SupervisorStrategy = Pool.defaultSupervisorStrategy)
extends DeprecatedRouterConfig with PoolOverrideUnsetConfig[RandomRouter] { extends DeprecatedRouterConfig with PoolOverrideUnsetConfig[RandomRouter] {
@ -297,7 +297,7 @@ object SmallestMailboxRouter {
*/ */
@SerialVersionUID(1L) @SerialVersionUID(1L)
@deprecated("Use SmallestMailboxPool", "2.3") @deprecated("Use SmallestMailboxPool", "2.3")
case class SmallestMailboxRouter(nrOfInstances: Int = 0, routees: immutable.Iterable[String] = Nil, override val resizer: Option[Resizer] = None, final case class SmallestMailboxRouter(nrOfInstances: Int = 0, routees: immutable.Iterable[String] = Nil, override val resizer: Option[Resizer] = None,
val routerDispatcher: String = Dispatchers.DefaultDispatcherId, val routerDispatcher: String = Dispatchers.DefaultDispatcherId,
val supervisorStrategy: SupervisorStrategy = Pool.defaultSupervisorStrategy) val supervisorStrategy: SupervisorStrategy = Pool.defaultSupervisorStrategy)
extends DeprecatedRouterConfig with PoolOverrideUnsetConfig[SmallestMailboxRouter] { extends DeprecatedRouterConfig with PoolOverrideUnsetConfig[SmallestMailboxRouter] {
@ -391,7 +391,7 @@ object BroadcastRouter {
*/ */
@SerialVersionUID(1L) @SerialVersionUID(1L)
@deprecated("Use BroadcastPool or BroadcastGroup", "2.3") @deprecated("Use BroadcastPool or BroadcastGroup", "2.3")
case class BroadcastRouter(nrOfInstances: Int = 0, routees: immutable.Iterable[String] = Nil, override val resizer: Option[Resizer] = None, final case class BroadcastRouter(nrOfInstances: Int = 0, routees: immutable.Iterable[String] = Nil, override val resizer: Option[Resizer] = None,
val routerDispatcher: String = Dispatchers.DefaultDispatcherId, val routerDispatcher: String = Dispatchers.DefaultDispatcherId,
val supervisorStrategy: SupervisorStrategy = Pool.defaultSupervisorStrategy) val supervisorStrategy: SupervisorStrategy = Pool.defaultSupervisorStrategy)
extends DeprecatedRouterConfig with PoolOverrideUnsetConfig[BroadcastRouter] { extends DeprecatedRouterConfig with PoolOverrideUnsetConfig[BroadcastRouter] {
@ -488,7 +488,7 @@ object ScatterGatherFirstCompletedRouter {
*/ */
@SerialVersionUID(1L) @SerialVersionUID(1L)
@deprecated("Use ScatterGatherFirstCompletedPool or ScatterGatherFirstCompletedGroup", "2.3") @deprecated("Use ScatterGatherFirstCompletedPool or ScatterGatherFirstCompletedGroup", "2.3")
case class ScatterGatherFirstCompletedRouter(nrOfInstances: Int = 0, routees: immutable.Iterable[String] = Nil, within: FiniteDuration, final case class ScatterGatherFirstCompletedRouter(nrOfInstances: Int = 0, routees: immutable.Iterable[String] = Nil, within: FiniteDuration,
override val resizer: Option[Resizer] = None, override val resizer: Option[Resizer] = None,
val routerDispatcher: String = Dispatchers.DefaultDispatcherId, val routerDispatcher: String = Dispatchers.DefaultDispatcherId,
val supervisorStrategy: SupervisorStrategy = Pool.defaultSupervisorStrategy) val supervisorStrategy: SupervisorStrategy = Pool.defaultSupervisorStrategy)

View file

@ -8,9 +8,9 @@ import akka.actor.{ Actor, ActorRef }
import java.util.{ Set, TreeSet } import java.util.{ Set, TreeSet }
sealed trait ListenerMessage sealed trait ListenerMessage
case class Listen(listener: ActorRef) extends ListenerMessage final case class Listen(listener: ActorRef) extends ListenerMessage
case class Deafen(listener: ActorRef) extends ListenerMessage final case class Deafen(listener: ActorRef) extends ListenerMessage
case class WithListeners(f: (ActorRef) Unit) extends ListenerMessage final case class WithListeners(f: (ActorRef) Unit) extends ListenerMessage
/** /**
* Listeners is a generic trait to implement listening capability on an Actor. * Listeners is a generic trait to implement listening capability on an Actor.

View file

@ -24,6 +24,7 @@ import akka.actor.Props
import akka.actor.SupervisorStrategy import akka.actor.SupervisorStrategy
import akka.dispatch.Envelope import akka.dispatch.Envelope
import akka.dispatch.MessageDispatcher import akka.dispatch.MessageDispatcher
import java.lang.{ Double JDouble }
/** /**
* [[Pool]] routers with dynamically resizable number of routees are implemented by providing a Resizer * [[Pool]] routers with dynamically resizable number of routees are implemented by providing a Resizer
@ -86,12 +87,12 @@ case class DefaultResizer(
/** /**
* The fewest number of routees the router should ever have. * The fewest number of routees the router should ever have.
*/ */
lowerBound: Int = 1, val lowerBound: Int = 1,
/** /**
* The most number of routees the router should ever have. * The most number of routees the router should ever have.
* Must be greater than or equal to `lowerBound`. * Must be greater than or equal to `lowerBound`.
*/ */
upperBound: Int = 10, val upperBound: Int = 10,
/** /**
* Threshold to evaluate if routee is considered to be busy (under pressure). * Threshold to evaluate if routee is considered to be busy (under pressure).
* Implementation depends on this value (default is 1). * Implementation depends on this value (default is 1).
@ -104,13 +105,13 @@ case class DefaultResizer(
* default UnboundedMailbox is O(N) operation.</li> * default UnboundedMailbox is O(N) operation.</li>
* </ul> * </ul>
*/ */
pressureThreshold: Int = 1, val pressureThreshold: Int = 1,
/** /**
* Percentage to increase capacity whenever all routees are busy. * Percentage to increase capacity whenever all routees are busy.
* For example, 0.2 would increase 20% (rounded up), i.e. if current * For example, 0.2 would increase 20% (rounded up), i.e. if current
* capacity is 6 it will request an increase of 2 more routees. * capacity is 6 it will request an increase of 2 more routees.
*/ */
rampupRate: Double = 0.2, val rampupRate: Double = 0.2,
/** /**
* Minimum fraction of busy routees before backing off. * Minimum fraction of busy routees before backing off.
* For example, if this is 0.3, then we'll remove some routees only when * For example, if this is 0.3, then we'll remove some routees only when
@ -120,19 +121,19 @@ case class DefaultResizer(
* *
* Use 0.0 or negative to avoid removal of routees. * Use 0.0 or negative to avoid removal of routees.
*/ */
backoffThreshold: Double = 0.3, val backoffThreshold: Double = 0.3,
/** /**
* Fraction of routees to be removed when the resizer reaches the * Fraction of routees to be removed when the resizer reaches the
* backoffThreshold. * backoffThreshold.
* For example, 0.1 would decrease 10% (rounded up), i.e. if current * For example, 0.1 would decrease 10% (rounded up), i.e. if current
* capacity is 9 it will request an decrease of 1 routee. * capacity is 9 it will request an decrease of 1 routee.
*/ */
backoffRate: Double = 0.1, val backoffRate: Double = 0.1,
/** /**
* Number of messages between resize operation. * Number of messages between resize operation.
* Use 1 to resize before each message. * Use 1 to resize before each message.
*/ */
messagesPerResize: Int = 10) extends Resizer { val messagesPerResize: Int = 10) extends Resizer {
/** /**
* Java API constructor for default values except bounds. * Java API constructor for default values except bounds.
@ -240,7 +241,6 @@ case class DefaultResizer(
if (backoffThreshold > 0.0 && backoffRate > 0.0 && capacity > 0 && pressure.toDouble / capacity < backoffThreshold) if (backoffThreshold > 0.0 && backoffRate > 0.0 && capacity > 0 && pressure.toDouble / capacity < backoffThreshold)
math.floor(-1.0 * backoffRate * capacity).toInt math.floor(-1.0 * backoffRate * capacity).toInt
else 0 else 0
} }
/** /**

View file

@ -40,7 +40,7 @@ trait Routee {
/** /**
* [[Routee]] that sends the messages to an [[akka.actor.ActorRef]]. * [[Routee]] that sends the messages to an [[akka.actor.ActorRef]].
*/ */
case class ActorRefRoutee(ref: ActorRef) extends Routee { final case class ActorRefRoutee(ref: ActorRef) extends Routee {
override def send(message: Any, sender: ActorRef): Unit = override def send(message: Any, sender: ActorRef): Unit =
ref.tell(message, sender) ref.tell(message, sender)
} }
@ -48,7 +48,7 @@ case class ActorRefRoutee(ref: ActorRef) extends Routee {
/** /**
* [[Routee]] that sends the messages to an [[akka.actor.ActorSelection]]. * [[Routee]] that sends the messages to an [[akka.actor.ActorSelection]].
*/ */
case class ActorSelectionRoutee(selection: ActorSelection) extends Routee { final case class ActorSelectionRoutee(selection: ActorSelection) extends Routee {
override def send(message: Any, sender: ActorRef): Unit = override def send(message: Any, sender: ActorRef): Unit =
selection.tell(message, sender) selection.tell(message, sender)
} }
@ -65,7 +65,7 @@ object NoRoutee extends Routee {
/** /**
* [[Routee]] that sends each message to all `routees`. * [[Routee]] that sends each message to all `routees`.
*/ */
case class SeveralRoutees(routees: immutable.IndexedSeq[Routee]) extends Routee { final case class SeveralRoutees(routees: immutable.IndexedSeq[Routee]) extends Routee {
/** /**
* Java API * Java API
@ -175,7 +175,7 @@ final case class Router(val logic: RoutingLogic, val routees: immutable.IndexedS
* envelope will be stripped off. * envelope will be stripped off.
*/ */
@SerialVersionUID(1L) @SerialVersionUID(1L)
case class Broadcast(message: Any) extends RouterEnvelope final case class Broadcast(message: Any) extends RouterEnvelope
/** /**
* Only the contained message will be forwarded to the * Only the contained message will be forwarded to the

View file

@ -376,7 +376,7 @@ case object NoRouter extends NoRouter {
* Message used to carry information about what routees the router is currently using. * Message used to carry information about what routees the router is currently using.
*/ */
@SerialVersionUID(1L) @SerialVersionUID(1L)
case class Routees(routees: immutable.IndexedSeq[Routee]) { final case class Routees(routees: immutable.IndexedSeq[Routee]) {
/** /**
* Java API * Java API
*/ */
@ -391,7 +391,7 @@ case class Routees(routees: immutable.IndexedSeq[Routee]) {
* It may be handled after other messages. * It may be handled after other messages.
*/ */
@SerialVersionUID(1L) @SerialVersionUID(1L)
case class AddRoutee(routee: Routee) extends RouterManagementMesssage final case class AddRoutee(routee: Routee) extends RouterManagementMesssage
/** /**
* Remove a specific routee by sending this message to the router. * Remove a specific routee by sending this message to the router.
@ -403,7 +403,7 @@ case class AddRoutee(routee: Routee) extends RouterManagementMesssage
* *
*/ */
@SerialVersionUID(1L) @SerialVersionUID(1L)
case class RemoveRoutee(routee: Routee) extends RouterManagementMesssage final case class RemoveRoutee(routee: Routee) extends RouterManagementMesssage
/** /**
* Increase or decrease the number of routees in a [[Pool]]. * Increase or decrease the number of routees in a [[Pool]].
@ -417,4 +417,4 @@ case class RemoveRoutee(routee: Routee) extends RouterManagementMesssage
* lost. * lost.
*/ */
@SerialVersionUID(1L) @SerialVersionUID(1L)
case class AdjustPoolSize(change: Int) extends RouterManagementMesssage final case class AdjustPoolSize(change: Int) extends RouterManagementMesssage

View file

@ -39,7 +39,7 @@ final case class ScatterGatherFirstCompletedRoutingLogic(within: FiniteDuration)
* INTERNAL API * INTERNAL API
*/ */
@SerialVersionUID(1L) @SerialVersionUID(1L)
private[akka] case class ScatterGatherFirstCompletedRoutees( private[akka] final case class ScatterGatherFirstCompletedRoutees(
routees: immutable.IndexedSeq[Routee], within: FiniteDuration) extends Routee { routees: immutable.IndexedSeq[Routee], within: FiniteDuration) extends Routee {
override def send(message: Any, sender: ActorRef): Unit = { override def send(message: Any, sender: ActorRef): Unit = {

View file

@ -42,7 +42,7 @@ object Serialization {
* Serialization information needed for serializing local actor refs. * Serialization information needed for serializing local actor refs.
* INTERNAL API * INTERNAL API
*/ */
private[akka] case class Information(address: Address, system: ActorSystem) private[akka] final case class Information(address: Address, system: ActorSystem)
/** /**
* The serialized path of an actorRef, based on the current transport serialization information. * The serialized path of an actorRef, based on the current transport serialization information.

View file

@ -11,7 +11,7 @@ private[akka] object WildcardTree {
private val empty = new WildcardTree[Nothing]() private val empty = new WildcardTree[Nothing]()
def apply[T](): WildcardTree[T] = empty.asInstanceOf[WildcardTree[T]] def apply[T](): WildcardTree[T] = empty.asInstanceOf[WildcardTree[T]]
} }
private[akka] case class WildcardTree[T](data: Option[T] = None, children: Map[String, WildcardTree[T]] = HashMap[String, WildcardTree[T]]()) { private[akka] final case class WildcardTree[T](data: Option[T] = None, children: Map[String, WildcardTree[T]] = HashMap[String, WildcardTree[T]]()) {
def insert(elems: Iterator[String], d: T): WildcardTree[T] = def insert(elems: Iterator[String], d: T): WildcardTree[T] =
if (!elems.hasNext) { if (!elems.hasNext) {

View file

@ -158,12 +158,12 @@ trait Producer extends ProducerSupport { this: Actor ⇒
/** /**
* INTERNAL API * INTERNAL API
*/ */
private case class MessageResult(message: CamelMessage) extends NoSerializationVerificationNeeded private final case class MessageResult(message: CamelMessage) extends NoSerializationVerificationNeeded
/** /**
* INTERNAL API * INTERNAL API
*/ */
private case class FailureResult(cause: Throwable, headers: Map[String, Any] = Map.empty) extends NoSerializationVerificationNeeded private final case class FailureResult(cause: Throwable, headers: Map[String, Any] = Map.empty) extends NoSerializationVerificationNeeded
/** /**
* A one-way producer. * A one-way producer.

View file

@ -113,11 +113,11 @@ private[camel] class ActivationTracker extends Actor with ActorLogging {
* A request message to the ActivationTracker for the status of activation. * A request message to the ActivationTracker for the status of activation.
* @param ref the actorRef * @param ref the actorRef
*/ */
private[camel] case class AwaitActivation(ref: ActorRef) extends ActivationMessage(ref) private[camel] final case class AwaitActivation(ref: ActorRef) extends ActivationMessage(ref)
/** /**
* INTERNAL API * INTERNAL API
* A request message to the ActivationTracker for the status of de-activation. * A request message to the ActivationTracker for the status of de-activation.
* @param ref the actorRef * @param ref the actorRef
*/ */
private[camel] case class AwaitDeActivation(ref: ActorRef) extends ActivationMessage(ref) private[camel] final case class AwaitDeActivation(ref: ActorRef) extends ActivationMessage(ref)

View file

@ -49,27 +49,27 @@ private[camel] object CamelSupervisor {
* INTERNAL API * INTERNAL API
* Registers a consumer or a producer. * Registers a consumer or a producer.
*/ */
case class Register(actorRef: ActorRef, endpointUri: String, config: Option[ConsumerConfig] = None) extends NoSerializationVerificationNeeded final case class Register(actorRef: ActorRef, endpointUri: String, config: Option[ConsumerConfig] = None) extends NoSerializationVerificationNeeded
/** /**
* INTERNAL API * INTERNAL API
* De-registers a producer or a consumer. * De-registers a producer or a consumer.
*/ */
@SerialVersionUID(1L) @SerialVersionUID(1L)
case class DeRegister(actorRef: ActorRef) extends CamelSupervisorMessage final case class DeRegister(actorRef: ActorRef) extends CamelSupervisorMessage
/** /**
* INTERNAL API * INTERNAL API
* Adds a watch for the actor * Adds a watch for the actor
*/ */
@SerialVersionUID(1L) @SerialVersionUID(1L)
case class AddWatch(actorRef: ActorRef) extends CamelSupervisorMessage final case class AddWatch(actorRef: ActorRef) extends CamelSupervisorMessage
/** /**
* INTERNAL API * INTERNAL API
* Provides a Producer with the required camel objects to function. * Provides a Producer with the required camel objects to function.
*/ */
case class CamelProducerObjects(endpoint: Endpoint, processor: SendProcessor) extends NoSerializationVerificationNeeded final case class CamelProducerObjects(endpoint: Endpoint, processor: SendProcessor) extends NoSerializationVerificationNeeded
} }
/** /**

View file

@ -103,11 +103,11 @@ class ConsumerBroadcast(promise: Promise[(Future[List[List[ActorRef]]], Future[L
} }
} }
case class CreateRegistrars(number: Int) final case class CreateRegistrars(number: Int)
case class RegisterConsumersAndProducers(endpointUri: String) final case class RegisterConsumersAndProducers(endpointUri: String)
case class DeRegisterConsumersAndProducers() final case class DeRegisterConsumersAndProducers()
case class Activations() final case class Activations()
case class DeActivations() final case class DeActivations()
class Registrar(val start: Int, val number: Int, activationsPromise: Promise[List[ActorRef]], class Registrar(val start: Int, val number: Int, activationsPromise: Promise[List[ActorRef]],
deActivationsPromise: Promise[List[ActorRef]]) extends Actor with ActorLogging { deActivationsPromise: Promise[List[ActorRef]]) extends Actor with ActorLogging {

View file

@ -20,7 +20,7 @@ private[cluster] object AutoDown {
def props(autoDownUnreachableAfter: FiniteDuration): Props = def props(autoDownUnreachableAfter: FiniteDuration): Props =
Props(classOf[AutoDown], autoDownUnreachableAfter) Props(classOf[AutoDown], autoDownUnreachableAfter)
case class UnreachableTimeout(node: UniqueAddress) final case class UnreachableTimeout(node: UniqueAddress)
} }
/** /**

View file

@ -35,19 +35,19 @@ private[cluster] object ClusterUserAction {
* Join will be sent to the other node. * Join will be sent to the other node.
*/ */
@SerialVersionUID(1L) @SerialVersionUID(1L)
case class JoinTo(address: Address) final case class JoinTo(address: Address)
/** /**
* Command to leave the cluster. * Command to leave the cluster.
*/ */
@SerialVersionUID(1L) @SerialVersionUID(1L)
case class Leave(address: Address) extends ClusterMessage final case class Leave(address: Address) extends ClusterMessage
/** /**
* Command to mark node as temporary down. * Command to mark node as temporary down.
*/ */
@SerialVersionUID(1L) @SerialVersionUID(1L)
case class Down(address: Address) extends ClusterMessage final case class Down(address: Address) extends ClusterMessage
} }
@ -61,20 +61,20 @@ private[cluster] object InternalClusterAction {
* @param node the node that wants to join the cluster * @param node the node that wants to join the cluster
*/ */
@SerialVersionUID(1L) @SerialVersionUID(1L)
case class Join(node: UniqueAddress, roles: Set[String]) extends ClusterMessage final case class Join(node: UniqueAddress, roles: Set[String]) extends ClusterMessage
/** /**
* Reply to Join * Reply to Join
* @param from the sender node in the cluster, i.e. the node that received the Join command * @param from the sender node in the cluster, i.e. the node that received the Join command
*/ */
@SerialVersionUID(1L) @SerialVersionUID(1L)
case class Welcome(from: UniqueAddress, gossip: Gossip) extends ClusterMessage final case class Welcome(from: UniqueAddress, gossip: Gossip) extends ClusterMessage
/** /**
* Command to initiate the process to join the specified * Command to initiate the process to join the specified
* seed nodes. * seed nodes.
*/ */
case class JoinSeedNodes(seedNodes: immutable.IndexedSeq[Address]) final case class JoinSeedNodes(seedNodes: immutable.IndexedSeq[Address])
/** /**
* Start message of the process to join one of the seed nodes. * Start message of the process to join one of the seed nodes.
@ -96,13 +96,13 @@ private[cluster] object InternalClusterAction {
* @see JoinSeedNode * @see JoinSeedNode
*/ */
@SerialVersionUID(1L) @SerialVersionUID(1L)
case class InitJoinAck(address: Address) extends ClusterMessage final case class InitJoinAck(address: Address) extends ClusterMessage
/** /**
* @see JoinSeedNode * @see JoinSeedNode
*/ */
@SerialVersionUID(1L) @SerialVersionUID(1L)
case class InitJoinNack(address: Address) extends ClusterMessage final case class InitJoinNack(address: Address) extends ClusterMessage
/** /**
* Marker interface for periodic tick messages * Marker interface for periodic tick messages
@ -121,30 +121,30 @@ private[cluster] object InternalClusterAction {
case object PublishStatsTick extends Tick case object PublishStatsTick extends Tick
case class SendGossipTo(address: Address) final case class SendGossipTo(address: Address)
case object GetClusterCoreRef case object GetClusterCoreRef
case class PublisherCreated(publisher: ActorRef) final case class PublisherCreated(publisher: ActorRef)
/** /**
* Comand to [[akka.cluster.ClusterDaemon]] to create a * Comand to [[akka.cluster.ClusterDaemon]] to create a
* [[akka.cluster.OnMemberUpListener]]. * [[akka.cluster.OnMemberUpListener]].
*/ */
case class AddOnMemberUpListener(callback: Runnable) extends NoSerializationVerificationNeeded final case class AddOnMemberUpListener(callback: Runnable) extends NoSerializationVerificationNeeded
sealed trait SubscriptionMessage sealed trait SubscriptionMessage
case class Subscribe(subscriber: ActorRef, initialStateMode: SubscriptionInitialStateMode, to: Set[Class[_]]) extends SubscriptionMessage final case class Subscribe(subscriber: ActorRef, initialStateMode: SubscriptionInitialStateMode, to: Set[Class[_]]) extends SubscriptionMessage
case class Unsubscribe(subscriber: ActorRef, to: Option[Class[_]]) extends SubscriptionMessage final case class Unsubscribe(subscriber: ActorRef, to: Option[Class[_]]) extends SubscriptionMessage
/** /**
* @param receiver if `receiver` is defined the event will only be sent to that * @param receiver if `receiver` is defined the event will only be sent to that
* actor, otherwise it will be sent to all subscribers via the `eventStream`. * actor, otherwise it will be sent to all subscribers via the `eventStream`.
*/ */
case class PublishCurrentClusterState(receiver: Option[ActorRef]) extends SubscriptionMessage final case class PublishCurrentClusterState(receiver: Option[ActorRef]) extends SubscriptionMessage
sealed trait PublishMessage sealed trait PublishMessage
case class PublishChanges(newGossip: Gossip) extends PublishMessage final case class PublishChanges(newGossip: Gossip) extends PublishMessage
case class PublishEvent(event: ClusterDomainEvent) extends PublishMessage final case class PublishEvent(event: ClusterDomainEvent) extends PublishMessage
} }
/** /**
@ -1134,7 +1134,7 @@ private[cluster] class OnMemberUpListener(callback: Runnable) extends Actor with
* INTERNAL API * INTERNAL API
*/ */
@SerialVersionUID(1L) @SerialVersionUID(1L)
private[cluster] case class GossipStats( private[cluster] final case class GossipStats(
receivedGossipCount: Long = 0L, receivedGossipCount: Long = 0L,
mergeCount: Long = 0L, mergeCount: Long = 0L,
sameCount: Long = 0L, sameCount: Long = 0L,
@ -1177,7 +1177,7 @@ private[cluster] case class GossipStats(
* INTERNAL API * INTERNAL API
*/ */
@SerialVersionUID(1L) @SerialVersionUID(1L)
private[cluster] case class VectorClockStats( private[cluster] final case class VectorClockStats(
versionSize: Int = 0, versionSize: Int = 0,
seenLatest: Int = 0) seenLatest: Int = 0)

View file

@ -53,7 +53,7 @@ object ClusterEvent {
/** /**
* Current snapshot state of the cluster. Sent to new subscriber. * Current snapshot state of the cluster. Sent to new subscriber.
*/ */
case class CurrentClusterState( final case class CurrentClusterState(
members: immutable.SortedSet[Member] = immutable.SortedSet.empty, members: immutable.SortedSet[Member] = immutable.SortedSet.empty,
unreachable: Set[Member] = Set.empty, unreachable: Set[Member] = Set.empty,
seenBy: Set[Address] = Set.empty, seenBy: Set[Address] = Set.empty,
@ -122,7 +122,7 @@ object ClusterEvent {
/** /**
* Member status changed to Up. * Member status changed to Up.
*/ */
case class MemberUp(member: Member) extends MemberEvent { final case class MemberUp(member: Member) extends MemberEvent {
if (member.status != Up) throw new IllegalArgumentException("Expected Up status, got: " + member) if (member.status != Up) throw new IllegalArgumentException("Expected Up status, got: " + member)
} }
@ -130,7 +130,7 @@ object ClusterEvent {
* Member status changed to [[MemberStatus.Exiting]] and will be removed * Member status changed to [[MemberStatus.Exiting]] and will be removed
* when all members have seen the `Exiting` status. * when all members have seen the `Exiting` status.
*/ */
case class MemberExited(member: Member) extends MemberEvent { final case class MemberExited(member: Member) extends MemberEvent {
if (member.status != Exiting) throw new IllegalArgumentException("Expected Exiting status, got: " + member) if (member.status != Exiting) throw new IllegalArgumentException("Expected Exiting status, got: " + member)
} }
@ -141,7 +141,7 @@ object ClusterEvent {
* When `previousStatus` is `MemberStatus.Exiting` the node was removed * When `previousStatus` is `MemberStatus.Exiting` the node was removed
* after graceful leaving and exiting. * after graceful leaving and exiting.
*/ */
case class MemberRemoved(member: Member, previousStatus: MemberStatus) extends MemberEvent { final case class MemberRemoved(member: Member, previousStatus: MemberStatus) extends MemberEvent {
if (member.status != Removed) throw new IllegalArgumentException("Expected Removed status, got: " + member) if (member.status != Removed) throw new IllegalArgumentException("Expected Removed status, got: " + member)
} }
@ -149,7 +149,7 @@ object ClusterEvent {
* Leader of the cluster members changed. Published when the state change * Leader of the cluster members changed. Published when the state change
* is first seen on a node. * is first seen on a node.
*/ */
case class LeaderChanged(leader: Option[Address]) extends ClusterDomainEvent { final case class LeaderChanged(leader: Option[Address]) extends ClusterDomainEvent {
/** /**
* Java API * Java API
* @return address of current leader, or null if none * @return address of current leader, or null if none
@ -161,7 +161,7 @@ object ClusterEvent {
* First member (leader) of the members within a role set changed. * First member (leader) of the members within a role set changed.
* Published when the state change is first seen on a node. * Published when the state change is first seen on a node.
*/ */
case class RoleLeaderChanged(role: String, leader: Option[Address]) extends ClusterDomainEvent { final case class RoleLeaderChanged(role: String, leader: Option[Address]) extends ClusterDomainEvent {
/** /**
* Java API * Java API
* @return address of current leader, or null if none * @return address of current leader, or null if none
@ -178,19 +178,19 @@ object ClusterEvent {
/** /**
* A member is considered as unreachable by the failure detector. * A member is considered as unreachable by the failure detector.
*/ */
case class UnreachableMember(member: Member) extends ReachabilityEvent final case class UnreachableMember(member: Member) extends ReachabilityEvent
/** /**
* A member is considered as reachable by the failure detector * A member is considered as reachable by the failure detector
* after having been unreachable. * after having been unreachable.
* @see [[UnreachableMember]] * @see [[UnreachableMember]]
*/ */
case class ReachableMember(member: Member) extends ReachabilityEvent final case class ReachableMember(member: Member) extends ReachabilityEvent
/** /**
* Current snapshot of cluster node metrics. Published to subscribers. * Current snapshot of cluster node metrics. Published to subscribers.
*/ */
case class ClusterMetricsChanged(nodeMetrics: Set[NodeMetrics]) extends ClusterDomainEvent { final case class ClusterMetricsChanged(nodeMetrics: Set[NodeMetrics]) extends ClusterDomainEvent {
/** /**
* Java API * Java API
*/ */
@ -202,17 +202,17 @@ object ClusterEvent {
* INTERNAL API * INTERNAL API
* The nodes that have seen current version of the Gossip. * The nodes that have seen current version of the Gossip.
*/ */
private[cluster] case class SeenChanged(convergence: Boolean, seenBy: Set[Address]) extends ClusterDomainEvent private[cluster] final case class SeenChanged(convergence: Boolean, seenBy: Set[Address]) extends ClusterDomainEvent
/** /**
* INTERNAL API * INTERNAL API
*/ */
private[cluster] case class ReachabilityChanged(reachability: Reachability) extends ClusterDomainEvent private[cluster] final case class ReachabilityChanged(reachability: Reachability) extends ClusterDomainEvent
/** /**
* INTERNAL API * INTERNAL API
*/ */
private[cluster] case class CurrentInternalStats( private[cluster] final case class CurrentInternalStats(
gossipStats: GossipStats, gossipStats: GossipStats,
vclockStats: VectorClockStats) extends ClusterDomainEvent vclockStats: VectorClockStats) extends ClusterDomainEvent

View file

@ -34,16 +34,16 @@ private[cluster] object ClusterHeartbeatSender {
/** /**
* Sent at regular intervals for failure detection. * Sent at regular intervals for failure detection.
*/ */
case class Heartbeat(from: Address) extends ClusterMessage final case class Heartbeat(from: Address) extends ClusterMessage
/** /**
* Sent as reply to [[Heartbeat]] messages. * Sent as reply to [[Heartbeat]] messages.
*/ */
case class HeartbeatRsp(from: UniqueAddress) extends ClusterMessage final case class HeartbeatRsp(from: UniqueAddress) extends ClusterMessage
// sent to self only // sent to self only
case object HeartbeatTick case object HeartbeatTick
case class ExpectedFirstHeartbeat(from: UniqueAddress) final case class ExpectedFirstHeartbeat(from: UniqueAddress)
} }
@ -164,7 +164,7 @@ private[cluster] final class ClusterHeartbeatSender extends Actor with ActorLogg
* State of [[ClusterHeartbeatSender]]. Encapsulated to facilitate unit testing. * State of [[ClusterHeartbeatSender]]. Encapsulated to facilitate unit testing.
* It is immutable, but it updates the failureDetector. * It is immutable, but it updates the failureDetector.
*/ */
private[cluster] case class ClusterHeartbeatSenderState( private[cluster] final case class ClusterHeartbeatSenderState(
ring: HeartbeatNodeRing, ring: HeartbeatNodeRing,
unreachable: Set[UniqueAddress], unreachable: Set[UniqueAddress],
failureDetector: FailureDetectorRegistry[Address]) { failureDetector: FailureDetectorRegistry[Address]) {
@ -224,7 +224,7 @@ private[cluster] case class ClusterHeartbeatSenderState(
* *
* It is immutable, i.e. the methods return new instances. * It is immutable, i.e. the methods return new instances.
*/ */
private[cluster] case class HeartbeatNodeRing(selfAddress: UniqueAddress, nodes: Set[UniqueAddress], monitoredByNrOfMembers: Int) { private[cluster] final case class HeartbeatNodeRing(selfAddress: UniqueAddress, nodes: Set[UniqueAddress], monitoredByNrOfMembers: Int) {
require(nodes contains selfAddress, s"nodes [${nodes.mkString(", ")}] must contain selfAddress [${selfAddress}]") require(nodes contains selfAddress, s"nodes [${nodes.mkString(", ")}] must contain selfAddress [${selfAddress}]")

View file

@ -184,7 +184,7 @@ private[cluster] object MetricsGossip {
* @param nodes metrics per node * @param nodes metrics per node
*/ */
@SerialVersionUID(1L) @SerialVersionUID(1L)
private[cluster] case class MetricsGossip(nodes: Set[NodeMetrics]) { private[cluster] final case class MetricsGossip(nodes: Set[NodeMetrics]) {
/** /**
* Removes nodes if their correlating node ring members are not [[akka.cluster.MemberStatus.Up]] * Removes nodes if their correlating node ring members are not [[akka.cluster.MemberStatus.Up]]
@ -224,7 +224,7 @@ private[cluster] case class MetricsGossip(nodes: Set[NodeMetrics]) {
* Envelope adding a sender address to the gossip. * Envelope adding a sender address to the gossip.
*/ */
@SerialVersionUID(1L) @SerialVersionUID(1L)
private[cluster] case class MetricsGossipEnvelope(from: Address, gossip: MetricsGossip, reply: Boolean) private[cluster] final case class MetricsGossipEnvelope(from: Address, gossip: MetricsGossip, reply: Boolean)
extends ClusterMessage extends ClusterMessage
private[cluster] object EWMA { private[cluster] object EWMA {
@ -272,7 +272,7 @@ private[cluster] object EWMA {
* *
*/ */
@SerialVersionUID(1L) @SerialVersionUID(1L)
private[cluster] case class EWMA(value: Double, alpha: Double) { private[cluster] final case class EWMA(value: Double, alpha: Double) {
require(0.0 <= alpha && alpha <= 1.0, "alpha must be between 0.0 and 1.0") require(0.0 <= alpha && alpha <= 1.0, "alpha must be between 0.0 and 1.0")
@ -302,7 +302,7 @@ private[cluster] case class EWMA(value: Double, alpha: Double) {
* averages (e.g. system load average) or finite (e.g. as number of processors), are not trended. * averages (e.g. system load average) or finite (e.g. as number of processors), are not trended.
*/ */
@SerialVersionUID(1L) @SerialVersionUID(1L)
case class Metric private[cluster] (name: String, value: Number, private[cluster] val average: Option[EWMA]) final case class Metric private[cluster] (name: String, value: Number, private[cluster] val average: Option[EWMA])
extends MetricNumericConverter { extends MetricNumericConverter {
require(defined(value), s"Invalid Metric [$name] value [$value]") require(defined(value), s"Invalid Metric [$name] value [$value]")
@ -385,7 +385,7 @@ object Metric extends MetricNumericConverter {
* @param metrics the set of sampled [[akka.actor.Metric]] * @param metrics the set of sampled [[akka.actor.Metric]]
*/ */
@SerialVersionUID(1L) @SerialVersionUID(1L)
case class NodeMetrics(address: Address, timestamp: Long, metrics: Set[Metric] = Set.empty[Metric]) { final case class NodeMetrics(address: Address, timestamp: Long, metrics: Set[Metric] = Set.empty[Metric]) {
/** /**
* Returns the most recent data. * Returns the most recent data.
@ -481,7 +481,7 @@ object StandardMetrics {
* Can be undefined on some OS. * Can be undefined on some OS.
*/ */
@SerialVersionUID(1L) @SerialVersionUID(1L)
case class HeapMemory(address: Address, timestamp: Long, used: Long, committed: Long, max: Option[Long]) { final case class HeapMemory(address: Address, timestamp: Long, used: Long, committed: Long, max: Option[Long]) {
require(committed > 0L, "committed heap expected to be > 0 bytes") require(committed > 0L, "committed heap expected to be > 0 bytes")
require(max.isEmpty || max.get > 0L, "max heap expected to be > 0 bytes") require(max.isEmpty || max.get > 0L, "max heap expected to be > 0 bytes")
} }
@ -525,7 +525,7 @@ object StandardMetrics {
* @param processors the number of available processors * @param processors the number of available processors
*/ */
@SerialVersionUID(1L) @SerialVersionUID(1L)
case class Cpu( final case class Cpu(
address: Address, address: Address,
timestamp: Long, timestamp: Long,
systemLoadAverage: Option[Double], systemLoadAverage: Option[Double],

View file

@ -60,7 +60,7 @@ private[cluster] object Gossip {
* removed node telling it to shut itself down. * removed node telling it to shut itself down.
*/ */
@SerialVersionUID(1L) @SerialVersionUID(1L)
private[cluster] case class Gossip( private[cluster] final case class Gossip(
members: immutable.SortedSet[Member], // sorted set of members with their status, sorted by address members: immutable.SortedSet[Member], // sorted set of members with their status, sorted by address
overview: GossipOverview = GossipOverview(), overview: GossipOverview = GossipOverview(),
version: VectorClock = VectorClock()) { // vector clock version version: VectorClock = VectorClock()) { // vector clock version
@ -212,7 +212,7 @@ private[cluster] case class Gossip(
* Represents the overview of the cluster, holds the cluster convergence table and set with unreachable nodes. * Represents the overview of the cluster, holds the cluster convergence table and set with unreachable nodes.
*/ */
@SerialVersionUID(1L) @SerialVersionUID(1L)
private[cluster] case class GossipOverview( private[cluster] final case class GossipOverview(
seen: Set[UniqueAddress] = Set.empty, seen: Set[UniqueAddress] = Set.empty,
reachability: Reachability = Reachability.empty) { reachability: Reachability = Reachability.empty) {
@ -275,4 +275,4 @@ private[cluster] class GossipEnvelope private (
* it replies with its `GossipStatus`. Same versions ends the chat immediately. * it replies with its `GossipStatus`. Same versions ends the chat immediately.
*/ */
@SerialVersionUID(1L) @SerialVersionUID(1L)
private[cluster] case class GossipStatus(from: UniqueAddress, version: VectorClock) extends ClusterMessage private[cluster] final case class GossipStatus(from: UniqueAddress, version: VectorClock) extends ClusterMessage

View file

@ -219,7 +219,7 @@ object MemberStatus {
* INTERNAL API * INTERNAL API
*/ */
@SerialVersionUID(1L) @SerialVersionUID(1L)
private[cluster] case class UniqueAddress(address: Address, uid: Int) extends Ordered[UniqueAddress] { private[cluster] final case class UniqueAddress(address: Address, uid: Int) extends Ordered[UniqueAddress] {
override def hashCode = uid override def hashCode = uid
def compare(that: UniqueAddress): Int = { def compare(that: UniqueAddress): Int = {

View file

@ -23,7 +23,7 @@ private[cluster] object Reachability {
} }
@SerialVersionUID(1L) @SerialVersionUID(1L)
case class Record(observer: UniqueAddress, subject: UniqueAddress, status: ReachabilityStatus, version: Long) final case class Record(observer: UniqueAddress, subject: UniqueAddress, status: ReachabilityStatus, version: Long)
sealed trait ReachabilityStatus sealed trait ReachabilityStatus
@SerialVersionUID(1L) case object Reachable extends ReachabilityStatus @SerialVersionUID(1L) case object Reachable extends ReachabilityStatus

View file

@ -70,7 +70,7 @@ private[cluster] object VectorClock {
* Based on code from the 'vlock' VectorClock library by Coda Hale. * Based on code from the 'vlock' VectorClock library by Coda Hale.
*/ */
@SerialVersionUID(1L) @SerialVersionUID(1L)
case class VectorClock( final case class VectorClock(
versions: TreeMap[VectorClock.Node, Long] = TreeMap.empty[VectorClock.Node, Long]) { versions: TreeMap[VectorClock.Node, Long] = TreeMap.empty[VectorClock.Node, Long]) {
import VectorClock._ import VectorClock._

View file

@ -329,7 +329,7 @@ object MixMetricsSelector extends MixMetricsSelectorBase(
* [akka.cluster.routing.CpuMetricsSelector], and [akka.cluster.routing.SystemLoadAverageMetricsSelector] * [akka.cluster.routing.CpuMetricsSelector], and [akka.cluster.routing.SystemLoadAverageMetricsSelector]
*/ */
@SerialVersionUID(1L) @SerialVersionUID(1L)
case class MixMetricsSelector( final case class MixMetricsSelector(
selectors: immutable.IndexedSeq[CapacityMetricsSelector]) selectors: immutable.IndexedSeq[CapacityMetricsSelector])
extends MixMetricsSelectorBase(selectors) extends MixMetricsSelectorBase(selectors)
@ -548,7 +548,7 @@ private[akka] class AdaptiveLoadBalancingMetricsListener(routingLogic: AdaptiveL
*/ */
@SerialVersionUID(1L) @SerialVersionUID(1L)
@deprecated("Use AdaptiveLoadBalancingPool or AdaptiveLoadBalancingGroup", "2.3") @deprecated("Use AdaptiveLoadBalancingPool or AdaptiveLoadBalancingGroup", "2.3")
case class AdaptiveLoadBalancingRouter( final case class AdaptiveLoadBalancingRouter(
metricsSelector: MetricsSelector = MixMetricsSelector, metricsSelector: MetricsSelector = MixMetricsSelector,
nrOfInstances: Int = 0, routees: immutable.Iterable[String] = Nil, nrOfInstances: Int = 0, routees: immutable.Iterable[String] = Nil,
override val resizer: Option[Resizer] = None, override val resizer: Option[Resizer] = None,

View file

@ -55,7 +55,7 @@ object ClusterRouterGroupSettings {
* `totalInstances` of cluster router must be > 0 * `totalInstances` of cluster router must be > 0
*/ */
@SerialVersionUID(1L) @SerialVersionUID(1L)
case class ClusterRouterGroupSettings( final case class ClusterRouterGroupSettings(
totalInstances: Int, totalInstances: Int,
routeesPaths: immutable.Seq[String], routeesPaths: immutable.Seq[String],
allowLocalRoutees: Boolean, allowLocalRoutees: Boolean,
@ -109,7 +109,7 @@ object ClusterRouterPoolSettings {
* `maxInstancesPerNode` of cluster router must be 1 when routeesPath is defined * `maxInstancesPerNode` of cluster router must be 1 when routeesPath is defined
*/ */
@SerialVersionUID(1L) @SerialVersionUID(1L)
case class ClusterRouterPoolSettings( final case class ClusterRouterPoolSettings(
totalInstances: Int, totalInstances: Int,
maxInstancesPerNode: Int, maxInstancesPerNode: Int,
allowLocalRoutees: Boolean, allowLocalRoutees: Boolean,

View file

@ -81,7 +81,7 @@ object ClusterRouterSettings {
*/ */
@SerialVersionUID(1L) @SerialVersionUID(1L)
@deprecated("Use ClusterRouterPoolSettings or ClusterRouterGroupSettings", "2.3") @deprecated("Use ClusterRouterPoolSettings or ClusterRouterGroupSettings", "2.3")
case class ClusterRouterSettings private[akka] ( final case class ClusterRouterSettings private[akka] (
totalInstances: Int, totalInstances: Int,
maxInstancesPerNode: Int, maxInstancesPerNode: Int,
routeesPath: String, routeesPath: String,

View file

@ -10,7 +10,7 @@ import akka.testkit._
import akka.actor.Address import akka.actor.Address
import scala.collection.immutable import scala.collection.immutable
case class ClientDowningNodeThatIsUnreachableMultiNodeConfig(failureDetectorPuppet: Boolean) extends MultiNodeConfig { final case class ClientDowningNodeThatIsUnreachableMultiNodeConfig(failureDetectorPuppet: Boolean) extends MultiNodeConfig {
val first = role("first") val first = role("first")
val second = role("second") val second = role("second")
val third = role("third") val third = role("third")

View file

@ -11,7 +11,7 @@ import akka.testkit._
import akka.actor.Address import akka.actor.Address
import scala.collection.immutable import scala.collection.immutable
case class ClientDowningNodeThatIsUpMultiNodeConfig(failureDetectorPuppet: Boolean) extends MultiNodeConfig { final case class ClientDowningNodeThatIsUpMultiNodeConfig(failureDetectorPuppet: Boolean) extends MultiNodeConfig {
val first = role("first") val first = role("first")
val second = role("second") val second = role("second")
val third = role("third") val third = role("third")

View file

@ -12,7 +12,7 @@ import akka.testkit._
import scala.concurrent.duration._ import scala.concurrent.duration._
import akka.actor.Address import akka.actor.Address
case class ConvergenceMultiNodeConfig(failureDetectorPuppet: Boolean) extends MultiNodeConfig { final case class ConvergenceMultiNodeConfig(failureDetectorPuppet: Boolean) extends MultiNodeConfig {
val first = role("first") val first = role("first")
val second = role("second") val second = role("second")
val third = role("third") val third = role("third")

View file

@ -13,7 +13,7 @@ import akka.actor._
import scala.concurrent.duration._ import scala.concurrent.duration._
import scala.collection.immutable import scala.collection.immutable
case class LeaderDowningNodeThatIsUnreachableMultiNodeConfig(failureDetectorPuppet: Boolean) extends MultiNodeConfig { final case class LeaderDowningNodeThatIsUnreachableMultiNodeConfig(failureDetectorPuppet: Boolean) extends MultiNodeConfig {
val first = role("first") val first = role("first")
val second = role("second") val second = role("second")
val third = role("third") val third = role("third")

View file

@ -12,7 +12,7 @@ import akka.testkit._
import scala.concurrent.duration._ import scala.concurrent.duration._
import scala.collection.immutable import scala.collection.immutable
case class LeaderElectionMultiNodeConfig(failureDetectorPuppet: Boolean) extends MultiNodeConfig { final case class LeaderElectionMultiNodeConfig(failureDetectorPuppet: Boolean) extends MultiNodeConfig {
val controller = role("controller") val controller = role("controller")
val first = role("first") val first = role("first")
val second = role("second") val second = role("second")

View file

@ -10,7 +10,7 @@ import akka.testkit._
import scala.concurrent.duration._ import scala.concurrent.duration._
import scala.collection.immutable import scala.collection.immutable
case class SingletonClusterMultiNodeConfig(failureDetectorPuppet: Boolean) extends MultiNodeConfig { final case class SingletonClusterMultiNodeConfig(failureDetectorPuppet: Boolean) extends MultiNodeConfig {
val first = role("first") val first = role("first")
val second = role("second") val second = role("second")

View file

@ -15,7 +15,7 @@ import scala.concurrent.duration._
import scala.collection.immutable import scala.collection.immutable
import akka.remote.transport.ThrottlerTransportAdapter.Direction import akka.remote.transport.ThrottlerTransportAdapter.Direction
case class SplitBrainMultiNodeConfig(failureDetectorPuppet: Boolean) extends MultiNodeConfig { final case class SplitBrainMultiNodeConfig(failureDetectorPuppet: Boolean) extends MultiNodeConfig {
val first = role("first") val first = role("first")
val second = role("second") val second = role("second")
val third = role("third") val third = role("third")

View file

@ -227,12 +227,12 @@ private[cluster] object StressMultiJvmSpec extends MultiNodeConfig {
def form: String = d.formatted("%.2f") def form: String = d.formatted("%.2f")
} }
case class ClusterResult( final case class ClusterResult(
address: Address, address: Address,
duration: Duration, duration: Duration,
clusterStats: GossipStats) clusterStats: GossipStats)
case class AggregatedClusterResult(title: String, duration: Duration, clusterStats: GossipStats) final case class AggregatedClusterResult(title: String, duration: Duration, clusterStats: GossipStats)
/** /**
* Central aggregator of cluster statistics and metrics. * Central aggregator of cluster statistics and metrics.
@ -652,29 +652,29 @@ private[cluster] object StressMultiJvmSpec extends MultiNodeConfig {
case object RetryTick case object RetryTick
case object ReportTick case object ReportTick
case object PhiTick case object PhiTick
case class PhiResult(from: Address, phiValues: immutable.SortedSet[PhiValue]) final case class PhiResult(from: Address, phiValues: immutable.SortedSet[PhiValue])
case class PhiValue(address: Address, countAboveOne: Int, count: Int, max: Double) extends Ordered[PhiValue] { final case class PhiValue(address: Address, countAboveOne: Int, count: Int, max: Double) extends Ordered[PhiValue] {
import akka.cluster.Member.addressOrdering import akka.cluster.Member.addressOrdering
def compare(that: PhiValue) = addressOrdering.compare(this.address, that.address) def compare(that: PhiValue) = addressOrdering.compare(this.address, that.address)
} }
case class ReportTo(ref: Option[ActorRef]) final case class ReportTo(ref: Option[ActorRef])
case class StatsResult(from: Address, stats: CurrentInternalStats) final case class StatsResult(from: Address, stats: CurrentInternalStats)
type JobId = Int type JobId = Int
trait Job { def id: JobId } trait Job { def id: JobId }
case class SimpleJob(id: JobId, payload: Any) extends Job final case class SimpleJob(id: JobId, payload: Any) extends Job
case class TreeJob(id: JobId, payload: Any, idx: Int, levels: Int, width: Int) extends Job final case class TreeJob(id: JobId, payload: Any, idx: Int, levels: Int, width: Int) extends Job
case class Ack(id: JobId) final case class Ack(id: JobId)
case class JobState(deadline: Deadline, job: Job) final case class JobState(deadline: Deadline, job: Job)
case class WorkResult(duration: Duration, sendCount: Long, ackCount: Long) { final case class WorkResult(duration: Duration, sendCount: Long, ackCount: Long) {
def retryCount: Long = sendCount - ackCount def retryCount: Long = sendCount - ackCount
def jobsPerSecond: Double = ackCount * 1000.0 / duration.toMillis def jobsPerSecond: Double = ackCount * 1000.0 / duration.toMillis
} }
case object SendBatch case object SendBatch
case class CreateTree(levels: Int, width: Int) final case class CreateTree(levels: Int, width: Int)
case object GetChildrenCount case object GetChildrenCount
case class ChildrenCount(numberOfChildren: Int, numberOfChildRestarts: Int) final case class ChildrenCount(numberOfChildren: Int, numberOfChildRestarts: Int)
case object Reset case object Reset
} }

View file

@ -50,7 +50,7 @@ object AdaptiveLoadBalancingRouterMultiJvmSpec extends MultiNodeConfig {
} }
case object AllocateMemory case object AllocateMemory
case class Reply(address: Address) final case class Reply(address: Address)
val first = role("first") val first = role("first")
val second = role("second") val second = role("second")

View file

@ -34,7 +34,7 @@ object ClusterRoundRobinRoutedActorMultiJvmSpec extends MultiNodeConfig {
} }
} }
case class Reply(routeeType: RouteeType, ref: ActorRef) final case class Reply(routeeType: RouteeType, ref: ActorRef)
sealed trait RouteeType extends Serializable sealed trait RouteeType extends Serializable
object DeployRoutee extends RouteeType object DeployRoutee extends RouteeType

View file

@ -50,7 +50,7 @@ object AdaptiveLoadBalancingRouterMultiJvmSpec extends MultiNodeConfig {
} }
case object AllocateMemory case object AllocateMemory
case class Reply(address: Address) final case class Reply(address: Address)
val first = role("first") val first = role("first")
val second = role("second") val second = role("second")

View file

@ -23,7 +23,7 @@ import akka.testkit._
object ClusterConsistentHashingGroupMultiJvmSpec extends MultiNodeConfig { object ClusterConsistentHashingGroupMultiJvmSpec extends MultiNodeConfig {
case object Get case object Get
case class Collected(messages: Set[Any]) final case class Collected(messages: Set[Any])
class Destination extends Actor { class Destination extends Actor {
var receivedMessages = Set.empty[Any] var receivedMessages = Set.empty[Any]

View file

@ -37,7 +37,7 @@ object ClusterRoundRobinMultiJvmSpec extends MultiNodeConfig {
} }
} }
case class Reply(routeeType: RouteeType, ref: ActorRef) final case class Reply(routeeType: RouteeType, ref: ActorRef)
sealed trait RouteeType extends Serializable sealed trait RouteeType extends Serializable
object PoolRoutee extends RouteeType object PoolRoutee extends RouteeType

View file

@ -16,7 +16,7 @@ import akka.cluster.ClusterEvent._
import akka.testkit.AkkaSpec import akka.testkit.AkkaSpec
object AutoDownSpec { object AutoDownSpec {
case class DownCalled(address: Address) final case class DownCalled(address: Address)
val memberA = TestMember(Address("akka.tcp", "sys", "a", 2552), Up) val memberA = TestMember(Address("akka.tcp", "sys", "a", 2552), Up)
val memberB = TestMember(Address("akka.tcp", "sys", "b", 2552), Up) val memberB = TestMember(Address("akka.tcp", "sys", "b", 2552), Up)

View file

@ -30,7 +30,7 @@ object ClusterSpec {
# akka.loglevel = DEBUG # akka.loglevel = DEBUG
""" """
case class GossipTo(address: Address) final case class GossipTo(address: Address)
} }
@org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner]) @org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner])

View file

@ -63,16 +63,16 @@ object ClusterClient {
} }
@SerialVersionUID(1L) @SerialVersionUID(1L)
case class Send(path: String, msg: Any, localAffinity: Boolean) { final case class Send(path: String, msg: Any, localAffinity: Boolean) {
/** /**
* Convenience constructor with `localAffinity` false * Convenience constructor with `localAffinity` false
*/ */
def this(path: String, msg: Any) = this(path, msg, localAffinity = false) def this(path: String, msg: Any) = this(path, msg, localAffinity = false)
} }
@SerialVersionUID(1L) @SerialVersionUID(1L)
case class SendToAll(path: String, msg: Any) final case class SendToAll(path: String, msg: Any)
@SerialVersionUID(1L) @SerialVersionUID(1L)
case class Publish(topic: String, msg: Any) final case class Publish(topic: String, msg: Any)
/** /**
* INTERNAL API * INTERNAL API
@ -313,7 +313,7 @@ object ClusterReceptionist {
@SerialVersionUID(1L) @SerialVersionUID(1L)
case object GetContacts case object GetContacts
@SerialVersionUID(1L) @SerialVersionUID(1L)
case class Contacts(contactPoints: immutable.IndexedSeq[ActorSelection]) final case class Contacts(contactPoints: immutable.IndexedSeq[ActorSelection])
@SerialVersionUID(1L) @SerialVersionUID(1L)
case object Ping case object Ping

View file

@ -338,10 +338,10 @@ class ClusterSharding(system: ExtendedActorSystem) extends Extension {
*/ */
private[akka] object ClusterShardingGuardian { private[akka] object ClusterShardingGuardian {
import ShardCoordinator.ShardAllocationStrategy import ShardCoordinator.ShardAllocationStrategy
case class Start(typeName: String, entryProps: Option[Props], idExtractor: ShardRegion.IdExtractor, final case class Start(typeName: String, entryProps: Option[Props], idExtractor: ShardRegion.IdExtractor,
shardResolver: ShardRegion.ShardResolver, allocationStrategy: ShardAllocationStrategy) shardResolver: ShardRegion.ShardResolver, allocationStrategy: ShardAllocationStrategy)
extends NoSerializationVerificationNeeded extends NoSerializationVerificationNeeded
case class Started(shardRegion: ActorRef) extends NoSerializationVerificationNeeded final case class Started(shardRegion: ActorRef) extends NoSerializationVerificationNeeded
} }
/** /**
@ -542,7 +542,7 @@ object ShardRegion {
* *
* [[akka.actor.PoisonPill]] is a perfectly fine `stopMessage`. * [[akka.actor.PoisonPill]] is a perfectly fine `stopMessage`.
*/ */
@SerialVersionUID(1L) case class Passivate(stopMessage: Any) extends ShardRegionCommand @SerialVersionUID(1L) final case class Passivate(stopMessage: Any) extends ShardRegionCommand
private case object Retry extends ShardRegionCommand private case object Retry extends ShardRegionCommand
@ -978,24 +978,24 @@ object ShardCoordinator {
/** /**
* `ShardRegion` registers to `ShardCoordinator`, until it receives [[RegisterAck]].  * `ShardRegion` registers to `ShardCoordinator`, until it receives [[RegisterAck]]. 
*/ */
@SerialVersionUID(1L) case class Register(shardRegion: ActorRef) extends CoordinatorCommand @SerialVersionUID(1L) final case class Register(shardRegion: ActorRef) extends CoordinatorCommand
/** /**
* `ShardRegion` in proxy only mode registers to `ShardCoordinator`, until it receives [[RegisterAck]].  * `ShardRegion` in proxy only mode registers to `ShardCoordinator`, until it receives [[RegisterAck]]. 
*/ */
@SerialVersionUID(1L) case class RegisterProxy(shardRegionProxy: ActorRef) extends CoordinatorCommand @SerialVersionUID(1L) final case class RegisterProxy(shardRegionProxy: ActorRef) extends CoordinatorCommand
/** /**
* Acknowledgement from `ShardCoordinator` that [[Register]] or [[RegisterProxy]] was sucessful. * Acknowledgement from `ShardCoordinator` that [[Register]] or [[RegisterProxy]] was sucessful.
*/ */
@SerialVersionUID(1L) case class RegisterAck(coordinator: ActorRef) extends CoordinatorMessage @SerialVersionUID(1L) final case class RegisterAck(coordinator: ActorRef) extends CoordinatorMessage
/** /**
* `ShardRegion` requests the location of a shard by sending this message * `ShardRegion` requests the location of a shard by sending this message
* to the `ShardCoordinator`. * to the `ShardCoordinator`.
*/ */
@SerialVersionUID(1L) case class GetShardHome(shard: ShardId) extends CoordinatorCommand @SerialVersionUID(1L) final case class GetShardHome(shard: ShardId) extends CoordinatorCommand
/** /**
* `ShardCoordinator` replies with this message for [[GetShardHome]] requests. * `ShardCoordinator` replies with this message for [[GetShardHome]] requests.
*/ */
@SerialVersionUID(1L) case class ShardHome(shard: ShardId, ref: ActorRef) extends CoordinatorMessage @SerialVersionUID(1L) final case class ShardHome(shard: ShardId, ref: ActorRef) extends CoordinatorMessage
/** /**
* `ShardCoordinator` initiates rebalancing process by sending this message * `ShardCoordinator` initiates rebalancing process by sending this message
* to all registered `ShardRegion` actors (including proxy only). They are * to all registered `ShardRegion` actors (including proxy only). They are
@ -1004,31 +1004,31 @@ object ShardCoordinator {
* When all have replied the `ShardCoordinator` continues by sending * When all have replied the `ShardCoordinator` continues by sending
* [[HandOff]] to the `ShardRegion` responsible for the shard. * [[HandOff]] to the `ShardRegion` responsible for the shard.
*/ */
@SerialVersionUID(1L) case class BeginHandOff(shard: ShardId) extends CoordinatorMessage @SerialVersionUID(1L) final case class BeginHandOff(shard: ShardId) extends CoordinatorMessage
/** /**
* Acknowledgement of [[BeginHandOff]] * Acknowledgement of [[BeginHandOff]]
*/ */
@SerialVersionUID(1L) case class BeginHandOffAck(shard: ShardId) extends CoordinatorCommand @SerialVersionUID(1L) final case class BeginHandOffAck(shard: ShardId) extends CoordinatorCommand
/** /**
* When all `ShardRegion` actors have acknoledged the [[BeginHandOff]] the * When all `ShardRegion` actors have acknoledged the [[BeginHandOff]] the
* ShardCoordinator` sends this message to the `ShardRegion` responsible for the * ShardCoordinator` sends this message to the `ShardRegion` responsible for the
* shard. The `ShardRegion` is supposed to stop all entries in that shard and when * shard. The `ShardRegion` is supposed to stop all entries in that shard and when
* all entries have terminated reply with `ShardStopped` to the `ShardCoordinator`. * all entries have terminated reply with `ShardStopped` to the `ShardCoordinator`.
*/ */
@SerialVersionUID(1L) case class HandOff(shard: ShardId) extends CoordinatorMessage @SerialVersionUID(1L) final case class HandOff(shard: ShardId) extends CoordinatorMessage
/** /**
* Reply to [[HandOff]] when all entries in the shard have been terminated. * Reply to [[HandOff]] when all entries in the shard have been terminated.
*/ */
@SerialVersionUID(1L) case class ShardStopped(shard: ShardId) extends CoordinatorCommand @SerialVersionUID(1L) final case class ShardStopped(shard: ShardId) extends CoordinatorCommand
// DomainEvents for the persistent state of the event sourced ShardCoordinator // DomainEvents for the persistent state of the event sourced ShardCoordinator
sealed trait DomainEvent sealed trait DomainEvent
@SerialVersionUID(1L) case class ShardRegionRegistered(region: ActorRef) extends DomainEvent @SerialVersionUID(1L) final case class ShardRegionRegistered(region: ActorRef) extends DomainEvent
@SerialVersionUID(1L) case class ShardRegionProxyRegistered(regionProxy: ActorRef) extends DomainEvent @SerialVersionUID(1L) final case class ShardRegionProxyRegistered(regionProxy: ActorRef) extends DomainEvent
@SerialVersionUID(1L) case class ShardRegionTerminated(region: ActorRef) extends DomainEvent @SerialVersionUID(1L) final case class ShardRegionTerminated(region: ActorRef) extends DomainEvent
@SerialVersionUID(1L) case class ShardRegionProxyTerminated(regionProxy: ActorRef) extends DomainEvent @SerialVersionUID(1L) final case class ShardRegionProxyTerminated(regionProxy: ActorRef) extends DomainEvent
@SerialVersionUID(1L) case class ShardHomeAllocated(shard: ShardId, region: ActorRef) extends DomainEvent @SerialVersionUID(1L) final case class ShardHomeAllocated(shard: ShardId, region: ActorRef) extends DomainEvent
@SerialVersionUID(1L) case class ShardHomeDeallocated(shard: ShardId) extends DomainEvent @SerialVersionUID(1L) final case class ShardHomeDeallocated(shard: ShardId) extends DomainEvent
object State { object State {
val empty = State() val empty = State()
@ -1037,7 +1037,7 @@ object ShardCoordinator {
/** /**
* Persistent state of the event sourced ShardCoordinator. * Persistent state of the event sourced ShardCoordinator.
*/ */
@SerialVersionUID(1L) case class State private ( @SerialVersionUID(1L) final case class State private (
// region for each shard // region for each shard
val shards: Map[ShardId, ActorRef] = Map.empty, val shards: Map[ShardId, ActorRef] = Map.empty,
// shards for each region // shards for each region
@ -1080,7 +1080,7 @@ object ShardCoordinator {
/** /**
* End of rebalance process performed by [[RebalanceWorker]] * End of rebalance process performed by [[RebalanceWorker]]
*/ */
private case class RebalanceDone(shard: ShardId, ok: Boolean) private final case class RebalanceDone(shard: ShardId, ok: Boolean)
private case object AfterRecover private case object AfterRecover

View file

@ -105,8 +105,8 @@ object ClusterSingletonManager {
*/ */
case object TakeOverFromMe case object TakeOverFromMe
case class HandOverRetry(count: Int) final case class HandOverRetry(count: Int)
case class TakeOverRetry(count: Int) final case class TakeOverRetry(count: Int)
case object Cleanup case object Cleanup
case object StartOldestChangedBuffer case object StartOldestChangedBuffer
@ -120,12 +120,12 @@ object ClusterSingletonManager {
case object End extends State case object End extends State
case object Uninitialized extends Data case object Uninitialized extends Data
case class YoungerData(oldestOption: Option[Address]) extends Data final case class YoungerData(oldestOption: Option[Address]) extends Data
case class BecomingOldestData(previousOldestOption: Option[Address]) extends Data final case class BecomingOldestData(previousOldestOption: Option[Address]) extends Data
case class OldestData(singleton: ActorRef, singletonTerminated: Boolean = false) extends Data final case class OldestData(singleton: ActorRef, singletonTerminated: Boolean = false) extends Data
case class WasOldestData(singleton: ActorRef, singletonTerminated: Boolean, final case class WasOldestData(singleton: ActorRef, singletonTerminated: Boolean,
newOldestOption: Option[Address]) extends Data newOldestOption: Option[Address]) extends Data
case class HandingOverData(singleton: ActorRef, handOverTo: Option[ActorRef]) extends Data final case class HandingOverData(singleton: ActorRef, handOverTo: Option[ActorRef]) extends Data
case object EndData extends Data case object EndData extends Data
val HandOverRetryTimer = "hand-over-retry" val HandOverRetryTimer = "hand-over-retry"
@ -145,9 +145,9 @@ object ClusterSingletonManager {
/** /**
* The first event, corresponding to CurrentClusterState. * The first event, corresponding to CurrentClusterState.
*/ */
case class InitialOldestState(oldest: Option[Address], memberCount: Int) final case class InitialOldestState(oldest: Option[Address], memberCount: Int)
case class OldestChanged(oldest: Option[Address]) final case class OldestChanged(oldest: Option[Address])
} }
/** /**

View file

@ -63,20 +63,20 @@ object DistributedPubSubMediator {
*/ */
def defaultProps(role: String): Props = props(Internal.roleOption(role)) def defaultProps(role: String): Props = props(Internal.roleOption(role))
@SerialVersionUID(1L) case class Put(ref: ActorRef) @SerialVersionUID(1L) final case class Put(ref: ActorRef)
@SerialVersionUID(1L) case class Remove(path: String) @SerialVersionUID(1L) final case class Remove(path: String)
@SerialVersionUID(1L) case class Subscribe(topic: String, ref: ActorRef) @SerialVersionUID(1L) final case class Subscribe(topic: String, ref: ActorRef)
@SerialVersionUID(1L) case class Unsubscribe(topic: String, ref: ActorRef) @SerialVersionUID(1L) final case class Unsubscribe(topic: String, ref: ActorRef)
@SerialVersionUID(1L) case class SubscribeAck(subscribe: Subscribe) @SerialVersionUID(1L) final case class SubscribeAck(subscribe: Subscribe)
@SerialVersionUID(1L) case class UnsubscribeAck(unsubscribe: Unsubscribe) @SerialVersionUID(1L) final case class UnsubscribeAck(unsubscribe: Unsubscribe)
@SerialVersionUID(1L) case class Publish(topic: String, msg: Any) extends DistributedPubSubMessage @SerialVersionUID(1L) final case class Publish(topic: String, msg: Any) extends DistributedPubSubMessage
@SerialVersionUID(1L) case class Send(path: String, msg: Any, localAffinity: Boolean) extends DistributedPubSubMessage { @SerialVersionUID(1L) final case class Send(path: String, msg: Any, localAffinity: Boolean) extends DistributedPubSubMessage {
/** /**
* Convenience constructor with `localAffinity` false * Convenience constructor with `localAffinity` false
*/ */
def this(path: String, msg: Any) = this(path, msg, localAffinity = false) def this(path: String, msg: Any) = this(path, msg, localAffinity = false)
} }
@SerialVersionUID(1L) case class SendToAll(path: String, msg: Any, allButSelf: Boolean = false) extends DistributedPubSubMessage { @SerialVersionUID(1L) final case class SendToAll(path: String, msg: Any, allButSelf: Boolean = false) extends DistributedPubSubMessage {
def this(path: String, msg: Any) = this(path, msg, allButSelf = false) def this(path: String, msg: Any) = this(path, msg, allButSelf = false)
} }
@ -90,20 +90,20 @@ object DistributedPubSubMediator {
case object Prune case object Prune
@SerialVersionUID(1L) @SerialVersionUID(1L)
case class Bucket( final case class Bucket(
owner: Address, owner: Address,
version: Long, version: Long,
content: Map[String, ValueHolder]) content: Map[String, ValueHolder])
@SerialVersionUID(1L) @SerialVersionUID(1L)
case class ValueHolder(version: Long, ref: Option[ActorRef]) { final case class ValueHolder(version: Long, ref: Option[ActorRef]) {
@transient lazy val routee: Option[Routee] = ref map ActorRefRoutee @transient lazy val routee: Option[Routee] = ref map ActorRefRoutee
} }
@SerialVersionUID(1L) @SerialVersionUID(1L)
case class Status(versions: Map[Address, Long]) extends DistributedPubSubMessage final case class Status(versions: Map[Address, Long]) extends DistributedPubSubMessage
@SerialVersionUID(1L) @SerialVersionUID(1L)
case class Delta(buckets: immutable.Iterable[Bucket]) extends DistributedPubSubMessage final case class Delta(buckets: immutable.Iterable[Bucket]) extends DistributedPubSubMessage
case object GossipTick case object GossipTick

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