Package akka.actor.typed.receptionist
Class Receptionist
- java.lang.Object
-
- akka.actor.typed.receptionist.Receptionist
-
- All Implemented Interfaces:
Extension
- Direct Known Subclasses:
ReceptionistImpl
public abstract class Receptionist extends java.lang.Object implements Extension
Register and discover actors that implement a service with a protocol defined by aServiceKey
.This class is not intended for user extension other than for test purposes (e.g. stub implementation). More methods may be added in the future and that may break such implementations.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Receptionist.Command
The set of commands accepted by a Receptionist.static class
Receptionist.Find$
Scala API:static interface
Receptionist.Listing
Scala APIstatic class
Receptionist.Listing$
static class
Receptionist.Register$
static interface
Receptionist.Registered
Scala APIstatic class
Receptionist.Registered$
static class
Receptionist.Subscribe$
Scala API:
-
Constructor Summary
Constructors Constructor Description Receptionist()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static T
apply(ActorSystem<?> system)
static Receptionist
createExtension(ActorSystem<?> system)
static boolean
equals(java.lang.Object other)
static <T> Receptionist.Command
find(ServiceKey<T> key, ActorRef<Receptionist.Listing> replyTo)
static Receptionist
get(ActorSystem<?> system)
static int
hashCode()
static ExtensionId<T>
id()
static <T> Receptionist.Listing
listing(ServiceKey<T> key, java.util.Set<ActorRef<T>> serviceInstances)
static <T> Receptionist.Listing
listing(ServiceKey<T> key, java.util.Set<ActorRef<T>> serviceInstances, java.util.Set<ActorRef<T>> allServiceInstances, boolean servicesWereAddedOrRemoved)
Java API: Sent by the receptionist, available here for easier testingabstract ActorRef<Receptionist.Command>
ref()
static <T> Receptionist.Command
register(ServiceKey<T> key, ActorRef<T> service)
static <T> Receptionist.Command
register(ServiceKey<T> key, ActorRef<T> service, ActorRef<Receptionist.Registered> replyTo)
Java API: ARegister
message with Ack that the service was registered.static <T> Receptionist.Registered
registered(ServiceKey<T> key, ActorRef<T> serviceInstance)
static <T> Receptionist.Command
subscribe(ServiceKey<T> key, ActorRef<Receptionist.Listing> subscriber)
-
-
-
Method Detail
-
createExtension
public static Receptionist createExtension(ActorSystem<?> system)
-
get
public static Receptionist get(ActorSystem<?> system)
-
register
public static <T> Receptionist.Command register(ServiceKey<T> key, ActorRef<T> service)
-
register
public static <T> Receptionist.Command register(ServiceKey<T> key, ActorRef<T> service, ActorRef<Receptionist.Registered> replyTo)
Java API: ARegister
message with Ack that the service was registered. Associate the givenActorRef
with the givenServiceKey
by sending this command to theReceptionist.ref
.Multiple registrations can be made for the same key. De-registration is implied by the end of the referenced Actor’s lifecycle.
Registration will be acknowledged with the
Receptionist.Registered
message to the given replyTo actor.- Parameters:
key
- (undocumented)service
- (undocumented)replyTo
- (undocumented)- Returns:
- (undocumented)
-
registered
public static <T> Receptionist.Registered registered(ServiceKey<T> key, ActorRef<T> serviceInstance)
-
subscribe
public static <T> Receptionist.Command subscribe(ServiceKey<T> key, ActorRef<Receptionist.Listing> subscriber)
-
find
public static <T> Receptionist.Command find(ServiceKey<T> key, ActorRef<Receptionist.Listing> replyTo)
-
listing
public static <T> Receptionist.Listing listing(ServiceKey<T> key, java.util.Set<ActorRef<T>> serviceInstances)
-
listing
public static <T> Receptionist.Listing listing(ServiceKey<T> key, java.util.Set<ActorRef<T>> serviceInstances, java.util.Set<ActorRef<T>> allServiceInstances, boolean servicesWereAddedOrRemoved)
Java API: Sent by the receptionist, available here for easier testing- Parameters:
key
- (undocumented)serviceInstances
- (undocumented)allServiceInstances
- (undocumented)servicesWereAddedOrRemoved
- (undocumented)- Returns:
- (undocumented)
-
apply
public static final T apply(ActorSystem<?> system)
-
hashCode
public static final int hashCode()
-
equals
public static final boolean equals(java.lang.Object other)
-
id
public static ExtensionId<T> id()
-
ref
public abstract ActorRef<Receptionist.Command> ref()
-
-