Class ActorSelection
- java.lang.Object
- 
- org.apache.pekko.actor.ActorSelection
 
- 
- All Implemented Interfaces:
- java.io.Serializable
 
 public abstract class ActorSelection extends java.lang.Object implements java.io.SerializableAn ActorSelection is a logical view of a section of an ActorSystem's tree of Actors, allowing for broadcasting of messages to that section.- See Also:
- Serialized Form
 
- 
- 
Constructor SummaryConstructors Constructor Description ActorSelection()
 - 
Method SummaryAll Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected abstract ActorRefanchor()ActorPathanchorPath()Thepekko.actor.ActorPathof the anchor actor.static ActorSelectionapply(ActorRef anchorRef, java.lang.String path)Construct an ActorSelection from the given string representing a path relative to the given target.static ActorSelectionapply(ActorRef anchorRef, scala.collection.Iterable<java.lang.String> elements)Construct an ActorSelection from the given string representing a path relative to the given target.booleanequals(java.lang.Object obj)voidforward(java.lang.Object message, ActorContext context)Forwards the message and passes the original sender actor as the sender.inthashCode()protected abstract scala.collection.immutable.IndexedSeq<SelectionPathElement>path()java.lang.StringpathString()String representation of the path elements, starting with "/" and separated with "/".java.util.concurrent.CompletionStage<ActorRef>resolveOne(java.time.Duration timeout)Java API forresolveOne(org.apache.pekko.util.Timeout)scala.concurrent.Future<ActorRef>resolveOne(Timeout timeout)Resolve theActorRefmatching this selection.scala.concurrent.Future<ActorRef>resolveOne(scala.concurrent.duration.FiniteDuration timeout)Resolve theActorRefmatching this selection.java.util.concurrent.CompletionStage<ActorRef>resolveOneCS(java.time.Duration timeout)Deprecated.Use the overloaded method resolveOne which accepts java.time.Duration instead.java.util.concurrent.CompletionStage<ActorRef>resolveOneCS(scala.concurrent.duration.FiniteDuration timeout)Deprecated.Use the overloaded method resolveOne which accepts java.time.Duration instead.voidtell(java.lang.Object msg, ActorRef sender)Sends the specified message to this ActorSelection, i.e.static ScalaActorSelectiontoScala(ActorSelection sel)java.lang.StringtoSerializationFormat()String representation of the actor selection suitable for storage and recreation.java.lang.StringtoString()
 
- 
- 
- 
Method Detail- 
toScalapublic static ScalaActorSelection toScala(ActorSelection sel) 
 - 
applypublic static ActorSelection apply(ActorRef anchorRef, java.lang.String path) Construct an ActorSelection from the given string representing a path relative to the given target. This operation has to create all the matching magic, so it is preferable to cache its result if the intention is to send messages frequently.
 - 
applypublic static ActorSelection apply(ActorRef anchorRef, scala.collection.Iterable<java.lang.String> elements) Construct an ActorSelection from the given string representing a path relative to the given target. This operation has to create all the matching magic, so it is preferable to cache its result if the intention is to send messages frequently.
 - 
anchorprotected abstract ActorRef anchor() 
 - 
pathprotected abstract scala.collection.immutable.IndexedSeq<SelectionPathElement> path() 
 - 
tellpublic void tell(java.lang.Object msg, ActorRef sender)Sends the specified message to this ActorSelection, i.e. fire-and-forget semantics, including the sender reference if possible.Pass ActorRef.noSender()ornullas sender if there is nobody to reply to
 - 
forwardpublic void forward(java.lang.Object message, ActorContext context)Forwards the message and passes the original sender actor as the sender.Works, no matter whether originally sent with tell/'!' or ask/'?'. 
 - 
resolveOnepublic scala.concurrent.Future<ActorRef> resolveOne(Timeout timeout) Resolve theActorRefmatching this selection. The result is returned as a Future that is completed with theActorRefif such an actor exists. It is completed with failureActorNotFoundif no such actor exists or the identification didn't complete within the suppliedtimeout.Under the hood it talks to the actor to verify its existence and acquire its ActorRef.
 - 
resolveOnepublic scala.concurrent.Future<ActorRef> resolveOne(scala.concurrent.duration.FiniteDuration timeout) Resolve theActorRefmatching this selection. The result is returned as a Future that is completed with theActorRefif such an actor exists. It is completed with failureActorNotFoundif no such actor exists or the identification didn't complete within the suppliedtimeout.Under the hood it talks to the actor to verify its existence and acquire its ActorRef.
 - 
resolveOneCSpublic java.util.concurrent.CompletionStage<ActorRef> resolveOneCS(scala.concurrent.duration.FiniteDuration timeout) Deprecated.Use the overloaded method resolveOne which accepts java.time.Duration instead. Since Akka 2.5.20.Java API forresolveOne(org.apache.pekko.util.Timeout)Resolve the ActorRefmatching this selection. The result is returned as a CompletionStage that is completed with theActorRefif such an actor exists. It is completed with failureActorNotFoundif no such actor exists or the identification didn't complete within the suppliedtimeout.
 - 
resolveOneCSpublic java.util.concurrent.CompletionStage<ActorRef> resolveOneCS(java.time.Duration timeout) Deprecated.Use the overloaded method resolveOne which accepts java.time.Duration instead. Since Akka 2.5.20.Java API forresolveOne(org.apache.pekko.util.Timeout)Resolve the ActorRefmatching this selection. The result is returned as a CompletionStage that is completed with theActorRefif such an actor exists. It is completed with failureActorNotFoundif no such actor exists or the identification didn't complete within the suppliedtimeout.
 - 
resolveOnepublic java.util.concurrent.CompletionStage<ActorRef> resolveOne(java.time.Duration timeout) Java API forresolveOne(org.apache.pekko.util.Timeout)Resolve the ActorRefmatching this selection. The result is returned as a CompletionStage that is completed with theActorRefif such an actor exists. It is completed with failureActorNotFoundif no such actor exists or the identification didn't complete within the suppliedtimeout.
 - 
toStringpublic java.lang.String toString() - Overrides:
- toStringin class- java.lang.Object
 
 - 
anchorPathpublic ActorPath anchorPath() Thepekko.actor.ActorPathof the anchor actor.
 - 
pathStringpublic java.lang.String pathString() String representation of the path elements, starting with "/" and separated with "/".
 - 
toSerializationFormatpublic java.lang.String toSerializationFormat() String representation of the actor selection suitable for storage and recreation. The output is similar to the URI fragment returned bypekko.actor.ActorPath#toSerializationFormat.- Returns:
- URI fragment
 
 - 
equalspublic boolean equals(java.lang.Object obj) - Overrides:
- equalsin class- java.lang.Object
 
 - 
hashCodepublic int hashCode() - Overrides:
- hashCodein class- java.lang.Object
 
 
- 
 
-