Package akka.actor.typed.javadsl
Class Adapter
- java.lang.Object
-
- akka.actor.typed.javadsl.Adapter
-
public class Adapter extends java.lang.Object
Spawn the given behavior as a child of the user actor in an untyped ActorSystem. Typed actors default supervision strategy is to stop. Can be overridden withBehaviors.supervise
.
-
-
Constructor Summary
Constructors Constructor Description Adapter()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static ActorRef
actorOf(ActorContext<?> ctx, Props props)
static ActorRef
actorOf(ActorContext<?> ctx, Props props, java.lang.String name)
static <T> Props
props(Creator<Behavior<T>> behavior)
static <T> Props
props(Creator<Behavior<T>> behavior, Props deploy)
static <T> ActorRef<T>
spawn(ActorContext ctx, Behavior<T> behavior, java.lang.String name)
Spawn the given behavior as a child of the user actor in an untyped ActorContext.static <T> ActorRef<T>
spawn(ActorContext ctx, Behavior<T> behavior, java.lang.String name, Props props)
Spawn the given behavior as a child of the user actor in an untyped ActorContext.static <T> ActorRef<T>
spawn(ActorSystem sys, Behavior<T> behavior, java.lang.String name)
Spawn the given behavior as a child of the user actor in an untyped ActorSystem.static <T> ActorRef<T>
spawn(ActorSystem sys, Behavior<T> behavior, java.lang.String name, Props props)
Spawn the given behavior as a child of the user actor in an untyped ActorSystem.static <T> ActorRef<T>
spawnAnonymous(ActorContext ctx, Behavior<T> behavior)
Spawn the given behavior as a child of the user actor in an untyped ActorContext.static <T> ActorRef<T>
spawnAnonymous(ActorContext ctx, Behavior<T> behavior, Props props)
Spawn the given behavior as a child of the user actor in an untyped ActorContext.static <T> ActorRef<T>
spawnAnonymous(ActorSystem sys, Behavior<T> behavior)
static <T> ActorRef<T>
spawnAnonymous(ActorSystem sys, Behavior<T> behavior, Props props)
Spawn the given behavior as a child of the user actor in an untyped ActorSystem.static void
stop(ActorContext ctx, ActorRef<?> child)
static void
stop(ActorContext<?> ctx, ActorRef child)
static ActorRef
toClassic(ActorRef<?> ref)
static ActorSystem
toClassic(ActorSystem<?> sys)
static ActorContext
toClassic(ActorContext<?> ctx)
static <T> ActorRef<T>
toTyped(ActorRef ref)
static ActorSystem<java.lang.Void>
toTyped(ActorSystem sys)
static ActorRef
toUntyped(ActorRef<?> ref)
Deprecated.Use 'toClassic' instead.static ActorSystem
toUntyped(ActorSystem<?> sys)
Deprecated.Use 'toClassic' instead.static ActorContext
toUntyped(ActorContext<?> ctx)
Deprecated.Use 'toClassic' instead.static <U> void
unwatch(ActorContext ctx, ActorRef<U> other)
static <U> void
unwatch(ActorContext<?> ctx, ActorRef other)
static <U> void
watch(ActorContext ctx, ActorRef<U> other)
static <U> void
watch(ActorContext<?> ctx, ActorRef other)
-
-
-
Method Detail
-
spawnAnonymous
public static <T> ActorRef<T> spawnAnonymous(ActorSystem sys, Behavior<T> behavior)
-
spawnAnonymous
public static <T> ActorRef<T> spawnAnonymous(ActorSystem sys, Behavior<T> behavior, Props props)
Spawn the given behavior as a child of the user actor in an untyped ActorSystem. Typed actors default supervision strategy is to stop. Can be overridden withBehaviors.supervise
.- Parameters:
sys
- (undocumented)behavior
- (undocumented)props
- (undocumented)- Returns:
- (undocumented)
-
spawn
public static <T> ActorRef<T> spawn(ActorSystem sys, Behavior<T> behavior, java.lang.String name)
Spawn the given behavior as a child of the user actor in an untyped ActorSystem. Typed actors default supervision strategy is to stop. Can be overridden withBehaviors.supervise
.- Parameters:
sys
- (undocumented)behavior
- (undocumented)name
- (undocumented)- Returns:
- (undocumented)
-
spawn
public static <T> ActorRef<T> spawn(ActorSystem sys, Behavior<T> behavior, java.lang.String name, Props props)
Spawn the given behavior as a child of the user actor in an untyped ActorSystem. Typed actors default supervision strategy is to stop. Can be overridden withBehaviors.supervise
.- Parameters:
sys
- (undocumented)behavior
- (undocumented)name
- (undocumented)props
- (undocumented)- Returns:
- (undocumented)
-
spawnAnonymous
public static <T> ActorRef<T> spawnAnonymous(ActorContext ctx, Behavior<T> behavior)
Spawn the given behavior as a child of the user actor in an untyped ActorContext. Typed actors default supervision strategy is to stop. Can be overridden withBehaviors.supervise
.- Parameters:
ctx
- (undocumented)behavior
- (undocumented)- Returns:
- (undocumented)
-
spawnAnonymous
public static <T> ActorRef<T> spawnAnonymous(ActorContext ctx, Behavior<T> behavior, Props props)
Spawn the given behavior as a child of the user actor in an untyped ActorContext. Typed actors default supervision strategy is to stop. Can be overridden withBehaviors.supervise
.- Parameters:
ctx
- (undocumented)behavior
- (undocumented)props
- (undocumented)- Returns:
- (undocumented)
-
spawn
public static <T> ActorRef<T> spawn(ActorContext ctx, Behavior<T> behavior, java.lang.String name)
Spawn the given behavior as a child of the user actor in an untyped ActorContext. Typed actors default supervision strategy is to stop. Can be overridden withBehaviors.supervise
.- Parameters:
ctx
- (undocumented)behavior
- (undocumented)name
- (undocumented)- Returns:
- (undocumented)
-
spawn
public static <T> ActorRef<T> spawn(ActorContext ctx, Behavior<T> behavior, java.lang.String name, Props props)
Spawn the given behavior as a child of the user actor in an untyped ActorContext. Typed actors default supervision strategy is to stop. Can be overridden withBehaviors.supervise
.- Parameters:
ctx
- (undocumented)behavior
- (undocumented)name
- (undocumented)props
- (undocumented)- Returns:
- (undocumented)
-
toTyped
public static ActorSystem<java.lang.Void> toTyped(ActorSystem sys)
-
toUntyped
public static ActorSystem toUntyped(ActorSystem<?> sys)
Deprecated.Use 'toClassic' instead. Since 2.5.26.
-
toClassic
public static ActorSystem toClassic(ActorSystem<?> sys)
-
toUntyped
public static ActorContext toUntyped(ActorContext<?> ctx)
Deprecated.Use 'toClassic' instead. Since 2.5.26.
-
toClassic
public static ActorContext toClassic(ActorContext<?> ctx)
-
watch
public static <U> void watch(ActorContext ctx, ActorRef<U> other)
-
unwatch
public static <U> void unwatch(ActorContext ctx, ActorRef<U> other)
-
stop
public static void stop(ActorContext ctx, ActorRef<?> child)
-
watch
public static <U> void watch(ActorContext<?> ctx, ActorRef other)
-
unwatch
public static <U> void unwatch(ActorContext<?> ctx, ActorRef other)
-
stop
public static void stop(ActorContext<?> ctx, ActorRef child)
-
actorOf
public static ActorRef actorOf(ActorContext<?> ctx, Props props)
-
actorOf
public static ActorRef actorOf(ActorContext<?> ctx, Props props, java.lang.String name)
-
toUntyped
public static ActorRef toUntyped(ActorRef<?> ref)
Deprecated.Use 'toClassic' instead. Since 2.5.26.
-
props
public static <T> Props props(Creator<Behavior<T>> behavior, Props deploy)
WrapBehavior
in an untypedProps
, i.e. when spawning a typed child actor from an untyped parent actor. This is normally not needed because you can use the extension methodsspawn
andspawnAnonymous
with an untypedActorContext
, but it's needed when using typed actors with an existing library/tool that provides an API that takes an untypedProps
parameter. Cluster Sharding is an example of that.- Parameters:
behavior
- (undocumented)deploy
- (undocumented)- Returns:
- (undocumented)
-
props
public static <T> Props props(Creator<Behavior<T>> behavior)
WrapBehavior
in an untypedProps
, i.e. when spawning a typed child actor from an untyped parent actor. This is normally not needed because you can use the extension methodsspawn
andspawnAnonymous
with an untypedActorContext
, but it's needed when using typed actors with an existing library/tool that provides an API that takes an untypedProps
parameter. Cluster Sharding is an example of that.- Parameters:
behavior
- (undocumented)- Returns:
- (undocumented)
-
-