org.objectweb.carol.jndi.ns
Class AbsRegistry

java.lang.Object
  extended byorg.objectweb.carol.jndi.ns.AbsRegistry
All Implemented Interfaces:
NameService
Direct Known Subclasses:
CmiRegistry, DummyRegistry, IIOPCosNaming, IRMIRegistry, JacORBCosNaming, JeremieRegistry, JRMPRegistry

public abstract class AbsRegistry
extends java.lang.Object
implements NameService

This abstract class implements common methods of a NameService Registry should extend this class.

Author:
Florent Benoit

Constructor Summary
protected AbsRegistry()
          Build a new Registry
protected AbsRegistry(int defaultPortNumber)
          Build a new Registry with a given default port number
 
Method Summary
protected  java.util.Properties getConfigProperties()
           
 java.lang.String getHost()
           
 int getPort()
          get port method, get the port for the name service
 boolean isStarted()
          isStarted Method, check if a name service is started
protected  void resetStarted()
          Registry is stopped
 void setConfigProperties(java.util.Properties p)
          Set the configuration properties of the protocol
 void setHost(java.lang.String host)
          Set the address to use for bind
 void setPort(int p)
          set port method, set the port for the name service
protected  void setStarted()
          Registry is started
abstract  void start()
          start Method, Start a new NameService or do nothing if the name service is all ready start
abstract  void stop()
          stop Method, Stop a NameService or do nothing if the name service is all ready stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbsRegistry

protected AbsRegistry()
Build a new Registry


AbsRegistry

protected AbsRegistry(int defaultPortNumber)
Build a new Registry with a given default port number

Parameters:
defaultPortNumber - the default port number
Method Detail

start

public abstract void start()
                    throws NameServiceException
start Method, Start a new NameService or do nothing if the name service is all ready start

Specified by:
start in interface NameService
Throws:
NameServiceException - if a problem occure

stop

public abstract void stop()
                   throws NameServiceException
stop Method, Stop a NameService or do nothing if the name service is all ready stop

Specified by:
stop in interface NameService
Throws:
NameServiceException - if a problem occure

isStarted

public boolean isStarted()
isStarted Method, check if a name service is started

Specified by:
isStarted in interface NameService
Returns:
boolean true if the name service is started

setPort

public void setPort(int p)
set port method, set the port for the name service

Specified by:
setPort in interface NameService
Parameters:
p - port number

setHost

public void setHost(java.lang.String host)
Set the address to use for bind

Specified by:
setHost in interface NameService
Parameters:
host - hostname/ip address

getHost

public java.lang.String getHost()
Specified by:
getHost in interface NameService
Returns:
hostname/ip to use

getPort

public int getPort()
get port method, get the port for the name service

Specified by:
getPort in interface NameService
Returns:
int port number

setConfigProperties

public void setConfigProperties(java.util.Properties p)
Set the configuration properties of the protocol

Specified by:
setConfigProperties in interface NameService
Parameters:
p - configuration properties

setStarted

protected void setStarted()
Registry is started


resetStarted

protected void resetStarted()
Registry is stopped


getConfigProperties

protected java.util.Properties getConfigProperties()
Returns:
the configuration properties.