Package akka.actor

Class Address

  • All Implemented Interfaces:
    java.io.Serializable, scala.Equals, scala.Product, scala.Serializable

    public final class Address
    extends java.lang.Object
    implements scala.Product, scala.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:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      Address​(java.lang.String protocol, java.lang.String system)  
      Address​(java.lang.String protocol, java.lang.String system, java.lang.String host, int port)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static scala.math.Ordering<Address> addressOrdering()
      Address ordering type class, sorts addresses by protocol, name, host and port.
      static Address apply​(java.lang.String protocol, java.lang.String system)
      Constructs a new Address with the specified protocol and system name
      static Address apply​(java.lang.String protocol, java.lang.String system, java.lang.String host, int port)
      Constructs a new Address with the specified protocol, system name, host and port
      static Address apply​(java.lang.String protocol, java.lang.String system, scala.Option<java.lang.String> host, scala.Option<java.lang.Object> port)  
      boolean canEqual​(java.lang.Object x$1)  
      Address copy​(java.lang.String protocol, java.lang.String system, scala.Option<java.lang.String> host, scala.Option<java.lang.Object> port)  
      java.lang.String copy$default$1()  
      java.lang.String copy$default$2()  
      scala.Option<java.lang.String> copy$default$3()  
      scala.Option<java.lang.Object> copy$default$4()  
      boolean equals​(java.lang.Object x$1)  
      boolean hasGlobalScope()
      Returns true if this Address is usable globally.
      int hashCode()  
      boolean hasLocalScope()
      Returns true if this Address is only defined locally.
      scala.Option<java.lang.String> host()  
      java.lang.String hostPort()
      Returns a String representation formatted as:
      scala.Option<java.lang.Object> port()  
      int productArity()  
      java.lang.Object productElement​(int x$1)  
      scala.collection.Iterator<java.lang.Object> productIterator()  
      java.lang.String productPrefix()  
      java.lang.String protocol()  
      java.lang.String system()  
      java.lang.String toString()  
      static scala.Option<scala.Tuple4<java.lang.String,​java.lang.String,​scala.Option<java.lang.String>,​scala.Option<java.lang.Object>>> unapply​(Address x$0)  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Address

        public Address​(java.lang.String protocol,
                       java.lang.String system)
      • Address

        public Address​(java.lang.String protocol,
                       java.lang.String system,
                       java.lang.String host,
                       int port)
    • Method Detail

      • apply

        public static Address apply​(java.lang.String protocol,
                                    java.lang.String system)
        Constructs a new Address with the specified protocol and system name
        Parameters:
        protocol - (undocumented)
        system - (undocumented)
        Returns:
        (undocumented)
      • apply

        public static Address apply​(java.lang.String protocol,
                                    java.lang.String system,
                                    java.lang.String host,
                                    int port)
        Constructs a new Address with the specified protocol, system name, host and port
        Parameters:
        protocol - (undocumented)
        system - (undocumented)
        host - (undocumented)
        port - (undocumented)
        Returns:
        (undocumented)
      • addressOrdering

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

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

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

        public java.lang.String protocol()
      • system

        public java.lang.String system()
      • host

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

        public scala.Option<java.lang.Object> port()
      • 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 hasGlobalScope().
        Returns:
        (undocumented)
      • 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.
        Returns:
        (undocumented)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

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

        public java.lang.String hostPort()
        Returns a String representation formatted as:

        [email protected]:port

        Returns:
        (undocumented)
      • copy

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

        public java.lang.String copy$default$1()
      • copy$default$2

        public java.lang.String copy$default$2()
      • copy$default$3

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

        public scala.Option<java.lang.Object> copy$default$4()
      • productPrefix

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

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

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

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

        public boolean canEqual​(java.lang.Object x$1)
        Specified by:
        canEqual in interface scala.Equals
      • equals

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