autohit.server.invoker
Class SimTextCommand

java.lang.Object
  extended byautohit.server.invoker.SimTextCommand

public class SimTextCommand
extends java.lang.Object

Text command processor for SimVM. It'll create the command atoms and return them.

  compile(name) - force compile a script dump(name) - dump an compiled object run(name) {
  	vm }
  -spawn a script into an automat ps
  	- process list by PID kill(PID)
  	- kill processes exit
  	- exit props
  	- list properties set
  	- set a property name =
  	{ value }
 

Only handles VMExecutable compiles now. Compiles to cache space.

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

Field Summary
static java.lang.String COMMAND_COMPILE
           
static int COMMAND_COMPILE_TOKEN
           
static java.lang.String COMMAND_DUMP
           
static int COMMAND_DUMP_TOKEN
           
static java.lang.String COMMAND_EXIT
           
static java.lang.String COMMAND_KILL
           
static int COMMAND_KILL_TOKEN
           
static java.lang.String COMMAND_LOADPROPS
           
static int COMMAND_LOADPROPS_TOKEN
           
static java.lang.String COMMAND_PROPS
           
static int COMMAND_PROPS_TOKEN
           
static java.lang.String COMMAND_PS
           
static int COMMAND_PS_TOKEN
           
static java.lang.String COMMAND_RUN
           
static int COMMAND_RUN_TOKEN
           
static java.lang.String COMMAND_SAVEPROPS
           
static int COMMAND_SAVEPROPS_TOKEN
           
static java.lang.String COMMAND_SET
           
static int COMMAND_SET_TOKEN
           
protected  CommandServer cServer
           
protected  SystemContext sc
           
static int TOKEN_COMMAND_BAD
          Command dictionary.
static int TOKEN_COMMAND_CORRUPT
           
 
Constructor Summary
SimTextCommand()
          Default constructor
 
Method Summary
 CommandAtom create(java.lang.String command)
          This will create a command atom based on the command passed
protected  void finalize()
          finalizer Clear anything we don't need
 void init(SystemContext c)
          Initialize with defaults.
 void init(SystemContext c, Injector control, Injector client)
          Initialize.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TOKEN_COMMAND_BAD

public static final int TOKEN_COMMAND_BAD
Command dictionary. IMPORTANT! The command tokens must match the numbers in the CommandRegistry!

See Also:
Constant Field Values

COMMAND_COMPILE

public static final java.lang.String COMMAND_COMPILE
See Also:
Constant Field Values

COMMAND_COMPILE_TOKEN

public static final int COMMAND_COMPILE_TOKEN
See Also:
Constant Field Values

COMMAND_DUMP

public static final java.lang.String COMMAND_DUMP
See Also:
Constant Field Values

COMMAND_DUMP_TOKEN

public static final int COMMAND_DUMP_TOKEN
See Also:
Constant Field Values

COMMAND_RUN

public static final java.lang.String COMMAND_RUN
See Also:
Constant Field Values

COMMAND_RUN_TOKEN

public static final int COMMAND_RUN_TOKEN
See Also:
Constant Field Values

COMMAND_PS

public static final java.lang.String COMMAND_PS
See Also:
Constant Field Values

COMMAND_PS_TOKEN

public static final int COMMAND_PS_TOKEN
See Also:
Constant Field Values

COMMAND_KILL

public static final java.lang.String COMMAND_KILL
See Also:
Constant Field Values

COMMAND_KILL_TOKEN

public static final int COMMAND_KILL_TOKEN
See Also:
Constant Field Values

COMMAND_PROPS

public static final java.lang.String COMMAND_PROPS
See Also:
Constant Field Values

COMMAND_PROPS_TOKEN

public static final int COMMAND_PROPS_TOKEN
See Also:
Constant Field Values

COMMAND_SET

public static final java.lang.String COMMAND_SET
See Also:
Constant Field Values

COMMAND_SET_TOKEN

public static final int COMMAND_SET_TOKEN
See Also:
Constant Field Values

COMMAND_LOADPROPS

public static final java.lang.String COMMAND_LOADPROPS
See Also:
Constant Field Values

COMMAND_LOADPROPS_TOKEN

public static final int COMMAND_LOADPROPS_TOKEN
See Also:
Constant Field Values

COMMAND_SAVEPROPS

public static final java.lang.String COMMAND_SAVEPROPS
See Also:
Constant Field Values

COMMAND_SAVEPROPS_TOKEN

public static final int COMMAND_SAVEPROPS_TOKEN
See Also:
Constant Field Values

COMMAND_EXIT

public static final java.lang.String COMMAND_EXIT
See Also:
Constant Field Values

TOKEN_COMMAND_CORRUPT

public static final int TOKEN_COMMAND_CORRUPT
See Also:
Constant Field Values

sc

protected SystemContext sc

cServer

protected CommandServer cServer
Constructor Detail

SimTextCommand

public SimTextCommand()
Default constructor

Method Detail

init

public void init(SystemContext c)
          throws java.lang.Exception
Initialize with defaults. It'll use the default SystemContext injectors which are tied to the AutohitLogManager. You can call this as often as you want, but must be called at least once.

Parameters:
c - the SystemContext
Throws:
java.lang.Exception

init

public void init(SystemContext c,
                 Injector control,
                 Injector client)
          throws java.lang.Exception
Initialize. Specify the contol and client channels. You can call this as often as you want, but must be called at least once.

Parameters:
control - Control injector
client - Client injector
c - the SystemContext
Throws:
java.lang.Exception

create

public CommandAtom create(java.lang.String command)
                   throws ServerException
This will create a command atom based on the command passed

Parameters:
command - textual command
Returns:
CommandAtom
Throws:
ServerException. - It will throw a AutohitErrorCodes.CODE_SERVER_DONE if given the exit command.
ServerException

finalize

protected void finalize()
                 throws java.lang.Throwable
finalizer Clear anything we don't need

Throws:
java.lang.Throwable


Test.