Class 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&rsquo;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 Detail

      • MODULE$

        public static final Receptionist$ MODULE$
        Static reference to the singleton instance of this Scala object.
    • Constructor Detail

      • Receptionist$

        public Receptionist$()
    • Method Detail

      • 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 given ActorRef with the given ServiceKey by sending this command to the Receptionist.ref.

        Multiple registrations can be made for the same key. De-registration is implied by the end of the referenced Actor&rsquo;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: A Register message with Ack that the service was registered. Associate the given ActorRef with the given ServiceKey by sending this command to the Receptionist.ref.

        Multiple registrations can be made for the same key. De-registration is implied by the end of the referenced Actor&rsquo;s lifecycle, but it can also be explicitly deregistered before termination.

        Registration will be acknowledged with the Registered message to the given replyTo actor.

      • subscribe

        public <T> Receptionist.Command subscribe​(ServiceKey<T> key,
                                                  ActorRef<Receptionist.Listing> subscriber)
        Java API: Subscribe message. The given actor to service updates when this command is sent to the Receptionist.ref. When the set of instances registered for the given key changes the subscriber will be sent a Listing with 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.

      • 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