=clt #18232 Serializer for ClusterSingleton

This commit is contained in:
Patrik Nordwall 2015-08-17 16:46:26 +02:00
parent 7693f1e5d3
commit 33e05ea59a
4 changed files with 118 additions and 5 deletions

View file

@ -111,6 +111,11 @@ final class ClusterSingletonManagerSettings(
new ClusterSingletonManagerSettings(singletonName, role, removalMargin, handOverRetryInterval)
}
/**
* Marker trait for remote messages with special serializer.
*/
sealed trait ClusterSingletonMessage extends Serializable
object ClusterSingletonManager {
/**
@ -136,25 +141,25 @@ object ClusterSingletonManager {
/**
* INTERNAL API
*/
private object Internal {
private[akka] object Internal {
/**
* Sent from new oldest to previous oldest to initiate the
* hand-over process. `HandOverInProgress` and `HandOverDone`
* are expected replies.
*/
case object HandOverToMe
case object HandOverToMe extends ClusterSingletonMessage
/**
* Confirmation by the previous oldest that the hand
* over process, shut down of the singleton actor, has
* started.
*/
case object HandOverInProgress
case object HandOverInProgress extends ClusterSingletonMessage
/**
* Confirmation by the previous oldest that the singleton
* actor has been terminated and the hand-over process is
* completed.
*/
case object HandOverDone
case object HandOverDone extends ClusterSingletonMessage
/**
* Sent from from previous oldest to new oldest to
* initiate the normal hand-over process.
@ -162,7 +167,7 @@ object ClusterSingletonManager {
* oldest immediately, without knowing who was previous
* oldest.
*/
case object TakeOverFromMe
case object TakeOverFromMe extends ClusterSingletonMessage
final case class HandOverRetry(count: Int)
final case class TakeOverRetry(count: Int)