james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Noel J. Bergman" <n...@devtech.com>
Subject CommandMap for Handlers
Date Sun, 04 Aug 2002 04:08:05 GMT
I am proposing the inclusion of a CommandMap, which we can use in our
Handlers.  A prototypical use of the command map would look like:

	// initialize the command map
	commands = new CommandMap(new CommandMap.Command()
      {
            public do(String command, String argument, String argument1)
		{ // implementation of default command
		}
      });
	commands.add(<command>, new CommandMap.Command()
      {
		public do(String command, String argument, String argument1)
            { // implementation of <command>
            }
      });

e.g.,

	commands.add("USER", new CommandMap.Command()
      {
      });
	commands.add("PASS", new CommandMap.Command()
      {
      });

Later, when we have a command, it is invoked as:

	commands.do(command, argument, argument1);

This would simplify code, potentially speed up code, modularize the code,
improve readability, and allow us to add additional things to the
CommandMap.Command class such as stats, per command log strings, etc.

Comments?

	--- Noel


--
To unsubscribe, e-mail:   <mailto:james-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:james-dev-help@jakarta.apache.org>


Mime
View raw message