org.apache.geronimo.corba
Class NameService

java.lang.Object
  extended by org.apache.geronimo.corba.NameService
All Implemented Interfaces:
GBeanLifecycle

public class NameService
extends Object
implements GBeanLifecycle

Starts the openejb transient cos naming service.

2809 localhost


Constructor Summary
protected NameService()
           
  NameService(ServerInfo serverInfo, ConfigAdapter config, String host, int port)
          GBean constructor to create a NameService instance.
 
Method Summary
 void doFail()
          Fails the GBean.
 void doStart()
          Start the NameService instance.
 void doStop()
          Stop the name server.
 InetSocketAddress getAddress()
          Get the InetSocketAddress for this NameService.
 String getHost()
          Retrieve the host name for this NameService instance.
 boolean getLocal()
          Get the "local" value for this server.
 int getPort()
          Get the port information for this NameService instance.
 String getURI()
          Return the NameService locator as a URI (generally using the corbaloc:: protocol);
 void setLocal(boolean l)
          Get the "local" value for this server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NameService

protected NameService()

NameService

public NameService(ServerInfo serverInfo,
                   ConfigAdapter config,
                   String host,
                   int port)
            throws Exception
GBean constructor to create a NameService instance.

Parameters:
serverInfo - The dependent ServerInfo. This value is not used, but is in the constructor to create an ordering dependency.
config - The ORB ConfigAdapter used to create the real NameService instance.
host - The advertised host name.
port - The listener port.
Throws:
Exception
Method Detail

getHost

public String getHost()
Retrieve the host name for this NameService instance.

Returns:
The String host name.

getPort

public int getPort()
Get the port information for this NameService instance.

Returns:
The configured name service listener port.

getLocal

public boolean getLocal()
Get the "local" value for this server. If true, an in-process NameService instance will be created when the service is started. If false, this is an indirect reference to a NameService (possibly located elsewhere).

Returns:
The current localServer value. The default is true.

setLocal

public void setLocal(boolean l)
Get the "local" value for this server. If true, an in-process NameService instance will be created when the service is started. If false, this is an indirect reference to a NameService (possibly located elsewhere).

Parameters:
l - The new local setting.

getAddress

public InetSocketAddress getAddress()
Get the InetSocketAddress for this NameService.

Returns:
An InetSocketAddress containing the host and port information.

getURI

public String getURI()
Return the NameService locator as a URI (generally using the corbaloc:: protocol);

Returns:
The URI in String format.

doStart

public void doStart()
             throws Exception
Start the NameService instance. If the local setting is true, will launch an appropriate in-process name server instance.

Specified by:
doStart in interface GBeanLifecycle
Throws:
Exception

doStop

public void doStop()
            throws Exception
Stop the name server. Only has an effect if doStart() launched an NameServer instance.

Specified by:
doStop in interface GBeanLifecycle
Throws:
Exception

doFail

public void doFail()
Description copied from interface: GBeanLifecycle
Fails the GBean. This informs the GBean that it is about to transition to the failed state.

Specified by:
doFail in interface GBeanLifecycle


Copyright © 2003-2008 The Apache Geronimo development community. All Rights Reserved.