autohit.server.command
Class CommandRegistry

java.lang.Object
  extended byjava.util.Dictionary
      extended byjava.util.Hashtable
          extended byorg.apache.commons.collections.ExtendedProperties
              extended byautohit.server.command.CommandRegistry
All Implemented Interfaces:
java.lang.Cloneable, java.util.Map, java.io.Serializable

public class CommandRegistry
extends org.apache.commons.collections.ExtendedProperties

Command registry implementation. This is immutable. Once created it is set. If you need to catch changes in the registry, you need to create a new instance. Using the default constructor will cause an exception!

This version of the registry will implement it as a ExtendedProperties set.

The registry has two sections. The first section associates the commands with numerics. There may ne NO duplicate numerics. (If there are, the system state is undefined.) This section is constructed as follows:

command.1=compile command.2=dump
("command.")(numeric)("=")(string name)

The second section contains entries for the commands defined in section one. This section is as follows:

compile.class=autohit.server.command.CommandCompile compile.help=This will compile a script found at the target.
(string name)(".class=")(class name for implementation) (string name)(".help=")(string giving a hint about the command)

Version:
1.0 Version History EPG - Initial - 25Jul03
Author:
Erich P. Gatejen
See Also:
Serialized Form

Field Summary
static java.lang.String FL_CLASS
           
static java.lang.String FL_COMMAND
          field literals
static java.lang.String FL_HELP
           
 
Fields inherited from class org.apache.commons.collections.ExtendedProperties
basePath, END_TOKEN, file, fileSeparator, include, isInitialized, keysAsListed, START_TOKEN
 
Constructor Summary
CommandRegistry()
          Default Constructor.
CommandRegistry(java.io.InputStream is)
          Constructor to create and load from an input stream.
 
Method Summary
 java.lang.Object instance(int numeric)
          Get an instance of the command specified by the numeric
 
Methods inherited from class org.apache.commons.collections.ExtendedProperties
addProperty, clearProperty, combine, convertProperties, display, getBoolean, getBoolean, getBoolean, getByte, getByte, getByte, getDouble, getDouble, getDouble, getFloat, getFloat, getFloat, getInclude, getInt, getInt, getInteger, getInteger, getInteger, getKeys, getKeys, getLong, getLong, getLong, getProperties, getProperties, getProperty, getShort, getShort, getShort, getString, getString, getStringArray, getVector, getVector, interpolate, isInitialized, load, load, save, setInclude, setProperty, subset, testBoolean
 
Methods inherited from class java.util.Hashtable
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

FL_COMMAND

public static final java.lang.String FL_COMMAND
field literals

See Also:
Constant Field Values

FL_CLASS

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

FL_HELP

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

CommandRegistry

public CommandRegistry()
                throws ServerException
Default Constructor. Don't use!

Throws:
ServerException

CommandRegistry

public CommandRegistry(java.io.InputStream is)
                throws ServerException
Constructor to create and load from an input stream.

Parameters:
is - input stream from where to read the registry
Throws:
ServerException
Method Detail

instance

public java.lang.Object instance(int numeric)
                          throws ServerException
Get an instance of the command specified by the numeric

Parameters:
numeric - numeric for the command
Returns:
the object instance.
Throws:
ServerException


Test.