net.larsan.urd.cmd
Class CmdServer

java.lang.Object
  |
  +--net.larsan.urd.cmd.CmdServer
All Implemented Interfaces:
Controller, RegistryListener, ServerContext, UrdServerListener

public class CmdServer
extends java.lang.Object
implements UrdServerListener, Controller, ServerContext, RegistryListener

A non-blocking command line server for the Urd framework server.

Version:
Alpha-0.1 / 2002-10-06 21:37
Author:
Lars J. Nilsson

Constructor Summary
CmdServer()
           
 
Method Summary
 void addCmdListener(CmdEventListener list)
          Add a command line event listener.
 void attachServer(UrdServer server)
          Attach server to controller.
 void fireEvent(CmdEvent event)
           
 java.lang.String getBindAddress()
           
 Connections getConnectionQueue()
           
 int getRandom()
           
 UserHandle getUserService()
           
 boolean isOpen()
           
 void receiveRegistryEvent(RegistryEvent e)
          Receive registry event.
 void removeCmdListener(CmdEventListener list)
          Remove a command line event listener.
 void reportException(java.lang.Throwable th)
           
 void serverStarted()
          Urd server has started
 void serverStopped()
          Urd server has stopped
 void setBindAddress(java.lang.String bindAddress)
           
 void setBindPort(java.lang.String bindPort)
           
 void setContext(javax.naming.Context con)
          Set the server context.
 void start()
          Start command line server
 void stop()
          Stop command line server
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CmdServer

public CmdServer()
          throws java.io.IOException
Method Detail

attachServer

public void attachServer(UrdServer server)
Description copied from interface: Controller
Attach server to controller.

Specified by:
attachServer in interface Controller

setContext

public void setContext(javax.naming.Context con)
Description copied from interface: Controller
Set the server context.

Specified by:
setContext in interface Controller

serverStarted

public void serverStarted()
Description copied from interface: UrdServerListener
Urd server has started

Specified by:
serverStarted in interface UrdServerListener

serverStopped

public void serverStopped()
Description copied from interface: UrdServerListener
Urd server has stopped

Specified by:
serverStopped in interface UrdServerListener

start

public void start()
Start command line server


stop

public void stop()
Stop command line server


addCmdListener

public void addCmdListener(CmdEventListener list)
Add a command line event listener.

Parameters:
list - Listener to add, must not be null

removeCmdListener

public void removeCmdListener(CmdEventListener list)
Remove a command line event listener.

Parameters:
list - Listener to remove

setBindAddress

public void setBindAddress(java.lang.String bindAddress)

setBindPort

public void setBindPort(java.lang.String bindPort)

receiveRegistryEvent

public void receiveRegistryEvent(RegistryEvent e)
Description copied from interface: RegistryListener
Receive registry event.

Specified by:
receiveRegistryEvent in interface RegistryListener

isOpen

public boolean isOpen()
Specified by:
isOpen in interface ServerContext

fireEvent

public void fireEvent(CmdEvent event)
Specified by:
fireEvent in interface ServerContext

reportException

public void reportException(java.lang.Throwable th)
Specified by:
reportException in interface ServerContext

getConnectionQueue

public Connections getConnectionQueue()
Specified by:
getConnectionQueue in interface ServerContext

getUserService

public UserHandle getUserService()
Specified by:
getUserService in interface ServerContext

getRandom

public int getRandom()
Specified by:
getRandom in interface ServerContext

getBindAddress

public java.lang.String getBindAddress()
Specified by:
getBindAddress in interface ServerContext