Package akka.cluster.sharding
Class ShardRegion.Passivate
- java.lang.Object
-
- akka.cluster.sharding.ShardRegion.Passivate
-
- All Implemented Interfaces:
ShardRegion.ShardRegionCommand
,java.io.Serializable
,scala.Equals
,scala.Product
- Enclosing class:
- ShardRegion
public static final class ShardRegion.Passivate extends java.lang.Object implements ShardRegion.ShardRegionCommand, scala.Product, java.io.Serializable
If the state of the entities are persistent you may stop entities that are not used to reduce memory consumption. This is done by the application specific implementation of the entity actors for example by defining receive timeout (context.setReceiveTimeout
). If a message is already enqueued to the entity when it stops itself the enqueued message in the mailbox will be dropped. To support graceful passivation without losing such messages the entity actor can send thisPassivate
message to its parentShardRegion
. The specified wrappedstopMessage
will be sent back to the entity, which is then supposed to stop itself. Incoming messages will be buffered by theShardRegion
between reception ofPassivate
and termination of the entity. Such buffered messages are thereafter delivered to a new incarnation of the entity.PoisonPill
is a perfectly finestopMessage
.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Passivate(java.lang.Object stopMessage)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canEqual(java.lang.Object x$1)
ShardRegion.Passivate
copy(java.lang.Object stopMessage)
java.lang.Object
copy$default$1()
boolean
equals(java.lang.Object x$1)
int
hashCode()
int
productArity()
java.lang.Object
productElement(int x$1)
java.lang.String
productElementName(int x$1)
scala.collection.Iterator<java.lang.Object>
productIterator()
java.lang.String
productPrefix()
java.lang.Object
stopMessage()
java.lang.String
toString()
-
-
-
Method Detail
-
stopMessage
public java.lang.Object stopMessage()
-
copy
public ShardRegion.Passivate copy(java.lang.Object stopMessage)
-
copy$default$1
public java.lang.Object copy$default$1()
-
productPrefix
public java.lang.String productPrefix()
- Specified by:
productPrefix
in interfacescala.Product
-
productArity
public int productArity()
- Specified by:
productArity
in interfacescala.Product
-
productElement
public java.lang.Object productElement(int x$1)
- Specified by:
productElement
in interfacescala.Product
-
productIterator
public scala.collection.Iterator<java.lang.Object> productIterator()
- Specified by:
productIterator
in interfacescala.Product
-
canEqual
public boolean canEqual(java.lang.Object x$1)
- Specified by:
canEqual
in interfacescala.Equals
-
productElementName
public java.lang.String productElementName(int x$1)
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object x$1)
- Specified by:
equals
in interfacescala.Equals
- Overrides:
equals
in classjava.lang.Object
-
-