james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sascha Kulawik" <sas...@kulawik.de>
Subject RE: CommandMap for Handlers
Date Sun, 04 Aug 2002 09:52:01 GMT
Great idea.
The IMAP Commands are called as the same way.

> -----Original Message-----
> From: Noel J. Bergman [mailto:noel@devtech.com] 
> Sent: Sunday, August 04, 2002 6:08 AM
> To: James-Dev Mailing List
> Subject: CommandMap for Handlers
> 
> 
> 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
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message