Class ActorAdapter<T>

  • All Implemented Interfaces:
    Actor

    public final class ActorAdapter<T>
    extends java.lang.Object
    implements Actor
    INTERNAL API
    • Constructor Summary

      Constructors 
      Constructor Description
      ActorAdapter​(Behavior<T> _initialBehavior, boolean rethrowTypedFailure)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void akka$actor$Actor$_setter_$context_$eq​(ActorContext x$1)
      Scala API: Stores the context for this actor, including self, and sender.
      protected void akka$actor$Actor$_setter_$self_$eq​(ActorRef x$1)
      The 'self' field holds the ActorRef for this actor.
      protected void aroundPostRestart​(java.lang.Throwable reason)
      INTERNAL API.
      protected void aroundPostStop()
      INTERNAL API.
      protected void aroundPreRestart​(java.lang.Throwable reason, scala.Option<java.lang.Object> message)
      INTERNAL API.
      protected void aroundPreStart()
      INTERNAL API.
      protected void aroundReceive​(scala.PartialFunction<java.lang.Object,​scala.runtime.BoxedUnit> receive, java.lang.Object msg)
      INTERNAL API.
      ActorContext context()
      Scala API: Stores the context for this actor, including self, and sender.
      ActorContextAdapter<T> ctx()  
      Behavior<T> currentBehavior()  
      void postRestart​(java.lang.Throwable reason)
      User overridable callback: By default it calls preStart().
      void postStop()
      User overridable callback.
      void preRestart​(java.lang.Throwable reason, scala.Option<java.lang.Object> message)
      Scala API: User overridable callback: '''By default it disposes of all children and then calls postStop().'''
      void preStart()
      User overridable callback.
      scala.PartialFunction<java.lang.Object,​scala.runtime.BoxedUnit> receive()
      Scala API: This defines the initial actor behavior, it must return a partial function with the actor logic.
      ActorRef self()
      The 'self' field holds the ActorRef for this actor.
      OneForOneStrategy supervisorStrategy()
      User overridable definition the strategy to use for supervising child actors.
      void unhandled​(java.lang.Object msg)
      User overridable callback.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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
      • 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
      • akka$actor$Actor$_setter_$context_$eq

        protected void akka$actor$Actor$_setter_$context_$eq​(ActorContext x$1)
        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:
        akka$actor$Actor$_setter_$context_$eq in interface Actor
      • 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
      • 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
      • 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
      • 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
      • aroundPreStart

        protected void aroundPreStart()
        Description copied from interface: Actor
        INTERNAL API.

        Can be overridden to intercept calls to preStart. Calls preStart by default.

        Specified by:
        aroundPreStart in interface Actor
      • aroundPreRestart

        protected void aroundPreRestart​(java.lang.Throwable reason,
                                        scala.Option<java.lang.Object> message)
        Description copied from interface: Actor
        INTERNAL API.

        Can be overridden to intercept calls to preRestart. Calls preRestart by default.

        Specified by:
        aroundPreRestart in interface Actor
      • aroundPostRestart

        protected void aroundPostRestart​(java.lang.Throwable reason)
        Description copied from interface: Actor
        INTERNAL API.

        Can be overridden to intercept calls to postRestart. Calls postRestart by default.

        Specified by:
        aroundPostRestart in interface Actor
      • aroundPostStop

        protected void aroundPostStop()
        Description copied from interface: Actor
        INTERNAL API.

        Can be overridden to intercept calls to postStop. Calls postStop by default.

        Specified by:
        aroundPostStop in interface Actor
      • 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