org.jboss.services.binding
Class ServiceBinding

java.lang.Object
  extended byorg.jboss.services.binding.ServiceBinding
All Implemented Interfaces:
java.lang.Cloneable

public class ServiceBinding
extends java.lang.Object
implements java.lang.Cloneable

A ServiceBinding is a {name,virtualHost,port,interfaceAddress} quad specifying a named binding for a service.


Constructor Summary
ServiceBinding(java.lang.String name, java.lang.String hostName, int port)
          Creates a new instance of ServiceDescriptor
 
Method Summary
 java.lang.Object clone()
          Make a copy of the ServiceBinding
 java.net.InetAddress getBindAddress()
          Gets the bindAddress attribute of the ServiceDescriptor object
 java.lang.String getHostName()
          Returns host name
 java.lang.String getName()
          Getter for property name.
 int getPort()
          Gets the port attribute of the ServiceDescriptor object
 void setBindAddress(java.net.InetAddress bindAddress)
          Sets the bindAddress attribute of the ServiceDescriptor object
 void setBindAddress(java.lang.String hostName)
          Sets the bindAddress, given a hostname
 void setHostName(java.lang.String hostName)
          Sets the host name
 void setName(java.lang.String name)
          Setter for property name.
 void setPort(int port)
          Sets the port attribute of the ServiceDescriptor object
 java.lang.String toString()
          Create string representation of the service descriptor
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ServiceBinding

public ServiceBinding(java.lang.String name,
                      java.lang.String hostName,
                      int port)
               throws java.net.UnknownHostException
Creates a new instance of ServiceDescriptor

Parameters:
name - The name of the binding. A null or empty name implies that default binding for a service.
hostName - The virtual host name. This is the interface name used to construct the bindAddress value. A null value implies bind on any interface.
port - The port the service should listen on. A 0 value implies an anonymous port.
Throws:
java.net.UnknownHostException - If hostName is not resolvable.
Method Detail

clone

public java.lang.Object clone()
Make a copy of the ServiceBinding


getName

public java.lang.String getName()
Getter for property name.

Returns:
The name of the binding

setName

public void setName(java.lang.String name)
Setter for property name.

Parameters:
name - the name of the binding

setBindAddress

public void setBindAddress(java.net.InetAddress bindAddress)
Sets the bindAddress attribute of the ServiceDescriptor object


setBindAddress

public void setBindAddress(java.lang.String hostName)
                    throws java.net.UnknownHostException
Sets the bindAddress, given a hostname

Throws:
java.net.UnknownHostException - Hostname is not resolvable

getBindAddress

public java.net.InetAddress getBindAddress()
Gets the bindAddress attribute of the ServiceDescriptor object

Returns:
The listen address

setPort

public void setPort(int port)
Sets the port attribute of the ServiceDescriptor object


getPort

public int getPort()
Gets the port attribute of the ServiceDescriptor object

Returns:
The listen port number

getHostName

public java.lang.String getHostName()
Returns host name

Returns:
the hostname or address

setHostName

public void setHostName(java.lang.String hostName)
Sets the host name


toString

public java.lang.String toString()
Create string representation of the service descriptor

Returns:
String containing service descriptor properties