akka.actor
Class Address

java.lang.Object
  extended by akka.actor.Address
All Implemented Interfaces:
java.io.Serializable, scala.Equals, scala.Product

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
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
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
 boolean hasGlobalScope()
          Returns true if this Address is usable globally.
 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()
           
 java.lang.String protocol()
           
 java.lang.String system()
           
 java.lang.String toString()
          Returns the canonical String representation of this Address formatted as:
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface scala.Product
productArity, productElement, productIterator, productPrefix
 
Methods inherited from interface scala.Equals
canEqual, equals
 

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


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


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().


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.


toString

public java.lang.String toString()
Returns the canonical String representation of this Address formatted as:

://@:

Overrides:
toString in class java.lang.Object

hostPort

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

@: