Class ActorAdapter<T>
- java.lang.Object
-
- akka.actor.typed.internal.adapter.ActorAdapter<T>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ActorAdapter.TypedActorFailedException
Thrown to indicate that a Behavior has failed so that the parent gets the cause and can fill in the cause in theChildFailed
signal Wrapped to avoid it being logged as the typed supervision will already have logged it.static class
ActorAdapter.TypedActorFailedException$
-
Nested classes/interfaces inherited from interface akka.actor.Actor
Actor.emptyBehavior$, Actor.ignoringBehavior$
-
-
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 callspreStart()
.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 callspostStop()
.'''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.
-
-
-
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 asforward
.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 aAbstractActor.ActorContext
, which is the Java API of the actor context.
-
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
-
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 asforward
.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 aAbstractActor.ActorContext
, which is the Java API of the actor context.- Specified by:
akka$actor$Actor$_setter_$context_$eq
in interfaceActor
-
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 interfaceActor
-
ctx
public ActorContextAdapter<T> ctx()
-
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.
-
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 interfaceActor
- 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 aDeathPactException
(in case of an unhandledTerminated
message) or publishes anUnhandledMessage
to the actor's system'sEventStream
-
supervisorStrategy
public OneForOneStrategy supervisorStrategy()
Description copied from interface:Actor
User overridable definition the strategy to use for supervising child actors.- Specified by:
supervisorStrategy
in interfaceActor
-
aroundPreStart
protected void aroundPreStart()
Description copied from interface:Actor
INTERNAL API.Can be overridden to intercept calls to
preStart
. CallspreStart
by default.- Specified by:
aroundPreStart
in interfaceActor
-
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
. CallspreRestart
by default.- Specified by:
aroundPreRestart
in interfaceActor
-
aroundPostRestart
protected void aroundPostRestart(java.lang.Throwable reason)
Description copied from interface:Actor
INTERNAL API.Can be overridden to intercept calls to
postRestart
. CallspostRestart
by default.- Specified by:
aroundPostRestart
in interfaceActor
-
aroundPostStop
protected void aroundPostStop()
Description copied from interface:Actor
INTERNAL API.Can be overridden to intercept calls to
postStop
. CallspostStop
by default.- Specified by:
aroundPostStop
in interfaceActor
-
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.
-
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 callspostStop()
.'''- Specified by:
preRestart
in interfaceActor
- Parameters:
reason
- the Throwable that caused the restart to happenmessage
- 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 callspreStart()
.- Specified by:
postRestart
in interfaceActor
- 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.
-
-