Class ActorAdapter<T>

  • All Implemented Interfaces:
    Actor, ActorLogging

    public final class ActorAdapter<T>
    extends java.lang.Object
    implements Actor, ActorLogging
    Failures from failed children, that were stopped through untyped supervision, this is what allows us to pass child exception in Terminated for direct children.
    • Constructor Detail

      • ActorAdapter

        public ActorAdapter​(Behavior<T> _initialBehavior,
                            boolean rethrowTypedFailure)
    • Method Detail

      • context

        public ActorContext context()
        Description copied from interface: Actor
        Scala API: Stores the context for this actor, including self, and sender. It is implicit to support operations such as forward.

        WARNING: Only valid within the Actor itself, so do not close over it and publish it to other threads!

        ActorContext is the Scala API. getContext returns a AbstractActor.ActorContext, which is the Java API of the actor context.

        Specified by:
        context in interface Actor
        Returns:
        (undocumented)
      • self

        public final ActorRef self()
        Description copied from interface: Actor
        The 'self' field holds the ActorRef for this actor.

        Can be used to send messages to itself:
         self ! message
         
        Specified by:
        self in interface Actor
        Returns:
        (undocumented)
      • akka$actor$Actor$_setter_$self_$eq

        protected final void akka$actor$Actor$_setter_$self_$eq​(ActorRef x$1)
        Description copied from interface: Actor
        The 'self' field holds the ActorRef for this actor.

        Can be used to send messages to itself:
         self ! message
         
        Specified by:
        akka$actor$Actor$_setter_$self_$eq in interface Actor
        Parameters:
        x$1 - (undocumented)
      • currentBehavior

        public Behavior<T> currentBehavior()
      • receive

        public scala.PartialFunction<java.lang.Object,​scala.runtime.BoxedUnit> receive()
        Description copied from interface: Actor
        Scala API: This defines the initial actor behavior, it must return a partial function with the actor logic.
        Specified by:
        receive in interface Actor
        Returns:
        (undocumented)
      • aroundReceive

        protected void aroundReceive​(scala.PartialFunction<java.lang.Object,​scala.runtime.BoxedUnit> receive,
                                     java.lang.Object msg)
        Description copied from interface: Actor
        INTERNAL API.

        Can be overridden to intercept calls to this actor's current behavior.

        Specified by:
        aroundReceive in interface Actor
        Parameters:
        receive - current behavior.
        msg - current message.
      • unhandled

        public void unhandled​(java.lang.Object msg)
        Description copied from interface: Actor
        User overridable callback.

        Is called when a message isn't handled by the current behavior of the actor by default it fails with either a DeathPactException (in case of an unhandled Terminated message) or publishes an UnhandledMessage to the actor's system's EventStream
        Specified by:
        unhandled in interface Actor
        Parameters:
        msg - (undocumented)
      • supervisorStrategy

        public OneForOneStrategy supervisorStrategy()
        Description copied from interface: Actor
        User overridable definition the strategy to use for supervising child actors.
        Specified by:
        supervisorStrategy in interface Actor
        Returns:
        (undocumented)
      • preStart

        public void preStart()
        Description copied from interface: Actor
        User overridable callback.

        Is called when an Actor is started. Actors are automatically started asynchronously when created. Empty default implementation.
        Specified by:
        preStart in interface Actor
      • preRestart

        public void preRestart​(java.lang.Throwable reason,
                               scala.Option<java.lang.Object> message)
        Description copied from interface: Actor
        Scala API: User overridable callback: '''By default it disposes of all children and then calls postStop().'''
        Specified by:
        preRestart in interface Actor
        Parameters:
        reason - the Throwable that caused the restart to happen
        message - optionally the current message the actor processed when failing, if applicable

        Is called on a crashed Actor right BEFORE it is restarted to allow clean up of resources before Actor is terminated.
      • postRestart

        public void postRestart​(java.lang.Throwable reason)
        Description copied from interface: Actor
        User overridable callback: By default it calls preStart().
        Specified by:
        postRestart in interface Actor
        Parameters:
        reason - the Throwable that caused the restart to happen

        Is called right AFTER restart on the newly created Actor to allow reinitialization after an Actor crash.
      • postStop

        public void postStop()
        Description copied from interface: Actor
        User overridable callback.

        Is called asynchronously after 'actor.stop()' is invoked. Empty default implementation.
        Specified by:
        postStop in interface Actor