Packages

package javadsl

Ordering
  1. Alphabetic
Visibility
  1. Public
  2. Protected

Type Members

  1. abstract class AbstractBehavior[T] extends ExtensibleBehavior[T]

    An actor Behavior can be implemented by extending this class and implement the abstract method AbstractBehavior#createReceive.

    An actor Behavior can be implemented by extending this class and implement the abstract method AbstractBehavior#createReceive. Mutable state can be defined as instance variables of the class.

    This is an Object-oriented style of defining a Behavior. A more functional style alternative is provided by the factory methods in Behaviors, for example Behaviors.receiveMessage.

    Instances of this behavior should be created via Behaviors.setup and the ActorContext should be passed as a constructor parameter from the factory function. This is important because a new instance should be created when restart supervision is used.

    When switching Behavior to another AbstractBehavior the original ActorContext can be used as the context parameter instead of wrapping in a new Behaviors.setup, but it wouldn't be wrong to use context from Behaviors.setup since that is the same ActorContext instance.

    It must not be created with an ActorContext of another actor, such as the parent actor. Such mistake will be detected at runtime and throw IllegalStateException when the first message is received.

    See also

    Behaviors.setup

  2. abstract class AbstractOnMessageBehavior[T] extends ExtensibleBehavior[T]

    An actor Behavior can be implemented by extending this class and implementing the abstract method AbstractOnMessageBehavior#onMessage.

    An actor Behavior can be implemented by extending this class and implementing the abstract method AbstractOnMessageBehavior#onMessage. Mutable state can be defined as instance variables of the class.

    This is an object-oriented style of defining a Behavior. A more functional style alternative is provided by the factory methods in Behaviors, for example Behaviors.receiveMessage.

    An alternative object-oriented style is found in AbstractBehavior, which uses builders to define the Behavior. In contrast to extending AbstractBehavior, extending this class should have reduced overhead, though depending on the complexity of the protocol handled by this actor and on the Java version in use, the onMessage and onSignal methods may be overly complex.

    Instances of this behavior should be created via Behaviors.setup and the ActorContext should be passed as a constructor parameter from the factory function. This is important because a new instance should be created when restart supervision is used.

    When switching behavior to another behavior which requires a context, the original ActorContext can be used or a Behaviors.setup can be used: either will end up using the same ActorContext instance.

    It must not be created with an ActorContext of another actor (e.g. the parent actor). Doing so will be detected at runtime and throw an IllegalStateException when the first message is received.

    See also

    Behaviors.setup

  3. trait ActorContext[T] extends TypedActorContext[T] with ClassicActorContextProvider

    An Actor is given by the combination of a Behavior and a context in which this behavior is executed.

    An Actor is given by the combination of a Behavior and a context in which this behavior is executed. As per the Actor Model an Actor can perform the following actions when processing a message:

    • send a finite number of messages to other Actors it knows
    • create a finite number of Actors
    • designate the behavior for the next message

    In Akka the first capability is accessed by using the tell method on an ActorRef, the second is provided by ActorContext#spawn and the third is implicit in the signature of Behavior in that the next behavior is always returned from the message processing logic.

    An ActorContext in addition provides access to the Actor’s own identity (“getSelf”), the ActorSystem it is part of, methods for querying the list of child Actors it created, access to Terminated and timed message scheduling.

    Not for user extension.

    Annotations
    @DoNotInherit()
  4. final class BehaviorBuilder[T] extends AnyRef

    Immutable builder used for creating a Behavior by 'chaining' message and signal handlers.

    Immutable builder used for creating a Behavior by 'chaining' message and signal handlers.

    When handling a message or signal, this Behavior will consider all handlers in the order they were added, looking for the first handler for which both the type and the (optional) predicate match.

    Akka akka.japi.function lambda types are used throughout to allow handlers to throw checked exceptions (which will fail the actor).

    T

    the common superclass of all supported messages.

  5. abstract class GroupRouter[T] extends DeferredBehavior[T]

    Provides builder style configuration options for group routers

    Provides builder style configuration options for group routers

    Not for user extension. Use Routers#group to create

    Annotations
    @DoNotInherit()
  6. abstract class PoolRouter[T] extends DeferredBehavior[T]

    Provides builder style configuration options for pool routers

    Provides builder style configuration options for pool routers

    Not for user extension. Use Routers#pool to create

    Annotations
    @DoNotInherit()
  7. abstract class Receive[T] extends ExtensibleBehavior[T]

    A specialized "receive" behavior that is implemented using message matching builders, such as ReceiveBuilder, from AbstractBehavior.

    A specialized "receive" behavior that is implemented using message matching builders, such as ReceiveBuilder, from AbstractBehavior.

    Annotations
    @DoNotInherit()
  8. final class ReceiveBuilder[T] extends AnyRef

    Mutable builder used when implementing AbstractBehavior.

    Mutable builder used when implementing AbstractBehavior.

    When handling a message or signal, this Behavior will consider all handlers in the order they were added, looking for the first handler for which both the type and the (optional) predicate match.

    T

    the common superclass of all supported messages.

  9. trait StashBuffer[T] extends AnyRef

    A non thread safe mutable message buffer that can be used to buffer messages inside actors and then unstash them.

    A non thread safe mutable message buffer that can be used to buffer messages inside actors and then unstash them.

    The buffer can hold at most the given capacity number of messages.

    Not for user extension.

    Annotations
    @DoNotInherit()
  10. final class StashOverflowException extends scaladsl.StashOverflowException

    Is thrown when the size of the stash exceeds the capacity of the stash buffer.

  11. trait TimerScheduler[T] extends AnyRef

    Support for scheduled self messages in an actor.

    Support for scheduled self messages in an actor. It is used with Behaviors.withTimers, which also takes care of the lifecycle of the timers such as cancelling them when the actor is restarted or stopped.

    TimerScheduler is not thread-safe, i.e. it must only be used within the actor that owns it.

    Not for user extension.

    Annotations
    @DoNotInherit()

Value Members

  1. object Adapter

    Adapters between typed and classic actors and actor systems.

    Adapters between typed and classic actors and actor systems. The underlying ActorSystem is the classic akka.actor.ActorSystem which runs Akka akka.actor.typed.Behavior on an emulation layer. In this system typed and classic actors can coexist.

    These methods make it possible to create a child actor from classic parent actor, and the opposite classic child from typed parent. watch is also supported in both directions.

    There are also converters (toTyped, toClassic) between classic akka.actor.ActorRef and akka.actor.typed.ActorRef, and between classic akka.actor.ActorSystem and akka.actor.typed.ActorSystem.

  2. object AskPattern

    The ask-pattern implements the initiator side of a request–reply protocol.

    The ask-pattern implements the initiator side of a request–reply protocol.

    Note that if you are inside of an actor you should prefer ActorContext.ask as that provides better safety.

    The party that asks may be within or without an Actor, since the implementation will fabricate a (hidden) ActorRef that is bound to a CompletableFuture. This ActorRef will need to be injected in the message that is sent to the target Actor in order to function as a reply-to address, therefore the argument to the ask method is not the message itself but a function that given the reply-to address will create the message.

  3. object BehaviorBuilder
  4. object Behaviors

    Factories for akka.actor.typed.Behavior.

  5. object ReceiveBuilder
  6. object Routers

Ungrouped