Class ReceptionistMessages.Listing<T>
- java.lang.Object
-
- org.apache.pekko.actor.typed.internal.receptionist.ReceptionistMessages.Listing<T>
-
- All Implemented Interfaces:
java.io.Serializable,Receptionist.Listing,scala.Equals,scala.Product
- Enclosing class:
- ReceptionistMessages
public static final class ReceptionistMessages.Listing<T> extends java.lang.Object implements Receptionist.Listing, scala.Product, java.io.Serializable
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description scala.collection.immutable.Set<ActorRef<T>>_allServiceInstances()scala.collection.immutable.Set<ActorRef<T>>_serviceInstances()<M> scala.collection.immutable.Set<ActorRef<M>>allServiceInstances(ServiceKey<M> key)Scala API: Return both the reachable and the unreachable service instances.booleancanEqual(java.lang.Object x$1)<T> ReceptionistMessages.Listing<T>copy(ServiceKey<T> key, scala.collection.immutable.Set<ActorRef<T>> _serviceInstances, scala.collection.immutable.Set<ActorRef<T>> _allServiceInstances, boolean servicesWereAddedOrRemoved)<T> ServiceKey<T>copy$default$1()<T> scala.collection.immutable.Set<ActorRef<T>>copy$default$2()<T> scala.collection.immutable.Set<ActorRef<T>>copy$default$3()<T> booleancopy$default$4()booleanequals(java.lang.Object x$1)<M> java.util.Set<ActorRef<M>>getAllServiceInstances(ServiceKey<M> key)Java API: Return both the reachable and the unreachable service instances.<M> java.util.Set<ActorRef<M>>getServiceInstances(ServiceKey<M> key)Java API: Return the reachable service instances.inthashCode()booleanisForKey(ServiceKey<?> key)ServiceKey<T>key()Scala APIintproductArity()java.lang.ObjectproductElement(int x$1)java.lang.StringproductElementName(int x$1)scala.collection.Iterator<java.lang.Object>productIterator()java.lang.StringproductPrefix()<M> scala.collection.immutable.Set<ActorRef<M>>serviceInstances(ServiceKey<M> key)Scala API: Return the reachable service instances.booleanservicesWereAddedOrRemoved()Returnstrueonly if thisListingwas sent triggered by new actors added or removed to the receptionist.java.lang.StringtoString()-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.pekko.actor.typed.receptionist.Receptionist.Listing
getKey
-
-
-
-
Method Detail
-
key
public ServiceKey<T> key()
Description copied from interface:Receptionist.ListingScala API- Specified by:
keyin interfaceReceptionist.Listing
-
servicesWereAddedOrRemoved
public boolean servicesWereAddedOrRemoved()
Description copied from interface:Receptionist.ListingReturnstrueonly if thisListingwas sent triggered by new actors added or removed to the receptionist. Whenfalsethe event is only about reachability changes - meaning that the full set of actors (Receptionist.Listing.allServiceInstances(org.apache.pekko.actor.typed.receptionist.ServiceKey<T>)orReceptionist.Listing.getAllServiceInstances(org.apache.pekko.actor.typed.receptionist.ServiceKey<T>)) is the same as the previousListing.knowing this is useful for subscribers only concerned with
Receptionist.Listing.allServiceInstances(org.apache.pekko.actor.typed.receptionist.ServiceKey<T>)orReceptionist.Listing.getAllServiceInstances(org.apache.pekko.actor.typed.receptionist.ServiceKey<T>)that can then ignoreListings related to reachability.In a non-clustered
ActorSystemthis will betruefor all listings. ForFindqueries and the initial listing for aSubscribethis will always betrue.- Specified by:
servicesWereAddedOrRemovedin interfaceReceptionist.Listing
-
isForKey
public boolean isForKey(ServiceKey<?> key)
- Specified by:
isForKeyin interfaceReceptionist.Listing
-
serviceInstances
public <M> scala.collection.immutable.Set<ActorRef<M>> serviceInstances(ServiceKey<M> key)
Description copied from interface:Receptionist.ListingScala API: Return the reachable service instances.In a non-clustered
ActorSystemthis will always be all registered instances for a service key.For a clustered
ActorSystemit only contain services on nodes that are not seen as unreachable (note that they could have still have become unreachable between this message being sent and the receiving actor processing it).For a list including both reachable and unreachable instances see
Receptionist.Listing.allServiceInstances(org.apache.pekko.actor.typed.receptionist.ServiceKey<T>)Also, see
ServiceKey.Listingfor more convenient pattern matching- Specified by:
serviceInstancesin interfaceReceptionist.Listing
-
getServiceInstances
public <M> java.util.Set<ActorRef<M>> getServiceInstances(ServiceKey<M> key)
Description copied from interface:Receptionist.ListingJava API: Return the reachable service instances.In a non-clustered
ActorSystemthis will always be all registered instances for a service key.For a clustered
ActorSystemit only contain services on nodes that has are not seen as unreachable (note that they could have still have become unreachable between this message being sent and the receiving actor processing it).For a list including both reachable and unreachable instances see
Receptionist.Listing.getAllServiceInstances(org.apache.pekko.actor.typed.receptionist.ServiceKey<T>)- Specified by:
getServiceInstancesin interfaceReceptionist.Listing
-
allServiceInstances
public <M> scala.collection.immutable.Set<ActorRef<M>> allServiceInstances(ServiceKey<M> key)
Description copied from interface:Receptionist.ListingScala API: Return both the reachable and the unreachable service instances.In a non-clustered
ActorSystemthis will always be the same asReceptionist.Listing.serviceInstances(org.apache.pekko.actor.typed.receptionist.ServiceKey<T>).For a clustered
ActorSystemthis include both services on nodes that are reachable and nodes that are unreachable.- Specified by:
allServiceInstancesin interfaceReceptionist.Listing
-
getAllServiceInstances
public <M> java.util.Set<ActorRef<M>> getAllServiceInstances(ServiceKey<M> key)
Description copied from interface:Receptionist.ListingJava API: Return both the reachable and the unreachable service instances.In a non-clustered
ActorSystemthis will always be the same asReceptionist.Listing.getServiceInstances(org.apache.pekko.actor.typed.receptionist.ServiceKey<T>).For a clustered
ActorSystemthis include both services on nodes that are reachable and nodes that are unreachable.- Specified by:
getAllServiceInstancesin interfaceReceptionist.Listing
-
copy
public <T> ReceptionistMessages.Listing<T> copy(ServiceKey<T> key, scala.collection.immutable.Set<ActorRef<T>> _serviceInstances, scala.collection.immutable.Set<ActorRef<T>> _allServiceInstances, boolean servicesWereAddedOrRemoved)
-
copy$default$1
public <T> ServiceKey<T> copy$default$1()
-
copy$default$2
public <T> scala.collection.immutable.Set<ActorRef<T>> copy$default$2()
-
copy$default$3
public <T> scala.collection.immutable.Set<ActorRef<T>> copy$default$3()
-
copy$default$4
public <T> boolean copy$default$4()
-
productPrefix
public java.lang.String productPrefix()
- Specified by:
productPrefixin interfacescala.Product
-
productArity
public int productArity()
- Specified by:
productArityin interfacescala.Product
-
productElement
public java.lang.Object productElement(int x$1)
- Specified by:
productElementin interfacescala.Product
-
productIterator
public scala.collection.Iterator<java.lang.Object> productIterator()
- Specified by:
productIteratorin interfacescala.Product
-
canEqual
public boolean canEqual(java.lang.Object x$1)
- Specified by:
canEqualin interfacescala.Equals
-
productElementName
public java.lang.String productElementName(int x$1)
- Specified by:
productElementNamein interfacescala.Product
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object x$1)
- Specified by:
equalsin interfacescala.Equals- Overrides:
equalsin classjava.lang.Object
-
-