public static final class ScalaDSL.Static<T> extends Behavior<T> implements scala.Product, scala.Serializable
ScalaDSL.Total
that does not
allow the actor to change behavior. It is an efficient choice for stateless
actors, possibly entering such a behavior after finishing its
initialization (which may be modeled using any of the other behavior types).
This behavior type is most useful for leaf actors that do not create child actors themselves.
Behavior.emptyBehavior$, Behavior.ignoreBehavior$, Behavior.sameBehavior$, Behavior.stoppedBehavior$, Behavior.unhandledBehavior$
Constructor and Description |
---|
Static(scala.Function1<T,scala.runtime.BoxedUnit> behavior) |
Modifier and Type | Method and Description |
---|---|
scala.Function1<T,scala.runtime.BoxedUnit> |
behavior() |
Behavior<T> |
management(ActorContext<T> ctx,
Signal msg)
Process an incoming
Signal and return the next behavior. |
Behavior<T> |
message(ActorContext<T> ctx,
T msg)
Process an incoming message and return the next behavior.
|
java.lang.String |
toString() |
canonicalize, isAlive, isUnhandled, narrow, preStart, validateAsInitial
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
public Static(scala.Function1<T,scala.runtime.BoxedUnit> behavior)
public scala.Function1<T,scala.runtime.BoxedUnit> behavior()
public Behavior<T> management(ActorContext<T> ctx, Signal msg)
Behavior
Signal
and return the next behavior. This means
that all lifecycle hooks, ReceiveTimeout, Terminated and Failed messages
can initiate a behavior change.
The returned behavior can in addition to normal behaviors be one of the canned special objects:
* returning Stopped
will terminate this Behavior
* returning Same
designates to reuse the current Behavior
* returning Unhandled
keeps the same Behavior and signals that the message was not yet handled
Code calling this method should use Behavior$
canonicalize
to replace
the special objects with real Behaviors.
management
in class Behavior<T>
ctx
- (undocumented)msg
- (undocumented)public Behavior<T> message(ActorContext<T> ctx, T msg)
Behavior
The returned behavior can in addition to normal behaviors be one of the canned special objects:
* returning Stopped
will terminate this Behavior
* returning Same
designates to reuse the current Behavior
* returning Unhandled
keeps the same Behavior and signals that the message was not yet handled
Code calling this method should use Behavior$
canonicalize
to replace
the special objects with real Behaviors.
public java.lang.String toString()
toString
in class java.lang.Object