org.jboss.services.binding
Class ServiceBinding

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

public class ServiceBinding
extends Object
implements Cloneable

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

Version:
$Revision: 57210 $
Author:
Mike Finn., Scott.Stark@jboss.org

Constructor Summary
ServiceBinding(String name, String hostName, int port)
          Creates a new instance of ServiceDescriptor
 
Method Summary
 Object clone()
          Make a copy of the ServiceBinding
 InetAddress getBindAddress()
          Gets the bindAddress attribute of the ServiceDescriptor object
 String getHostName()
          Returns host name
 String getName()
          Getter for property name.
 int getPort()
          Gets the port attribute of the ServiceDescriptor object
 void setBindAddress(InetAddress bindAddress)
          Sets the bindAddress attribute of the ServiceDescriptor object
 void setBindAddress(String hostName)
          Sets the bindAddress, given a hostname
 void setHostName(String hostName)
          Sets the host name
 void setName(String name)
          Setter for property name.
 void setPort(int port)
          Sets the port attribute of the ServiceDescriptor object
 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(String name,
                      String hostName,
                      int port)
               throws 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:
UnknownHostException - If hostName is not resolvable.
Method Detail

clone

public Object clone()
Make a copy of the ServiceBinding

Overrides:
clone in class Object

getName

public String getName()
Getter for property name.

Returns:
The name of the binding

setName

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

Parameters:
name - the name of the binding

setBindAddress

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

Parameters:
pInetAddr - The new bindAddress value

setBindAddress

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

Parameters:
pHostName - The hostname with which to create an InetAddress
Throws:
UnknownHostException - Hostname is not resolvable

getBindAddress

public 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

Parameters:
pPort - The new listen port number

getPort

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

Returns:
The listen port number

getHostName

public String getHostName()
Returns host name

Returns:
the hostname or address

setHostName

public void setHostName(String hostName)
Sets the host name

Parameters:
hostName, - the hostname or address

toString

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

Overrides:
toString in class Object
Returns:
String containing service descriptor properties


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.