Class Address

java.lang.Object
org.apache.pekko.actor.Address
All Implemented Interfaces:
Serializable, scala.Equals, scala.Product

public final class Address extends Object implements scala.Product, Serializable
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 Details

  • Method Details

    • InvalidHostRegex

      public static scala.util.matching.Regex InvalidHostRegex()
    • apply

      public static Address apply(String protocol, String system)
      Constructs a new Address with the specified protocol and system name
    • apply

      public static Address apply(String protocol, String system, String host, int port)
      Constructs a new Address with the specified protocol, system name, host and port
    • addressOrdering

      public static scala.math.Ordering<Address> addressOrdering()
      Address ordering type class, sorts addresses by protocol, name, host and port.
    • apply

      public static Address apply(String protocol, String system, scala.Option<String> host, scala.Option<Object> port)
    • unapply

      public static scala.Option<scala.Tuple4<String,String,scala.Option<String>,scala.Option<Object>>> unapply(Address x$0)
    • protocol

      public String protocol()
    • system

      public String system()
    • host

      public scala.Option<String> host()
    • port

      public scala.Option<Object> port()
    • copy

      public Address copy(String protocol, String system, scala.Option<String> host, scala.Option<Object> port)
    • copy$default$1

      public String copy$default$1()
    • copy$default$2

      public String copy$default$2()
    • copy$default$3

      public scala.Option<String> copy$default$3()
    • copy$default$4

      public scala.Option<Object> copy$default$4()
    • getHost

      public Optional<String> getHost()
      Java API: The hostname if specified or empty optional if not
    • getPort

      public Optional<Integer> 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 also pekko.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()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hostPort

      public String hostPort()
      Returns a String representation formatted as:

      system@host:port

    • productPrefix

      public String productPrefix()
      Specified by:
      productPrefix in interface scala.Product
    • productArity

      public int productArity()
      Specified by:
      productArity in interface scala.Product
    • productElement

      public Object productElement(int x$1)
      Specified by:
      productElement in interface scala.Product
    • productIterator

      public scala.collection.Iterator<Object> productIterator()
      Specified by:
      productIterator in interface scala.Product
    • canEqual

      public boolean canEqual(Object x$1)
      Specified by:
      canEqual in interface scala.Equals
    • productElementName

      public String productElementName(int x$1)
      Specified by:
      productElementName in interface scala.Product
    • equals

      public boolean equals(Object x$1)
      Specified by:
      equals in interface scala.Equals
      Overrides:
      equals in class Object