Class Receptionist$
- java.lang.Object
-
- org.apache.pekko.actor.typed.ExtensionId<Receptionist>
-
- org.apache.pekko.actor.typed.receptionist.Receptionist$
-
public class Receptionist$ extends ExtensionId<Receptionist>
A Receptionist is an entry point into an Actor hierarchy where select Actors publish their identity together with the protocols that they implement. Other Actors need only know the Receptionist’s identity in order to be able to use the services of the registered Actors.These are the messages (and the extension) for interacting with the receptionist. The receptionist is easiest accessed through the system:
ActorSystem.receptionist
-
-
Field Summary
Fields Modifier and Type Field Description static Receptionist$MODULE$Static reference to the singleton instance of this Scala object.
-
Constructor Summary
Constructors Constructor Description Receptionist$()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ReceptionistcreateExtension(ActorSystem<?> system)Create the extension, will be invoked at most one time per actor system where the extension is registered.<T> Receptionist.Commandderegister(ServiceKey<T> key, ActorRef<T> service)Java API: A Deregister message without Ack that the service was unregistered<T> Receptionist.Commandderegister(ServiceKey<T> key, ActorRef<T> service, ActorRef<Receptionist.Deregistered> replyTo)Java API: A Deregister message with an actor that will get an ack that the service was unregistered<T> Receptionist.Deregisteredderegistered(ServiceKey<T> key, ActorRef<T> serviceInstance)Java API: Sent by the receptionist, available here for easier testing<T> Receptionist.Commandfind(ServiceKey<T> key, ActorRef<Receptionist.Listing> replyTo)Java API:Findmessage.Receptionistget(ActorSystem<?> system)<T> Receptionist.Listinglisting(ServiceKey<T> key, java.util.Set<ActorRef<T>> serviceInstances)Java API: Sent by the receptionist, available here for easier testing<T> Receptionist.Listinglisting(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<T> Receptionist.Commandregister(ServiceKey<T> key, ActorRef<T> service)Java API: A Register message without Ack that the service was registered.<T> Receptionist.Commandregister(ServiceKey<T> key, ActorRef<T> service, ActorRef<Receptionist.Registered> replyTo)Java API: ARegistermessage with Ack that the service was registered.<T> Receptionist.Registeredregistered(ServiceKey<T> key, ActorRef<T> serviceInstance)Java API: Sent by the receptionist, available here for easier testing<T> Receptionist.Commandsubscribe(ServiceKey<T> key, ActorRef<Receptionist.Listing> subscriber)Java API:Subscribemessage.-
Methods inherited from class org.apache.pekko.actor.typed.ExtensionId
apply, equals, hashCode, id
-
-
-
-
Field Detail
-
MODULE$
public static final Receptionist$ MODULE$
Static reference to the singleton instance of this Scala object.
-
-
Method Detail
-
createExtension
public Receptionist createExtension(ActorSystem<?> system)
Description copied from class:ExtensionIdCreate the extension, will be invoked at most one time per actor system where the extension is registered.- Specified by:
createExtensionin classExtensionId<Receptionist>
-
get
public Receptionist get(ActorSystem<?> system)
-
register
public <T> Receptionist.Command register(ServiceKey<T> key, ActorRef<T> service)
Java API: A Register message without Ack that the service was registered. Associate the givenpekko.actor.typed.ActorRefwith the givenServiceKeyby 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, but it can also be explicitly deregistered before termination.
-
register
public <T> Receptionist.Command register(ServiceKey<T> key, ActorRef<T> service, ActorRef<Receptionist.Registered> replyTo)
Java API: ARegistermessage with Ack that the service was registered. Associate the givenpekko.actor.typed.ActorRefwith the givenServiceKeyby 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, but it can also be explicitly deregistered before termination.
Registration will be acknowledged with the
Registeredmessage to the given replyTo actor.
-
registered
public <T> Receptionist.Registered registered(ServiceKey<T> key, ActorRef<T> serviceInstance)
Java API: Sent by the receptionist, available here for easier testing
-
deregister
public <T> Receptionist.Command deregister(ServiceKey<T> key, ActorRef<T> service)
Java API: A Deregister message without Ack that the service was unregistered
-
deregister
public <T> Receptionist.Command deregister(ServiceKey<T> key, ActorRef<T> service, ActorRef<Receptionist.Deregistered> replyTo)
Java API: A Deregister message with an actor that will get an ack that the service was unregistered
-
deregistered
public <T> Receptionist.Deregistered deregistered(ServiceKey<T> key, ActorRef<T> serviceInstance)
Java API: Sent by the receptionist, available here for easier testing
-
subscribe
public <T> Receptionist.Command subscribe(ServiceKey<T> key, ActorRef<Receptionist.Listing> subscriber)
Java API:Subscribemessage. The given actor to service updates when this command is sent to theReceptionist.ref. When the set of instances registered for the given key changes the subscriber will be sent aListingwith the new set of instances for that service.The subscription will be acknowledged by sending out a first
Listing. The subscription automatically ends with the termination of the subscriber.
-
find
public <T> Receptionist.Command find(ServiceKey<T> key, ActorRef<Receptionist.Listing> replyTo)
Java API:Findmessage. Query the Receptionist for a list of all Actors implementing the given protocol at one point in time by sending this command to theReceptionist.ref.
-
listing
public <T> Receptionist.Listing listing(ServiceKey<T> key, java.util.Set<ActorRef<T>> serviceInstances)
Java API: Sent by the receptionist, available here for easier testing
-
listing
public <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
-
-