autohit.server.command
Class CommandServerLocal

java.lang.Object
  extended byautohit.server.command.CommandServerLocal
All Implemented Interfaces:
CommandServer

public class CommandServerLocal
extends java.lang.Object
implements CommandServer

A LOCAL Command server. This one expects to be on the same system as the issuing agent (though you may be able to cheat this.) It will cache the command registry on load, so you'll need to dispose it and create a new one, if you want to capture changes. It will use the root logger as the response channel.

Version:
1.0 Version HistoryEPG - Initial - 25Jul03
Author:
Erich P. Gatejen

Field Summary
static java.lang.String RESPOND_FAILED
           
 
Constructor Summary
CommandServerLocal()
           
 
Method Summary
 java.lang.String execute(CommandAtom cmd)
          Execute a command.
 void init(SystemContext c)
          Initialize.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESPOND_FAILED

public static final java.lang.String RESPOND_FAILED
See Also:
Constant Field Values
Constructor Detail

CommandServerLocal

public CommandServerLocal()
Method Detail

init

public void init(SystemContext c)
          throws ServerException
Initialize. You can call this as often as you want, but must be called at least once.

Specified by:
init in interface CommandServer
Parameters:
c - the SystemContext
Throws:
ServerException

execute

public java.lang.String execute(CommandAtom cmd)
                         throws ServerException
Execute a command. Use default channel for response. If a response injector is not specified in the CommandAtom, we'll use the SystemContext root logger for the response channel.

Specified by:
execute in interface CommandServer
Parameters:
cmd - is a command atom
Returns:
printable string of some form. not defined by the interface.
Throws:
ServerException


Test.