mx4j.tools.naming
Class CosNamingService

java.lang.Object
  |
  +--mx4j.tools.naming.CosNamingService
All Implemented Interfaces:
CosNamingServiceMBean

public class CosNamingService
extends java.lang.Object
implements CosNamingServiceMBean

An MBean that wraps tnameserv.

Calling start() will start tnameserv in a separate process via Runtime.exec(String command).

Version:
$Revision: 1.6 $
Author:
Simone Bordet

Constructor Summary
CosNamingService()
          Creates a new instance of CosNamingService with the default port (900).
CosNamingService(int port)
          Creates a new instance of CosNamingService with the specified port.
 
Method Summary
 long getDelay()
          Returns the delay (in milliseconds) that the start() and stop() methods waits before returning.
 int getPort()
          Returns the port on which tnameserv listens for incoming connections
 boolean isRunning()
          Returns whether this MBean has been started and not yet stopped.
 void setDelay(long delay)
          Sets the delay (in milliseconds) that the start() and stop() methods waits before returning.
 void setPort(int port)
          Sets the port on which tnameserv listens for incoming connections.
 void start()
          Starts this MBean: tnameserv can now accept incoming calls
 void stop()
          Stops this MBean: tnameserv cannot accept anymore incoming calls
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CosNamingService

public CosNamingService()
Creates a new instance of CosNamingService with the default port (900).

CosNamingService

public CosNamingService(int port)
Creates a new instance of CosNamingService with the specified port.
Method Detail

setPort

public void setPort(int port)
Sets the port on which tnameserv listens for incoming connections.
Specified by:
setPort in interface CosNamingServiceMBean
See Also:
getPort()

getPort

public int getPort()
Returns the port on which tnameserv listens for incoming connections
Specified by:
getPort in interface CosNamingServiceMBean
See Also:
setPort(int)

isRunning

public boolean isRunning()
Returns whether this MBean has been started and not yet stopped.
Specified by:
isRunning in interface CosNamingServiceMBean
See Also:
start()

setDelay

public void setDelay(long delay)
Sets the delay (in milliseconds) that the start() and stop() methods waits before returning. This is needed to allow the tnameserv process to really start and stop.
Specified by:
setDelay in interface CosNamingServiceMBean
See Also:
getDelay()

getDelay

public long getDelay()
Returns the delay (in milliseconds) that the start() and stop() methods waits before returning.
Specified by:
getDelay in interface CosNamingServiceMBean
See Also:
setDelay(long)

start

public void start()
Starts this MBean: tnameserv can now accept incoming calls
Specified by:
start in interface CosNamingServiceMBean
See Also:
stop(), isRunning()

stop

public void stop()
Stops this MBean: tnameserv cannot accept anymore incoming calls
Specified by:
stop in interface CosNamingServiceMBean
See Also:
start()


Copyright © 2001-2002 MX4J Team. All Rights Reserved.