Package org.apache.pekko.actor
Class Address
java.lang.Object
org.apache.pekko.actor.Address
- All Implemented Interfaces:
Serializable,scala.Equals,scala.Product
The address specifies the physical location under which an Actor can be
reached. Examples are local addresses, identified by the ActorSystem’s
name, and remote addresses, identified by protocol, host and port.
This class is final to allow use as a case class (copy method etc.); if for example a remote transport would want to associate additional information with an address, then this must be done externally.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic scala.math.Ordering<Address>Addressordering type class, sorts addresses by protocol, name, host and port.static AddressConstructs a new Address with the specified protocol and system namestatic AddressConstructs a new Address with the specified protocol, system name, host and portstatic Addressbooleanscala.Option<String>scala.Option<Object>booleangetHost()Java API: The hostname if specified or empty optional if notgetPort()Java API: The port if specified or empty optional if notbooleanReturns true if this Address is usable globally.inthashCode()booleanReturns true if this Address is only defined locally.scala.Option<String>host()hostPort()Returns a String representation formatted as:static scala.util.matching.Regexscala.Option<Object>port()intproductElement(int x$1) productElementName(int x$1) scala.collection.Iterator<Object>protocol()system()toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface scala.Product
productElementNames
-
Constructor Details
-
Address
-
Address
-
-
Method Details
-
InvalidHostRegex
public static scala.util.matching.Regex InvalidHostRegex() -
apply
Constructs a new Address with the specified protocol and system name -
apply
Constructs a new Address with the specified protocol, system name, host and port -
addressOrdering
Addressordering type class, sorts addresses by protocol, name, host and port. -
apply
-
unapply
-
protocol
-
system
-
host
-
port
-
copy
-
copy$default$1
-
copy$default$2
-
copy$default$3
-
copy$default$4
-
getHost
Java API: The hostname if specified or empty optional if not -
getPort
Java API: The port if specified or empty optional if not -
hasLocalScope
public boolean hasLocalScope()Returns true if this Address is only defined locally. It is not safe to send locally scoped addresses to remote hosts. See alsopekko.actor.Address#hasGlobalScope. -
hasGlobalScope
public boolean hasGlobalScope()Returns true if this Address is usable globally. Unlike locally defined addresses (hasLocalScope()) addresses of global scope are safe to sent to other hosts, as they globally and uniquely identify an addressable entity. -
hashCode
public int hashCode() -
toString
-
hostPort
Returns a String representation formatted as:system@host:port -
productPrefix
- Specified by:
productPrefixin interfacescala.Product
-
productArity
public int productArity()- Specified by:
productArityin interfacescala.Product
-
productElement
- Specified by:
productElementin interfacescala.Product
-
productIterator
- Specified by:
productIteratorin interfacescala.Product
-
canEqual
- Specified by:
canEqualin interfacescala.Equals
-
productElementName
- Specified by:
productElementNamein interfacescala.Product
-
equals
-