Package org.apache.pekko.actor
Class AbstractActor.Receive
- java.lang.Object
-
- org.apache.pekko.actor.AbstractActor.Receive
-
- Enclosing class:
- AbstractActor
public static final class AbstractActor.Receive extends java.lang.Object
Defines which messages the Actor can handle, along with the implementation of how the messages should be processed. You can build such behavior with thepekko.japi.pf.ReceiveBuilder
but it can be implemented in other ways than using theReceiveBuilder
since it in the end is just a wrapper around a ScalaPartialFunction
. In Java, you can implementPartialFunction
by extendingAbstractPartialFunction
.
-
-
Constructor Summary
Constructors Constructor Description Receive(scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> onMessage)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit>
onMessage()
AbstractActor.Receive
orElse(AbstractActor.Receive other)
Composes thisReceive
with a fallback which gets applied where this partial function is not defined.
-
-
-
Method Detail
-
onMessage
public scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> onMessage()
-
orElse
public AbstractActor.Receive orElse(AbstractActor.Receive other)
Composes thisReceive
with a fallback which gets applied where this partial function is not defined.
-
-