public final class Restarter<T,Thr extends java.lang.Throwable> extends Behavior<T> implements scala.Product, scala.Serializable
FIXME add limited restarts and back-off (with limited buffering or vacation responder) FIXME write tests that ensure that all Behaviors are okay with getting PostRestart as first signal
Modifier and Type | Class and Description |
---|---|
static class |
Restarter.Apply<Thr extends java.lang.Throwable> |
Behavior.emptyBehavior$, Behavior.ignoreBehavior$, Behavior.sameBehavior$, Behavior.stoppedBehavior$, Behavior.unhandledBehavior$
Constructor and Description |
---|
Restarter(Behavior<T> initialBehavior,
boolean resume,
scala.reflect.ClassTag<Thr> evidence$1) |
Modifier and Type | Method and Description |
---|---|
static <Thr extends java.lang.Throwable> |
apply(boolean resume,
scala.reflect.ClassTag<Thr> evidence$2) |
abstract static boolean |
canEqual(java.lang.Object that) |
abstract static boolean |
equals(java.lang.Object that) |
Behavior<T> |
initialBehavior() |
Behavior<T> |
management(ActorContext<T> ctx,
Signal signal)
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.
|
static <U extends T> |
narrow() |
abstract static int |
productArity() |
abstract static java.lang.Object |
productElement(int n) |
static scala.collection.Iterator<java.lang.Object> |
productIterator() |
static java.lang.String |
productPrefix() |
boolean |
resume() |
canonicalize, isAlive, isUnhandled, narrow, preStart, validateAsInitial
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public static <Thr extends java.lang.Throwable> Restarter.Apply<Thr> apply(boolean resume, scala.reflect.ClassTag<Thr> evidence$2)
public static <U extends T> Behavior<U> narrow()
public abstract static boolean canEqual(java.lang.Object that)
public abstract static boolean equals(java.lang.Object that)
public abstract static java.lang.Object productElement(int n)
public abstract static int productArity()
public static scala.collection.Iterator<java.lang.Object> productIterator()
public static java.lang.String productPrefix()
public boolean resume()
public Behavior<T> management(ActorContext<T> ctx, Signal signal)
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)signal
- (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.