fabric.common.net.naming
Class DefaultNameService

java.lang.Object
  extended by fabric.common.net.naming.DefaultNameService
All Implemented Interfaces:
NameService

public class DefaultNameService
extends java.lang.Object
implements NameService


Nested Class Summary
static class DefaultNameService.PortType
           
 
Constructor Summary
DefaultNameService(DefaultNameService.PortType portType)
          Loads the entries in the name service from properties files in a directory.
 
Method Summary
 SocketAddress localResolve(java.lang.String name)
          Create a socket address suitable for listening on.
 SocketAddress resolve(java.lang.String name)
          Create a socket address suitable for connecting to.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultNameService

public DefaultNameService(DefaultNameService.PortType portType)
                   throws java.io.IOException
Loads the entries in the name service from properties files in a directory. Scans the provided directory looking for files named *.properties. Creates a name service entry for each file found, with the name given by the filename (e.g foo for foo.properties), and address given by the PortType argument

Parameters:
portType - the type of port number to read.
Throws:
java.io.IOException
Method Detail

localResolve

public SocketAddress localResolve(java.lang.String name)
Description copied from interface: NameService
Create a socket address suitable for listening on.

Specified by:
localResolve in interface NameService

resolve

public SocketAddress resolve(java.lang.String name)
Description copied from interface: NameService
Create a socket address suitable for connecting to.

Specified by:
resolve in interface NameService